Commit 8005a507 authored by Christopher Happe's avatar Christopher Happe
Browse files

Support für MINUS in Unicode.

parent 6bbba802
......@@ -14,7 +14,7 @@ class GOTOInterpreter:
(re.compile(r'x\d+'), 'IDENTIFIER'),
(re.compile(r'M\d+'), 'MARKER'),
(re.compile(r'\+'), 'PLUS'),
(re.compile(r'-'), 'MINUS'),
(re.compile(r'-|−'), 'MINUS'),
(re.compile(r':=|≔'), 'ALLOCATION'),
(re.compile(r'='), 'EQUALS'),
(re.compile(r'/=|≠|!='), 'NOTEQUALS'),
......
......@@ -37,6 +37,7 @@ class GOTOInterpreterTest(TestCase):
self.assertEqual(interpret('M1:x0:=x0+1;M2:HALT;'), 1)
self.assertEqual(interpret('M1:x0:= 5; M2:x0:=x0-1; M3:HALT;'), 4)
self.assertEqual(interpret('M1:x0:=x1-1; M2:x0:=x0+1; M3:HALT;'), 1)
self.assertEqual(interpret('M1:x0:=4; M2:x0:= x0 − 1; M3:HALT;'), 3)
def test_assignment_wrong_syntax(self):
with self.assertRaises(SyntaxError):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment