diff --git a/info4/kapitel-8/Interpreter/gotointerpreter.py b/info4/kapitel-8/Interpreter/gotointerpreter.py index 30ff6e062dc13650c1ddfb32e402c97eaaa9164a..577418963945ba8111e55e4f0aeda8c8a00bc0ab 100644 --- a/info4/kapitel-8/Interpreter/gotointerpreter.py +++ b/info4/kapitel-8/Interpreter/gotointerpreter.py @@ -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'), diff --git a/info4/kapitel-8/Interpreter/test_goto_interpreter.py b/info4/kapitel-8/Interpreter/test_goto_interpreter.py index 3510c713abc69bc12f0aecf3ea2a5b2cf819fd3f..84a911ebe4ab4a6c242aafd448304d10733d9d45 100644 --- a/info4/kapitel-8/Interpreter/test_goto_interpreter.py +++ b/info4/kapitel-8/Interpreter/test_goto_interpreter.py @@ -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):