Commit e182c378 authored by Stefan Marr's avatar Stefan Marr

Fix shell

Signed-off-by: default avatarStefan Marr <>
parent 25ed7d6d
......@@ -17,13 +17,10 @@ class Shell(object):
counter = 0
it = self._universe.nilObject
std_println("SOM Shell. Type \"quit\" to exit.\n");
std_println("SOM Shell. Type \"quit\" to exit.\n")
# Create a fake bootstrap frame
current_frame = self._interpreter.push_new_frame(self._bootstrap_method, None)
# Remember the first bytecode index, e.g. index of the halt instruction
bytecode_index = current_frame.get_bytecode_index()
current_frame = self._interpreter.new_frame(None, self._bootstrap_method, None)
while True:
......@@ -45,12 +42,8 @@ class Shell(object):
# If success
if my_class:
current_frame = self._interpreter.get_frame()
# Go back, so we will evaluate the bootstrap frames halt
# instruction again
# Create and push a new instance of our class on the stack
my_object = self._universe.new_instance(my_class)
......@@ -65,15 +58,10 @@ class Shell(object):
# Invoke the run method
initialize.invoke(current_frame, self._interpreter)
# Start the interpreter
# Save the result of the run method
it = current_frame.pop()
except Exception, e:
except Exception as e:
if not we_are_translated(): # this cannot be done in rpython
import traceback
error_println("Caught exception: %s" % e)
Markdown is supported
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