fix: FindBin::libs — jar lib decoding, Symbol::qualify_to_ref, ref-to-glob context#727
Merged
Conversation
…-glob context
- Load jar:PERL5LIB modules via raw bytes and FileUtils.decodePerlSourceBytes after
CompilerOptions exists (matches filesystem BOM/CRLF handling).
- Native Symbol::qualify_to_ref: qualify one-arg via caller()+two-arg qualify; return
GlobalVariable.getGlobalIO-backed globs instead of orphan RuntimeGlob refs.
- EmitOperator: evaluate \*{...} operand in scalar context (comma/ternary inside braces).
- Parser: *{EXPR} as code; unary prototype indirect suppression; * { brace whitespace.
- Test::More: use_ok string-eval visibility for \@imports under PerlOnJava.
- Add unit test symbol_star_brace_qualify_to_ref.t.
Verified: make; timeout 600 ./jcpan -t FindBin::libs.
Generated with [Cursor](https://cursor.com/docs)
Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PR727 parsed every *{...} as ParseBlock, so *{P2::ISA} became a useless statement and
strict subs rejected the bareword (mro/basic.t, basic_utf8.t showed 0/0 in harness logs).
Try IdentifierParser for a single qualified name through `}`; otherwise ParseBlock for
Symbol::qualify_to_ref-style expressions.
Generated with [Cursor](https://cursor.com/docs)
Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
5aac10a to
c9511f8
Compare
…around)
eval STRING already snapshots outer lexicals (EmitEval + EvalStringHandler /
RuntimeCode.evalStringHelper BEGIN-alias path), so \@{$args[0]} inside use_ok's
generated eval sees @_eval's @Args like perl(1). The package-array shim was
unnecessary.
Add unit/eval_string_lexical_args_use.t covering the @{$args[0]} pattern.
Generated with [Cursor](https://cursor.com/docs)
Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- qx/Heredoc-qx: disable ${\"…\"} braced preprocessing except in qq strings so
`${\"hello"}` stays ref-to-string inside backticks; thread flag through
ParseHeredoc/StringParser/StringDoubleQuoted and Parser state.
- Runtime readpipe overrides: dispatch via InterpreterState package + RuntimeArray
args to the package CV; empty exec() returns false and sets ENOENT (no throw).
- Prototype parsing: qw-merge lookahead only for consecutive `$` slots so `$_`
builtins like unpack no longer mis-parse as syntax errors.
- Builtin arity messages: pass builtin names into parseZeroOrOneList for defined,
undef, and unary builtins; empty pack reports Not enough arguments for pack.
Verified: perl5_t/t/op/exec.t (41/41), perl5_t/t/comp/bproto.t (16/16), make.
Generated with [Cursor](https://cursor.com/docs)
Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…s `sub new` `subExists && prototypeStartsWithScalarSlot` skipped the indirect-object probe; inside a package that defines `new ($...)`, `new Parse::RecDescent::Directive(...)` was parsed as a direct call to the enclosing `new`, breaking Parse::RecDescent / DBIx::Class). Always run the probe when the method bareword is `new`. Verified: require Parse::RecDescent from ~/.perlonjava/lib; make. Generated with [Cursor](https://cursor.com/docs) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
The scalar-leading-prototype heuristic skipped the indirect-object probe entirely, which mis-parsed `method Some::Long::Class LIST` as a direct call to an enclosing sub when that sub had a `$`-leading prototype (e.g. Parse::RecDescent). Perl does not single out `new`; always attempt the probe and rely on existing rejection/backtracking for ambiguous cases. Verified: make; `require Parse::RecDescent` under jperl. Generated with [Cursor](https://cursor.com/docs) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
./jcpan -t FindBin::libsand tightens related compilation/runtime behavior.Changes
PERL5LIBloads: Read raw bytes from the jar resource and decode withFileUtils.decodePerlSourceBytesonceCompilerOptionsexists (same BOM/CRLF path as filesystem reads).Symbol:qualify_to_refbuilds a two-argqualifyusingRuntimeCode.callerat entry (matches Perl’s embeddedqualify+caller); glob refs useGlobalVariable.getGlobalIOinstead of orphanRuntimeGlobinstances.\*{ … }: Emit reference-to-glob with scalar context for the*{…}operand (EmitOperator).*{EXPR}parsesEXPRas code; misc prototype/indirect-object and* {whitespace fixes (Variable,SubroutineParser, etc.).Test::More:use_okstring-eval import list workaround for PerlOnJava.symbol_star_brace_qualify_to_ref.t.Verification
maketimeout 600 ./jcpan -t FindBin::libs— PASS