Parser rejects whitespace before legacy apostrophe separator in @_ variable
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
The failure is in the parser's handling of variable names with the legacy apostrophe separator, reached when whitespace follows the sigil in my @args = @ '_;. Start by reproducing the minimal sub f case on both the JVM and bytecode interpreter backends, then find where the tokenizer or variable-name parser consumes the apostrophe. Done means the snippet parses as @_, a regression test passes on both backends, and PDF::Tiny 0.09 loads.
由索引模型根據 Issue 內容生成。
描述
Summary
PerlOnJava rejects a valid legacy Perl spelling of the argument array when whitespace separates the array sigil from the apostrophe package separator:
my @args = @ '_;
System Perl accepts this and deparses it as my(@args) = @_;. PerlOnJava reports a syntax error at the apostrophe on both the JVM and bytecode interpreter backends.
Reproduction
use strict;
use warnings;
sub f {
my @args = @ '_;
return scalar @args;
}
print f(1, 2), "\n";
Results:
- System Perl 5.34.1:
perl -csucceeds;perl -MO=Deparsenormalizes the expression to@_. - PerlOnJava JVM backend: compile fails at line 4 with
syntax error ... near "'_;". - PerlOnJava bytecode interpreter: same compile error.
CPAN evidence
PDF::Tiny 0.09 uses the same expression in PDF::Tiny::_flatten_pages:
my ($self, $pages_id, $pages, $pages_array) = @ '_;
In CPAN random run 20261120-195805-13340, PerlOnJava failed to load the module at this line, so t/pdf-tiny.t ran zero subtests. The system Perl oracle for that run passed the complete upstream suite: 1 test file and 26 tests. The module is pure Perl and has no native/XS prerequisite.
Likely area
The parser supports legacy apostrophe package separators while parsing variable names, but appears to reject or mis-tokenize this form when whitespace follows the sigil. The reproducer shows that the whitespace and separator are accepted by standard Perl and that the expression means @_.
Acceptance criteria
- Parse
@ '_as@_, preserving standard Perl behavior. - Add a project-owned regression for the minimal case and validate it with standard Perl first.
- Pass the regression on both JVM and bytecode interpreter backends.
- Confirm PDF::Tiny 0.09 loads and its test suite passes under PerlOnJava.
- 主要語言
- Perl
- 星號
- 67
- 分支
- 8
- 平均合併
- 4 小時 36 分鐘
- 30 天內合併 PR
- 123
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
fglock/PerlOnJava 的其他 Issue
-
area:runtime bug
難度 2/5 1-3 小時 新手友好度 72/100
fglock/PerlOnJava#2164 ·
維護者通常 1 天內回覆
-
area:cpan-port bug
難度 2/5 1-3 小時 新手友好度 70/100
fglock/PerlOnJava#2153 ·
維護者通常 1 天內回覆
-
area:cpan-port area:parser bug
難度 2/5 1-3 小時 新手友好度 68/100
fglock/PerlOnJava#2137 ·
維護者通常 1 天內回覆
-
area:backend area:cpan-port area:runtime bug
難度 2/5 1-3 小時 新手友好度 76/100
fglock/PerlOnJava#2071 ·
維護者通常 1 天內回覆
-
area:runtime documentation enhancement
難度 2/5 1-3 小時 新手友好度 72/100
fglock/PerlOnJava#1579 ·
維護者通常 1 天內回覆
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling links未關閉team-cli
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 66/100
-
難度 1/5 1 小時以內 新手友好度 93/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 73/100
inverse-inc/packetfence#9728 ·
維護者通常 1 天內回覆
-
fix(char-create): show the real reason a character is refused可能已有人在做 @baphomello 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆