ruby: slicc: allow adding a bool to an int, like C++.
authorNilay Vaish <nilay@cs.wisc.edu>
Thu, 6 Nov 2014 11:42:20 +0000 (05:42 -0600)
committerNilay Vaish <nilay@cs.wisc.edu>
Thu, 6 Nov 2014 11:42:20 +0000 (05:42 -0600)
src/mem/slicc/ast/OperatorExprAST.py

index df074b9f07792e97907af77b45c558d9ad54696e..f449a358a6b525cb8c160c781df1c0099e4a54f4 100644 (file)
@@ -69,6 +69,8 @@ class InfixOperatorExprAST(ExprAST):
                                   ("Cycles", "Cycles", "Cycles"),
                                   ("Cycles", "int", "Cycles"),
                                   ("Scalar", "int", "Scalar"),
+                                  ("int", "bool", "int"),
+                                  ("bool", "int", "int"),
                                   ("int", "Cycles", "Cycles")]
             else:
                 self.error("No operator matched with {0}!" .format(self.op))