瀏覽代碼

Fixed the constructor not looping on unknown command

Yentl Van Tendeloo 9 年之前
父節點
當前提交
17e8d9433a
共有 1 個文件被更改,包括 8 次插入7 次删除
  1. 8 7
      bootstrap/constructors.alc

+ 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