Files
rose-ash/lib/datalog/parser.sx
giles 2a1d8eeab2
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
datalog: parser accepts negative integer literals (248/248)
Bug: `n(-1).` failed to parse — the tokenizer produced op `-`
followed by number `1`, and dl-pp-parse-arg expected a term after
seeing `-` as an op (and a `(` for a compound) but found a bare
number. Users had to write `(- 0 1)` or compute via `is`.

Fix: dl-pp-parse-arg detects op `-` directly followed by a number
token (no intervening `(`) and consumes both as a single negative
number literal. Subtraction (`is(Y, -(X, 2))`) and compound
arithmetic via the operator form are unaffected — they use the
`-(` lookahead path.

2 new parser tests: negative integer literal and subtraction
compound preserved.
2026-05-10 20:55:42 +00:00

6.9 KiB