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

未關閉
#2,056 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
12/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
java, perl
領域
compilers

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.
主要語言
Perl
星號
67
分支
8
平均合併
5 小時 12 分鐘
30 天內合併 PR
131

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。