Browse Source

Disable 'unless' mechanism if priority is different, not just lower (Issue #920)

remotes/origin/gm/2021-09-23T00Z/github.com--lark-parser-lark/master
Erez Sh 3 years ago
parent
commit
96f7878104
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lark/lexer.py

+ 1
- 1
lark/lexer.py View File

@@ -248,7 +248,7 @@ def _create_unless(terminals, g_regex_flags, re_, use_bytes):
for retok in tokens_by_type.get(PatternRE, []):
unless = []
for strtok in tokens_by_type.get(PatternStr, []):
if strtok.priority > retok.priority:
if strtok.priority != retok.priority:
continue
s = strtok.pattern.value
if s == _get_match(re_, retok.pattern.to_regexp(), s, g_regex_flags):


Loading…
Cancel
Save