Explorar el Código

Application in parser now also applies implicit rules that are not hints after applying an explicit rule.

Taddeus Kroes hace 14 años
padre
commit
7fbc6d246b
Se han modificado 1 ficheros con 9 adiciones y 2 borrados
  1. 9 2
      src/parser.py

+ 9 - 2
src/parser.py

@@ -292,9 +292,16 @@ class Parser(BisonParser):
             self.find_possibilities()
 
             while self.possibilities:
-                sugg = self.possibilities[0]
+                # Find the first implicit possibliity in the list
+                # FIXME: Is it smart to apply a rule that is not a hint?
+                sugg = None
 
-                if sugg.handler not in IMPLICIT_RULES:
+                for pos in self.possibilities:
+                    if pos.handler in IMPLICIT_RULES:
+                        sugg = pos
+                        break
+
+                if not sugg:
                     break
 
                 if self.verbose: