scryer-prolog icon indicating copy to clipboard operation
scryer-prolog copied to clipboard

More Helpful Error Messages - Added to Roadmap

Open dougransom opened this issue 1 year ago • 3 comments

Some discussion at https://github.com/mthom/scryer-prolog/discussions/2253.

I would like error messages suitable for a beginner, to more easily identify errors. It is pretty easy to get confused coming from another language and accidentally using # for a comment line or - or -> or : instead of :-. Not sure what would help.

There are may be runtime cases as well where more context could be provided (file/line # of a problematic predicate etc.)

dougransom avatar Jan 10 '24 13:01 dougransom

When loading a file, I'd especially like to see the offending text printed out, maybe even which character.

Right now, the message is terse. It took me a while to even realize that :9 is the offending line number in the below error (it's not even the line where I omitted a comma; just the line containing the . ending the term).

> scryer-prolog error.pl
   error(syntax_error(incomplete_reduction),read_term/3:9).
?-

rotu avatar May 19 '25 19:05 rotu

#302 would help to begin with.

UWN avatar May 20 '25 03:05 UWN

Indeed this is a reoccurring feature request: #2599, similarly I've started to add more warnings (#2602) to notify the user about possible issues with their code, but I don't have time and stamina to finish it.

hurufu avatar May 20 '25 09:05 hurufu