Port Syntax::Keyword::Try using the parser keyword extension

Abierto
#2,056 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
12/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java, perl
Área
compilers

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:cpan-port area:parser enhancement

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::Parameters provider on 2026-10-26.
  • #1361 tracks the Function::Parameters consumer 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::Try on 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::Try tests that match the supported subset pass, and Data::Structure::Deserialize::Auto 1.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.
Lenguaje dominante
Perl
Estrellas
67
Forks
8
Merge medio
5 h 12 min
PR fusionados (30 d)
131

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fglock/PerlOnJava

Todos los issues de fglock/PerlOnJava

Issues similares

Más issues de Perl

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.