datalog: parser accepts negative integer literals (248/248)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
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.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# datalog scoreboard
|
||||
|
||||
**246 / 246 passing** (0 failure(s)).
|
||||
**248 / 248 passing** (0 failure(s)).
|
||||
|
||||
| Suite | Passed | Total | Status |
|
||||
|-------|--------|-------|--------|
|
||||
| tokenize | 26 | 26 | ok |
|
||||
| parse | 20 | 20 | ok |
|
||||
| parse | 22 | 22 | ok |
|
||||
| unify | 28 | 28 | ok |
|
||||
| eval | 36 | 36 | ok |
|
||||
| builtins | 23 | 23 | ok |
|
||||
|
||||
Reference in New Issue
Block a user