Port Syntax::Keyword::Try using the parser keyword extension
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 12/100
Direção de pesquisa
This is parser-keyword provider work built on the merged parser extension API from #1292 and PR #1883, so start with the keyword-plugin code those reference rather than the CPAN module. Read how the Function::Parameters provider registers keywords and lowers to the shared AST, then plan the try/catch/finally nodes. Done means the focused tests for normal, thrown, finally, return and lexical-scope cases pass on both JVM and interpreter backends.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
Add a PerlOnJava provider for Syntax::Keyword::Try using the parser keyword extension and shared AST. The CPAN distribution implements try/catch/finally as parser syntax; its XS implementation cannot load in PerlOnJava, but a parser-backed provider can support the language behavior without porting the Perl 5 XS ABI.
Motivation and evidence
The archived CPAN run 20261112-134536-63590 tested Data::Structure::Deserialize::Auto 1.01. Its nine failing test programs all aborted while loading Syntax::Keyword::Try with no Java XS implementation available, before reaching deserialization assertions. The target imports Syntax::Keyword::Try unconditionally.
I installed the target and its prerequisites into an isolated temporary library and ran its unmodified suite with system Perl 5.34.1. All 10 test programs and 11 tests passed. Syntax::Keyword::Try 0.31 and its XS parser dependency compiled under system Perl; its own test suite passed. This confirms the PerlOnJava failure is the missing parser-syntax provider, not a failure in the target module's behavior.
MetaCPAN's reverse-dependency endpoint reported 67 raw candidate records. Of the 50 records returned on its first page, 49 unique released distributions declare Syntax::Keyword::Try as a required runtime dependency; all 49 were released in the five-year window beginning 2021-11-13. Examples include Data-Structure-Deserialize-Auto, Workflow, Mojo-Darkpan, MCP-Wiki, Feature-Compat-Try, and Zydeco. The endpoint returned an empty second page, so 49 is a verified lower bound for both unique runtime dependants and recent dependants, not a complete count.
Existing parser work
- #1292 introduced the parser keyword-plugin API.
- PR #1883 merged that API and the
Function::Parametersprovider on 2026-10-26. - #1361 tracks the
Function::Parametersconsumer and its remaining compatibility gaps.
This issue tracks a separate provider that uses the now-merged parser extension capability.
Suggested scope
Implement a documented useful subset of Syntax::Keyword::Try using the shared AST consumed by both backends. Start with try and catch, then add finally with Perl-compatible cleanup and exception propagation. Preserve behavior for return and loop-control statements where supported by the parser/runtime. Keep imports and keyword activation scoped to the compiling lexical context. Explicitly document and diagnose unsupported module options or experimental syntax.
Do not use a source filter or attempt to load the CPAN XS object. Reuse the parser-plugin lifecycle from #1292 and add project-owned tests validated against system Perl first.
Acceptance criteria
- A bundled provider loads
Syntax::Keyword::Tryon JVM and interpreter backends without XS loading. - Focused tests cover normal completion, thrown and caught exceptions, optional catch variables, finally execution, exception propagation, return behavior, and lexical activation/removal.
- The upstream
Syntax::Keyword::Trytests that match the supported subset pass, andData::Structure::Deserialize::Auto1.01 progresses past module loading on both backends. - Unsupported syntax fails with a source-located diagnostic; it is not silently treated as ordinary Perl code.
- Linguagem predominante
- Perl
- Estrelas
- 67
- Forks
- 8
- Merge médio
- 5h 12min
- PRs com merge (30d)
- 131
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de fglock/PerlOnJava
-
area:cpan-port bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
fglock/PerlOnJava#2153 ·
Mantenedores costumam responder em até 1 dia
-
area:cpan-port area:parser bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
fglock/PerlOnJava#2137 ·
Mantenedores costumam responder em até 1 dia
-
area:backend area:cpan-port area:runtime bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
fglock/PerlOnJava#2071 ·
Mantenedores costumam responder em até 1 dia
-
area:runtime documentation enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
fglock/PerlOnJava#1579 ·
Mantenedores costumam responder em até 1 dia
-
area:cpan-port bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 62/100
fglock/PerlOnJava#2157 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de fglock/PerlOnJava
Issues semelhantes
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksAbertateam-cli
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 93/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
inverse-inc/packetfence#9728 ·
Mantenedores costumam responder em até 1 dia
-
fix(char-create): show the real reason a character is refusedTalvez já em andamento @baphomello assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia