Pārlūkot izejas kodu

Fixed the constructor not looping on unknown command

Yentl Van Tendeloo 9 gadi atpakaļ
vecāks
revīzija
17e8d9433a
1 mainītis faili ar 8 papildinājumiem un 7 dzēšanām
  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