Re:Owl: Parser generator for visibly pushdown languages
by jhpriestley on Wednesday November 07, 2018 @02:26PM
(#18401539)
What context or data would constitute a helpful error message in your opinion? Do you have an example of a recursive-descent parser that generates particularly good error messages?
[ Parent
| on HN ]
Re:Owl: Parser generator for visibly pushdown languages
by chrisseaton on Wednesday November 07, 2018 @02:32PM
(#18401597)
A great example is if you forget to put 'end' at the end of a function at the end of a file in languages that have that.
Your idea of a good parser error message is being told that the end of file was unexpected and being given a list of a hundred possible tokens that could start another statement, including 'end' buried somewhere in the list, because that's what's valid there.
My idea of a good parser error message would be in a recursive descent parser looking for the 'end' token, not seeing it, seeing that it's end of file instead and saying 'missing 'end' or a new statement at end of file'.
Re:Owl: Parser generator for visibly pushdown languages
by nicoburns on Wednesday November 07, 2018 @08:38PM
(#18403781)
See elm and rust for examples of compilers with good error messages.
Re:Owl: Parser generator for visibly pushdown languages
by grandmczeb on Wednesday November 07, 2018 @09:16PM
(#18403917)
Or clang.