Browse Source

Improved `match_examples` with `UnexpectedToken.accepts`

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.10.0
MegaIng1 4 years ago
parent
commit
d3b0449f71
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lark/exceptions.py

+ 1
- 1
lark/exceptions.py View File

@@ -55,7 +55,7 @@ class UnexpectedInput(LarkError):
try: try:
parse_fn(malformed) parse_fn(malformed)
except UnexpectedInput as ut: except UnexpectedInput as ut:
if ut.state == self.state:
if ut.state == self.state and ut.accepts == self.accepts:
try: try:
if ut.token == self.token: # Try exact match first if ut.token == self.token: # Try exact match first
if print_debug_info: if print_debug_info:


Loading…
Cancel
Save