Browse Source

Merge branch 'yentl' into GC

Yentl Van Tendeloo 9 years ago
parent
commit
ee3c688363
2 changed files with 11 additions and 8 deletions
  1. 8 7
      bootstrap/constructors.alc
  2. 3 1
      kernel/modelverse_kernel/main.py

+ 8 - 7
bootstrap/constructors.alc

@@ -8,13 +8,14 @@ Element while_stack = ?
 
 Action function construct_top():
 	String command
-	command = input()
-	if (command == "global"):
-		return construct_global()
-	elif (command == "funcdef"):
-		return construct_top_funcdef()
-	else:
-		log("ERROR: did not understand command " + cast_e2s(command))
+	while (True):
+		command = input()
+		if (command == "global"):
+			return construct_global()
+		elif (command == "funcdef"):
+			return construct_top_funcdef()
+		else:
+			log("ERROR: did not understand command " + cast_e2s(command))
 
 Action function construct_global():
 	Action this_element

+ 3 - 1
kernel/modelverse_kernel/main.py

@@ -57,6 +57,8 @@ class ModelverseKernel(object):
 
         if phase_v == "finish":
             gen = self.helper_init(user_root)
+        elif inst is None:
+            raise Exception("Instruction pointer could not be found!")
         elif isinstance(phase_v, string_types):
             if phase_v == "init" and inst in self.compiled:
                 print("%-30s(%s)" % ("COMPILED " + str(self.compiled[inst]), phase_v))
@@ -439,7 +441,7 @@ class ModelverseKernel(object):
                                    ("RDE", [user_frame, "returnvalue"]),
                                    ("CNV", ["finish"]),
                                   ]
-
+        print("Resolved to " + str(variable))
         _, _, _, _ =        yield [("CD", [user_frame, "phase", new_phase]),
                                    ("CD", [user_frame, "returnvalue", variable]),
                                    ("DE", [phase_link]),