Browse Source

Also fixed the primitives_visitor for the change in tokens in the grammar

Yentl Van Tendeloo 8 years ago
parent
commit
7933d84d28
1 changed files with 7 additions and 3 deletions
  1. 7 3
      interface/HUTN/hutn_compiler/primitives_visitor.py

+ 7 - 3
interface/HUTN/hutn_compiler/primitives_visitor.py

@@ -164,8 +164,8 @@ class PrimitivesVisitor(Visitor):
         self.visit_literal(tree)
 
     def visit_actionname(self, tree):
-        self.visit_literal(tree.get_tail()[1])
-        self.set_primitive(tree, self.get_primitive(tree.get_tail()[1]))
+        self.visit_literal(tree.get_tail()[0])
+        self.set_primitive(tree, self.get_primitive(tree.get_tail()[0]))
 
     def visit_string(self, tree):
         self.visit_literal(tree)
@@ -178,7 +178,11 @@ class PrimitivesVisitor(Visitor):
         #     self.set_id(tree, n)
         # else:
         c = self.value("constant")
-        n = self.value(tree.get_text())
+        if tree.get_text()[0] == "!":
+            v = tree.get_text()[1:]
+        else:
+            v = tree.get_text()
+        n = self.value(v)
         self.dict(c, "node", n)
         self.debug(c, tree)