Skip to content
Snippets Groups Projects
Commit c4c4bcd2 authored by Chris's avatar Chris
Browse files

Feature: Ausgabe bei Abbruch des Programms

parent 3c80fe3b
No related branches found
No related tags found
1 merge request!1Master
...@@ -273,6 +273,8 @@ class GOTOInterpreter: ...@@ -273,6 +273,8 @@ class GOTOInterpreter:
return self.values.get('x0') return self.values.get('x0')
return 0 return 0
except KeyboardInterrupt: except KeyboardInterrupt:
print('Die Ausführung des Programms wurde unterbrochen.\n' +
'Daher ist der Rückgabewert des Programms nicht definiert.')
return -1 return -1
......
...@@ -243,6 +243,8 @@ class LOOPInterpreter: ...@@ -243,6 +243,8 @@ class LOOPInterpreter:
return self.values.get('x0') return self.values.get('x0')
return 0 return 0
except KeyboardInterrupt: except KeyboardInterrupt:
print('Die Ausführung des Programms wurde unterbrochen.\n' +
'Daher ist der Rückgabewert des Programms nicht definiert.')
return -1 return -1
......
...@@ -178,6 +178,8 @@ class WHILEInterpreter(LOOPInterpreter): ...@@ -178,6 +178,8 @@ class WHILEInterpreter(LOOPInterpreter):
return self.values.get('x0') return self.values.get('x0')
return 0 return 0
except KeyboardInterrupt: except KeyboardInterrupt:
print('Die Ausführung des Programms wurde unterbrochen.\n' +
'Daher ist der Rückgabewert des Programms nicht definiert.')
return -1 return -1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment