datalog: tokenizer raises on unterminated string + quoted atom (251/251)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 35s

Bug: read-quoted ran to EOF silently when the closing quote was
missing. The token's value was whatever ran-to-end string had been
accumulated; the parser later saw an unexpected EOF, but the error
message blamed the wrong location ("expected `)` got eof") and
hid the real problem.

Fix: read-quoted now raises with a message that distinguishes
strings from quoted atoms, including the position where the
opening quote was lost. The escape-sequence handling and proper
closing are unaffected.

2 new tokenize tests.
This commit is contained in:
2026-05-10 21:05:28 +00:00
parent 4b5e75dc3e
commit 5bcda5c88c
4 changed files with 30 additions and 7 deletions

View File

@@ -1,10 +1,10 @@
{
"lang": "datalog",
"total_passed": 249,
"total_passed": 251,
"total_failed": 0,
"total": 249,
"total": 251,
"suites": [
{"name":"tokenize","passed":27,"failed":0,"total":27},
{"name":"tokenize","passed":29,"failed":0,"total":29},
{"name":"parse","passed":22,"failed":0,"total":22},
{"name":"unify","passed":28,"failed":0,"total":28},
{"name":"eval","passed":36,"failed":0,"total":36},
@@ -16,5 +16,5 @@
{"name":"magic","passed":34,"failed":0,"total":34},
{"name":"demo","passed":21,"failed":0,"total":21}
],
"generated": "2026-05-10T20:59:17+00:00"
"generated": "2026-05-10T21:05:12+00:00"
}