Browse Source

slight improvement for alias of templates

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

+ 1
- 2
lark/parse_tree_builder.py View File

@@ -227,10 +227,9 @@ class ParseTreeBuilder:
options = rule.options
keep_all_tokens = self.always_keep_all_tokens or options.keep_all_tokens
expand_single_child = options.expand1
from_template = options.template_source is not None

wrapper_chain = list(filter(None, [
(expand_single_child and not (rule.alias and not from_template)) and ExpandSingleChild,
(expand_single_child and not rule.alias) and ExpandSingleChild,
maybe_create_child_filter(rule.expansion, keep_all_tokens, self.ambiguous, options.empty_indices if self.maybe_placeholders else None),
self.propagate_positions and PropagatePositions,
self.ambiguous and maybe_create_ambiguous_expander(self.tree_class, rule.expansion, keep_all_tokens),


Loading…
Cancel
Save