Sfoglia il codice sorgente

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

Taddeus Kroes 14 anni fa
parent
commit
7fbc6d246b
1 ha cambiato i file con 9 aggiunte e 2 eliminazioni
  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: