diff --git a/lark/load_grammar.py b/lark/load_grammar.py
index <HASH>..<HASH> 100644
--- a/lark/load_grammar.py
+++ b/lark/load_grammar.py
@@ -511,12 +511,12 @@ class Grammar:
 
         simplify_rule = SimplifyRule_Visitor()
         compiled_rules = []
-        for i, rule_content in enumerate(rules):
+        for rule_content in rules:
             name, tree, options = rule_content
             simplify_rule.visit(tree)
             expansions = rule_tree_to_text.transform(tree)
 
-            for expansion, alias in expansions:
+            for i, (expansion, alias) in enumerate(expansions):
                 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))
Fix Earley non-determinism

Rule.order should be set as the index of each expansion with rules
of the same name (e.g: a : b    # rule.order 1 | c    # rule.order 2).