소스 검색

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