Skip to content

How to signal a parse error from a value callback? #147

Answered by foonathan
Korsar13 asked this question in Q&A
Discussion options

You must be logged in to vote

You can't signal a parse error from a callback because those aren't parse errors - they're semantic errors. You probably want to format into your own diagnostics anyway, so can populate that in there. An example of that can be found here: https://github.com/foonathan/lauf/blob/752b53df4b3f6c9affeb300f35bf9a28271a6849/src/lauf/frontend/text.cpp#L253 Or you just generate an AST and do semantic errors later.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Korsar13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants