Parser rejects whitespace before legacy apostrophe separator in @_ variable
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 42/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Perl
- Étoiles
- 67
- Forks
- 8
- Merge moyen
- 4 h 36 min
- PR mergées (30 j)
- 123
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de fglock/PerlOnJava
-
area:runtime bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
fglock/PerlOnJava#2164 ·
Les mainteneurs répondent en général sous 1 jour
-
area:cpan-port bug
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
fglock/PerlOnJava#2153 ·
Les mainteneurs répondent en général sous 1 jour
-
area:cpan-port area:parser bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
fglock/PerlOnJava#2137 ·
Les mainteneurs répondent en général sous 1 jour
-
area:backend area:cpan-port area:runtime bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
fglock/PerlOnJava#2071 ·
Les mainteneurs répondent en général sous 1 jour
-
area:runtime documentation enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
fglock/PerlOnJava#1579 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de fglock/PerlOnJava
Issues similaires
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksOuverteteam-cli
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 93/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
inverse-inc/packetfence#9728 ·
Les mainteneurs répondent en général sous 1 jour
-
fix(char-create): show the real reason a character is refusedPeut-être pris @baphomello l’a pris il y a 1 jour. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour