Skip to content

fix: parse dense Mo::Inline double-colon barewords - #1285

Merged
fglock merged 5 commits into
masterfrom
fix/issue-1217-testml-base
Sep 7, 2026
Merged

fix: parse dense Mo::Inline double-colon barewords#1285
fglock merged 5 commits into
masterfrom
fix/issue-1217-testml-base

Conversation

@fglock

@fglock fglock commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #1217.

TestML::Base 0.54 uses dense Mo::Inline-generated code containing :: as a
bareword between concatenation operators inside a braced hash dereference.
The parser treated this as an invalid leading package-qualified name and
reported a missing closing brace. Parse :: as the bareword string in this
context.

Validation

  • System Perl regression test
  • JVM backend regression test
  • Interpreter backend regression test
  • TestML::Base 0.54 module load on both backends
  • Full make gate after rebase: passed

fglock and others added 2 commits September 7, 2026 18:08
Treat `::` as a bareword string when it appears before concatenation,
allowing dense Mo::Inline-generated hash dereferences such as TestML::Base
to compile on both execution backends.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <noreply@openai.com>
Snapshot the user-supplied Perl core library and test-suite synchronization
before continuing issue #1217 investigation.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <noreply@openai.com>
@fglock

fglock commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

UAT follow-up

The synced Perl core tests reproduce the reported results:

The synchronized bundled Perl library updates have also been added in commit
a8b5f6ff7.

Implement Perl's equ, neu, ===, and !== operators across the parser, JVM
backend, bytecode backend, chaining logic, and overload dispatch. Add focused
regression coverage for defined and undefined operands.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
@fglock

fglock commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

Follow-up validation and fix for the synced UAT regressions:

  • Implemented Perl 5.44 defined comparison operators equ, neu, ===, and !== across parsing, JVM emission, bytecode interpretation, comparison chaining, and overload dispatch.
  • Added focused regression coverage in src/test/resources/unit/defined_comparison_operators.t.
  • Full make passes.
  • Synced UAT op/equ.t: 87/87 on both JVM and interpreter backends.
  • Synced UAT op/tie_fetch_count.t: 347/347 on both JVM and interpreter backends.

The changes are in commit f69f48657.

Compile nested comparison ASTs as left-to-right short-circuit chains in the
bytecode backend, matching JVM behavior and evaluating each operand once.
Extend the defined-comparison regression test with mixed chains and a
short-circuit side-effect check.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
@fglock

fglock commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

Additional fix for the remaining interpreter parity gap:

  • The bytecode compiler now executes nested comparison ASTs as true Perl chains: left-to-right, each operand once, with short-circuiting after the first false comparison.
  • The permanent regression test now covers equ chains, mixed ===/== chains, and side-effect-based short-circuit behavior.
  • Full make passes; the focused regression passes on both JVM and --interpreter.

Latest commit: 098b8eb79.

Fetch tied operands once before equ, neu, ===, and !== check definedness and
perform the comparison on the fetched values. This preserves Perl's fetch
count semantics for the new operators.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
@fglock

fglock commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

Fixed the latest UAT regression in commit 707b43459.

The new defined-comparison operators were checking tied operands for definedness and then comparing the original tied wrapper, causing a second FETCH. They now FETCH once and compare the fetched value.

Validation:

  • op/tie_fetch_count.t: the four reported cases (===, !==, equ, neu) now pass on JVM and --interpreter.
  • Full make: passed.
  • The remaining 128 failures are unchanged pre-existing baseline failures; the UAT delta is resolved.

@fglock
fglock merged commit 352bb39 into master Sep 7, 2026
2 checks passed
@fglock
fglock deleted the fix/issue-1217-testml-base branch September 7, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestML::Base fails to compile due to dense Mo::Inline syntax

1 participant