Open mgood7123 opened 5 years ago
Can you give an example?
I know this is a 2+ year old issue but I think I ran into the same problem. What I realized is that my top-level rule didn't have any start/end terminators, so the parser would just silently exit on any unrecognized input instead of failing with an error.
Notice the example language definition ends this way:
mpca_lang(MPCA_LANG_DEFAULT,
" expression : <product> (('+' | '-') <product>)*; "
" product : <value> (('*' | '/') <value>)*; "
" value : /[0-9]+/ | '(' <expression> ')'; "
" maths : /^/ <expression> /$/; ", // note start /^/ and end /$/ terminators
Expr, Prod, Value, Maths, NULL);
But my last rule looked like this, without the terminators:
" maths : <expression> ; ",
Once I put those in, the parser would properly error out on any unrecognized or invalid input.
Hope this helps!
when the parser successfully parses a rule then errors parsing another rule due to it not being able to match any rules it should raise an error but it doesnt
for example
passedrule
gets passed thenfailedrule
gets silently skipped and halts the parsing but suceeds, and the ast tree only shows the ast forpassedrule
failedrule
gets raised and error is reported since no rules previously match