浏览代码

Clear list of last possibilities when current expression has no possibilities.

Sander Mathijs van Veen 14 年之前
父节点
当前提交
16a11f0f1b
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/parser.py

+ 7 - 0
src/parser.py

@@ -285,6 +285,13 @@ class Parser(BisonParser):
         """
         if option == 1:  # rule: EXP NEWLINE
             self.root_node = values[0]
+
+            # Clear list of last possibilities when current expression has no
+            # possibilities. Otherwise, an invalid expression gets the last
+            # possibilities of a valid expression.
+            if not self.possibilities:
+                self.last_possibilities = []
+
             return values[0]
 
         if option == 2:  # rule: DEBUG NEWLINE