You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing an error reporting method with the help of match_examples(), but it seems that I would have to define a lot of error examples that are nearly the same. Here is a unit test with a minimal grammar:
The test_no_preceding_text test works as it should, but in the test_preceding_text test the match_examples call returns None. It seems that the parser creates different states for these inputs:
document -> paragraph -> environment_command -> list
document -> environment_command -> list
I could another error example for this additional case, but that is not really feasible for my (full) grammar as there are a lot of different ways a rule can be reached.
My question is: Is there a simpler way to implement the error reporting? For me, I only want to catch errors for a specific rule in isolation and it is not really important for me which rules were previously used to reach this rule
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am implementing an error reporting method with the help of
match_examples()
, but it seems that I would have to define a lot of error examples that are nearly the same. Here is a unit test with a minimal grammar:The
test_no_preceding_text
test works as it should, but in thetest_preceding_text
test thematch_examples
call returnsNone
. It seems that the parser creates different states for these inputs:I could another error example for this additional case, but that is not really feasible for my (full) grammar as there are a lot of different ways a rule can be reached.
My question is: Is there a simpler way to implement the error reporting? For me, I only want to catch errors for a specific rule in isolation and it is not really important for me which rules were previously used to reach this rule
Beta Was this translation helpful? Give feedback.
All reactions