Browse Source

Fix assert on empty options for a Rule

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.6
night199uk 6 years ago
parent
commit
a543eeb162
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      lark/load_grammar.py

+ 1
- 2
lark/load_grammar.py View File

@@ -510,8 +510,7 @@ class Grammar:

empty_indices = [x==_EMPTY for i, x in enumerate(expansion)]
if any(empty_indices):
assert options
exp_options = copy(options)
exp_options = copy(options) or RuleOptions()
exp_options.empty_indices = empty_indices
expansion = [x for x in expansion if x!=_EMPTY]
else:


Loading…
Cancel
Save