Allow mismatched units in expressions

This commit is contained in:
robotis
2012-06-25 08:18:49 +00:00
parent 5772da32ac
commit ae8536d2b9
2 changed files with 5 additions and 5 deletions

View File

@@ -83,7 +83,11 @@ class Expression(Node):
if ua == ub:
return str(val) + ua
else:
raise SyntaxError("Error in expression %s != %s" % (ua, ub))
# Nodejs version does not seem to mind mismatched
# units within expressions. So we choose the first
# as they do
# raise SyntaxError("Error in expression %s != %s" % (ua, ub))
return str(val) + ua
elif ua:
return str(val) + ua
elif ub:

View File

@@ -50,10 +50,6 @@ class TestExpression(unittest.TestCase):
e = Expression(test[:3])
self.assertEqual(test[3], e.parse(None), test)
def testinput(self):
e = Expression(['1a', '+', '1b'])
self.assertRaises(SyntaxError, e.parse, None)
if __name__ == '__main__':
unittest.main()