mirror of https://github.com/lark-parser/lark.git
Fix issue with propagate_positions
This commit is contained in:
parent
74fc559ea5
commit
0935543280
|
@ -28,7 +28,7 @@ class PropagatePositions:
|
|||
def __call__(self, children):
|
||||
res = self.node_builder(children)
|
||||
|
||||
if isinstance(res, Tree):
|
||||
if isinstance(res, Tree) and getattr(res.meta, 'empty', True):
|
||||
res.meta.empty = True
|
||||
|
||||
for c in children:
|
||||
|
@ -144,9 +144,9 @@ class ParseTreeBuilder:
|
|||
expand_single_child = options.expand1 if options else False
|
||||
|
||||
wrapper_chain = filter(None, [
|
||||
self.propagate_positions and PropagatePositions,
|
||||
(expand_single_child and not rule.alias) and ExpandSingleChild,
|
||||
maybe_create_child_filter(rule.expansion, keep_all_tokens),
|
||||
self.propagate_positions and PropagatePositions,
|
||||
self.ambiguous and maybe_create_ambiguous_expander(self.tree_class, rule.expansion, keep_all_tokens),
|
||||
])
|
||||
|
||||
|
|
Loading…
Reference in New Issue