Parse errors report internal token names (Plus, Star, Lt) instead of surface syntax #20
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#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
Parse errors name the engine's internal token variants (
Plus,Star,Lt,Mod,Equals,Comma…) rather than the surface syntax the user actually typed.Repro
A user has no way to know
Plusmeans+,Starmeans*, orLtmeans<.Suggested fix
Map each token back to its surface lexeme in the message, e.g.:
A
Displayimpl on the token type that yields the lexeme (+,*,<,mod,,,=) would cover it. Pairs naturally with the line-offset fix (#18) — together they make parse errors actionable for beginners.Impact
Lower severity than the line-number offset, but it's an easy win that directly improves the error experience for the learner-facing tooling (loglings) that surfaces these messages verbatim.
Found while building the
loglingsProlog exercises against the installed engine.mod,],.,)— instead of Mod, RBracket, Dot, RParen. #25#25