Add error callbacks to CTBuilders.#426
Conversation
|
Edit: Going back to the drawing board regarding the rest of this comment, because of implementation complexity and compatibility. So, looking forward to other things I am inclined to try implementing 2 changes to this basic API, despite the fact that I like how simple it is, these changes described are in-order (so building upon one another).
So it would look something to the effect of the following (which probably doesn't compile): Here is a playground link, with the basic idea after some renaming The purpose of this is to open the door for a separate call from The motivation for this extra parameter and new I think from a |
|
Reminder to self, I probably should consider passing in the lex/yacc source string to their various callbacks. |
|
I put up an alternative trait-ized implementation in #428, which is perhaps worth looking at instead? |
|
It seems to me like this one can be closed for now, that we're at least going to try and go for the trait based impl instead. |
Here is an initial draft of the patch I was thinking in #425
I still need to add tests, and an example with pretty errors.
But in case @DavidHVernon wanted to test it out, and see if it helps solve his problem in a cleaner fashion, I wanted to get it out as a draft.
Edit: This is still not catch a few things,
"Missing from lexer", "Missing from parser", aren't grammar errors, or lexer errors, but some kind of error relation between the two.
It also doesn't get called for warnings.