● Every repro from the issue now passes. Issue #28 is fixed. #32
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!32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-28"
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?
#28
Summary:
\. Replaced thebare-\ error path with a fallthrough that emits Backslash (longest match still wins for =, ==, +). Unit tests
verify \ alone and \ 3 tokenize correctly.
3.0).
is-time.
the +/- handling from #19). Plus was already covered.
test_existing_escapes_still_tokenize) covering positive parse, literal folding for +, no folding for , the
closing-context atom rule, mixed-prefix chains (- - 3, + - 3), and regressions for the three escape sequences
(=, ==, +) plus infix +.
Out of scope as the issue body said: declaration-class prefixes (dynamic/multifile/etc.), the infix gaps (** ^
Summary: - crates/patch-prolog-core/src/tokenizer.rs: added TokenKind::Backslash with Display arm `\`. Replaced the bare-\ error path with a fallthrough that emits Backslash (longest match still wins for \=, \==, \+). Unit tests verify \ alone and \ 3 tokenize correctly. - crates/patch-prolog-core/src/parser.rs: - Added Plus prefix arm in parse_primary — mirrors the unary - block including literal folding (+3 → 3, +3.0 → 3.0). - Added Backslash prefix arm — wraps operand as \(operand). No folding; the arithmetic evaluator handles \N at is-time. - Extended operator_as_atom_lookahead with Backslash → "\\" so f(\) reads as the bare atom (consistent with the +/- handling from #19). Plus was already covered. - 10 regression tests in tests/integration.rs (test_prefix_*, test_backslash_*, test_existing_escapes_still_tokenize) covering positive parse, literal folding for +, no folding for \, the closing-context atom rule, mixed-prefix chains (- - 3, + - 3), and regressions for the three escape sequences (\=, \==, \+) plus infix +. Out of scope as the issue body said: declaration-class prefixes (dynamic/multifile/etc.), the infix gaps (** ^ >> << xor div :), and arithmetic evaluation of \X.