Browse Source

Minor order changes

Yentl Van Tendeloo 9 years ago
parent
commit
3b8ef62dfd
2 changed files with 9 additions and 5 deletions
  1. 1 0
      bootstrap/bootstrap.py
  2. 8 5
      bootstrap/primitives.alc

+ 1 - 0
bootstrap/bootstrap.py

@@ -160,6 +160,7 @@ code_new_users = \
 '''
 Element main
 
+// Do this only in the bootstrapper
 include "io.alh"
 include "primitives.alc"
 include "compilation_manager.alc"

+ 8 - 5
bootstrap/primitives.alc

@@ -98,17 +98,20 @@ Element function exec(first_instr : Element):
 	//  after the if conditional, we append a return of an empty element, as we need a return at the end
 	//  returns in the code are therefore allowed (and will be the return value), but not necessarily
 	Element n
-	n = create_node()
-	dict_add(n, "params", create_node())
 	Element exec_if
-	exec_if = create_value(!if)
 	Element exec_const_true
+	Element exec_return
+
+	n = create_node()
+	exec_if = create_value(!if)
 	exec_const_true = create_value(!constant)
+	exec_return = create_value(!return)
+
+	dict_add(n, "params", create_node())
 	dict_add(exec_const_true, "node", create_value(True))
 	dict_add(exec_if, "cond", exec_const_true)
 	dict_add(exec_if, "then", first_instr)
 	dict_add(n, "body", exec_if)
-	Element exec_return
-	exec_return = create_value(!return)
 	dict_add(exec_if, "next", exec_return)
+
 	return n()