● Issue #30 is fixed. #34
No reviewers
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!34
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-30"
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?
#30
Summary:
(line 161) and parse_query_with_vars (line 715). When tokens remain, build the same unexpected {kind} after
query at line {N} col {M} message used elsewhere. "after query" phrasing distinguishes this from mid-expression
parse errors so the user knows the goal parsed, but had extra material trailing it.
trailing-after-dot, both query entry points, plus three positive regressions (bare query, dot, ?- prefix).
Verified through the binary:
after query at line 1 col 19, exit 2.No code-side change needed in the runner — the new error surfaces through runner.rs's existing Parse error:
formatting and exit 2.
Summary: - crates/patch-prolog-core/src/parser.rs: added an EOF check after the optional trailing dot in both parse_query (line 161) and parse_query_with_vars (line 715). When tokens remain, build the same unexpected {kind} after query at line {N} col {M} message used elsewhere. "after query" phrasing distinguishes this from mid-expression parse errors so the user knows the goal parsed, but had extra material trailing it. - 8 regression tests in tests/integration.rs (test_query_*) covering: trailing atom, trailing punctuation, trailing-after-dot, both query entry points, plus three positive regressions (bare query, dot, ?- prefix). Verified through the binary: - member(2,[1,2,3]) zzz → Parse error: unexpected atom \zzz` after query at line 1 col 19`, exit 2. - X is 8 >> 1, X =:= 4 now returns X = 4 (the right answer — >> was added in #29). - X is 1 + 2. still works (optional dot preserved). - X is 1 + 2. foo now caught (unexpected atom \foo``, exit 2). No code-side change needed in the runner — the new error surfaces through runner.rs's existing Parse error: <msg> formatting and exit 2.