mirror of https://github.com/lark-parser/lark.git
Tweak the Earley ambiguity algorithm to correctly prefer earlier branches
This commit is contained in:
parent
dc94ebc42f
commit
dc3c009dca
|
@ -122,7 +122,7 @@ class PackedNode(ForestNode):
|
|||
ambiguously. Hence, we use the sort order to identify
|
||||
the order in which ambiguous children should be considered.
|
||||
"""
|
||||
return self.is_empty, -self.priority, -self.rule.order
|
||||
return self.is_empty, -self.priority, self.rule.order
|
||||
|
||||
def __iter__(self):
|
||||
return iter([self.left, self.right])
|
||||
|
|
Loading…
Reference in New Issue