Skip to content

Conversation

@fglock
Copy link
Owner

@fglock fglock commented Oct 29, 2025

No description provided.

When 'use feature "bitwise"' is enabled, the parser renames bitwise
operators to binary& binary| binary^ to distinguish numeric bitwise ops
from string bitwise ops (&. |. ^.). These renamed operators were already
registered in OperatorHandler and have implementations in BitwiseOperators,
but they were missing from the EmitBinaryOperatorNode case statement.

This fixes the compilation error 'Not implemented operator: binary&' when
using bitwise operators with the bitwise feature enabled.

Progress on t/op/bop.t: Now runs 215 tests (was failing at parse/compile time)
The backslash operator (\) was evaluating all non-\& operands in LIST
context, which caused issues when creating references to constant subs
or other expressions that return scalars.

For example, \PVBM where PVBM is a constant sub would evaluate PVBM()
in LIST context, returning a RuntimeList, then call createReference() on
it which throws 'create reference of list not implemented'.

This fix changes the backslash operator to evaluate most operands in
SCALAR context (the natural context for creating a reference to a value).
LIST context is only used for actual list-producing operations like @ and %
variables, or explicit ListNodes.

This fixes the remaining failures in t/op/bop.t related to references.

Progress on t/op/bop.t: Now passes 313 out of 522 tests (59%)
@fglock fglock merged commit cd504ef into master Oct 29, 2025
2 checks passed
@fglock fglock deleted the fix-bop-test branch October 29, 2025 10:25
fglock added a commit that referenced this pull request Oct 29, 2025
This reverts commit cd504ef, reversing
changes made to 89e92dd.
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.

2 participants