Accept escaped literals in Unicode transliteration replacement lists
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 67/100
Research direction
Start in the transliteration parsing and compilation code, focusing on bracket-delimited replacement operands and escaped metacharacters. Run the supplied Perl reproducer on both the JVM and interpreter backends, then run the Lingua::JA::Numbers test files under t/ to verify that escaped hyphen and asterisk literals compile and the upstream suite passes.
Written by the indexing model from the issue text.
Description
Summary
PerlOnJava rejects valid transliteration syntax used by Lingua::JA::Numbers 0.05. The transliteration parser incorrectly interprets escaped replacement characters as an invalid +-* range.
Reproduction
The failure was found in CPAN random run 20260921-124328-13959, with regression baseline 0f5febaa8, while testing Lingua::JA::Numbers 0.05.
The smallest reproducer is:
my $x = '';
$x =~ tr[()+−×÷][\(\)\+\-\*\/];
The distribution contains the equivalent operation in Lingua::JA::Numbers::ja2num, converting full-width Japanese punctuation and arithmetic symbols to ASCII punctuation.
Under PerlOnJava, both the JVM backend and interpreter backend fail with:
Invalid range "+-*" in transliteration operator
Under standard Perl 5.42.2, the same reproducer succeeds.
CPAN evidence
The standard-Perl oracle passes the complete upstream suite:
All tests successful.
Files=6, Tests=289
Result: PASS
PerlOnJava fails all six test programs because the module cannot be compiled:
t/00-Use.t failed during use
t/01-RoundTrip.t compilation failed
t/02-Manman.t compilation failed
t/03-OO.t compilation failed
t/04-LJN.t compilation failed during import
t/05-KANJI.t compilation failed
Files=6, Tests=4
Failed 6/6 test programs
The later to_string and import failures in t/04-LJN.t are cascading errors after the module failed to load; they are not separate defects.
Expected behavior
PerlOnJava should accept the transliteration operator with bracket delimiters and escaped replacement characters exactly as standard Perl does. The hyphen and asterisk in the replacement list are escaped literal characters, not a character range.
Suspected area
The defect is in transliteration parsing/compilation, specifically handling escaped metacharacters in the replacement operand when the operator uses bracket delimiters and Unicode source text. The parser should preserve \- and \* as literals instead of constructing an invalid +-* range.
Environment and scope
- Distribution:
Lingua::JA::Numbers0.05 - PerlOnJava backends: JVM and interpreter
- Standard Perl oracle: Perl 5.42.2 on macOS
- Native/XS code: none
- Reverse-dependency analysis: not applicable; this is a pure-Perl distribution
This is a reproducible PerlOnJava parser defect, not a timeout, missing dependency, native-library problem, or platform prerequisite.
- Dominant language
- Perl
- Stars
- 64
- Forks
- 6
- Avg merge
- 5h 18m
- Merged PRs (30d)
- 162
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:cpan-port area:parser area:runtime bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
fglock/PerlOnJava#1477 ·
-
area:backend area:cpan-port area:runtime bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
fglock/PerlOnJava#1475 ·
-
area:parser area:warnings bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
fglock/PerlOnJava#1473 ·
-
area:backend area:cpan-port area:runtime bug
Difficulty 4/5 3-5 days Newbie friendliness 68/100
fglock/PerlOnJava#1471 ·
All issues in fglock/PerlOnJava
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
corazawaf/coraza-nginx#140 ·
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api7/lua-resty-saml#63 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100