-
|
Beta Was this translation helpful? Give feedback.
Answered by
foonathan
Jun 18, 2023
Replies: 1 comment
-
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. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Korsar13
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.