● Every operator works correctly. Issue #29 is implemented. #33
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-prolog!33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-29"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#29
Summary:
Tokenizer (crates/patch-prolog-core/src/tokenizer.rs) — 9 new TokenKind variants with Display arms (lexemes
backticked per #20):
start with > followed by different bytes).
not **, >= not >>, // not /, :- not :).
Parser (parser.rs):
associativities at the same precedence level — ** (xfx, no chaining), ^ and : (xfy, right-associative via
self-recursion on RHS).
parse_expr_200.
bare atoms when in closing context.
Arithmetic evaluator (builtins.rs):
float operand) falls through to powf.
evaluation_error(undefined).
non-zero and has the opposite sign of the divisor. Disagrees with // (truncating) when signs differ; agrees on
the positive case.
Integration tests — 21 new tests in tests/integration.rs covering each operator's value, the right-associativity
of ^ and :, the precedence relationships (** < *, << < +, /\ left-to-right with +), atom-in-closing-context for
the new tokens, and the two error paths (negative shift, div 0). Plus regression coverage that 1 + 2 and the
existing + * / // mod rem family still work.
Out of scope per the issue body: declaration-class prefixes (dynamic/multifile/...), DCG, comparison-aliases
beyond what already exists. The "full prefix + infix" doc the issue mentioned can now be written accurately.