datalog: tokenizer raises on unterminated block comment (249/249)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s

Bug: `/* unclosed` was silently consumed to EOF, swallowing any
Datalog code that followed inside the (never-closing) comment.
Programs would produce empty parses with no error.

Fix: skip-block-comment! now raises when it hits EOF without
finding `*/`. Error message includes the position where the
problem was first detected. Line comments (`%`) and properly
closed block comments (`/* ... */`) are unaffected.

1 new tokenize test verifies the error path.
This commit is contained in:
2026-05-10 20:59:33 +00:00
parent 2a1d8eeab2
commit 4b5e75dc3e
4 changed files with 19 additions and 7 deletions

View File

@@ -1,10 +1,10 @@
{
"lang": "datalog",
"total_passed": 248,
"total_passed": 249,
"total_failed": 0,
"total": 248,
"total": 249,
"suites": [
{"name":"tokenize","passed":26,"failed":0,"total":26},
{"name":"tokenize","passed":27,"failed":0,"total":27},
{"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:55:23+00:00"
"generated": "2026-05-10T20:59:17+00:00"
}