Parcourir la source

Filter all tokens dynamically instead of a predefined list.

Sander Mathijs van Veen il y a 14 ans
Parent
commit
ff77c565f8
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1 1
      external/pybison
  2. 1 1
      src/parser.py

+ 1 - 1
external/pybison

@@ -1 +1 @@
-Subproject commit 4fac41ac1cd069d5ad889efccc00428d24583a5d
+Subproject commit 2b1f8fd1b1055dc9f0e24fea7eae7be45c041882

+ 1 - 1
src/parser.py

@@ -154,7 +154,7 @@ class Parser(BisonParser):
             left, right = filter(None, match.groups())
 
             # Filter words (otherwise they will be preprocessed as well)
-            if left + right in ['graph', 'raise']:
+            if (left + right).upper() in self.tokens:
                 return left + right
 
             # If all characters on the right are numbers. e.g. "a4", the