Implement an ErrorListener #85
Replies: 1 comment 1 reply
-
@madchicken got the same issue. What did you end up doing? I assume you have the same problem. I want to know after the parse pass that there was an error and stop, not run my visitor. I notice that the DefaultErrorStrategy inserts ErrorNodes into the resulting tree, but I cannot work out how to detect them. If I print them via {:?} the error text shows but I can work out how to ask for the type. I have to say that this is an amazingly hard tool to use (I used antlr a lot before in other languages, easy). Its totally not obvious how to build a non trivial , production ready product with it. Toying with giving up and using pest instead , but I have a working visitor implementation, I just cant et the error handling right |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to implement an ErrorListener for my parser to collect syntax errors, but the function
add_error_listener
takes a boxed instance of my listener, preventing me from reusing it later in my code (to extract what I collected during the parse. phase, for example). Was it done on purpose or the method signature is wrong? Am I missing something here?Beta Was this translation helpful? Give feedback.
All reactions