Parser: add missing prefix operators (+ and \) to complete the prefix table #28
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#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
The prefix-operator table is incomplete.
-(fy 200) and\+(fy 900) readas prefix operators, but the other standard symbolic prefix operators do not:
Standard prefix operators missing
+(fy, 200) — unary plus\(fy, 200) — bitwise complement(The ISO declaration-class prefixes —
dynamic,discontiguous,initialization,multifile, … at fx 1150 — are a separate, lower-priorityconcern; this issue is about the arithmetic/symbolic prefixes.)
Notes for implementation
parse_primary(crates/patch-prolog-core/src/parser.rs).\is not tokenized as a standalone token today (it only appears inside\+,\=,\==,=\=), so unary\needs a tokenizer change as well.-3already folds to a negativenumber rather than the compound
-(3).+ 3should evaluate to3; keepthe folding behavior consistent and documented.
Context
Found while building the
loglingsoperator lessons (prefix-vs-infix notation).Related: the infix table is also incomplete (
** ^ >> << xor div :) — trackedseparately.
Reported against
prlg0.4.1.#32