From f814d91f9dc0d9989a9ef413cca0f2622427eb74 Mon Sep 17 00:00:00 2001 From: Erez Shinan Date: Tue, 11 Jun 2019 11:09:16 +0300 Subject: [PATCH] Removed possibly problematic code (Issue #372) --- lark/load_grammar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lark/load_grammar.py b/lark/load_grammar.py index 281dc5b..8bda118 100644 --- a/lark/load_grammar.py +++ b/lark/load_grammar.py @@ -520,7 +520,7 @@ class Grammar: if alias and name.startswith('_'): raise GrammarError("Rule %s is marked for expansion (it starts with an underscore) and isn't allowed to have aliases (alias=%s)" % (name, alias)) - empty_indices = [x==_EMPTY for i, x in enumerate(expansion)] + empty_indices = [x==_EMPTY for x in expansion] if any(empty_indices): exp_options = copy(options) if options else RuleOptions() exp_options.empty_indices = empty_indices