Browse Source

Fixed some compilation problems

Yentl Van Tendeloo 8 years ago
parent
commit
13ad926bbd

+ 1 - 1
bootstrap/bootstrap.py

@@ -25,7 +25,7 @@ def bootstrap():
                     "integer_subtraction": ["Integer", "Integer", "Integer"],
                     "integer_multiplication": ["Integer", "Integer", "Integer"],
                     "integer_division": ["Integer", "Integer", "Integer"],
-                    "integer_gt": ["Boolean", "Integer", "Integer"],
+                    "integer_lt": ["Boolean", "Integer", "Integer"],
                     "float_addition": ["Float", "Float", "Float"],
                     "float_subtraction": ["Float", "Float", "Float"],
                     "float_multiplication": ["Float", "Float", "Float"],

+ 1 - 0
bootstrap/constructors.alc

@@ -338,6 +338,7 @@ Action function construct_declare():
 	dict_add_fast(variable_map, name, declared_element)
 
 	// Assign value
+	String op
 	op = input()
 	if (op != "none"):
 		Action assign

+ 1 - 0
bootstrap/initial_code_manager.alc

@@ -1,4 +1,5 @@
 include "bootstrap/primitives.alc"
+include "bootstrap/semi_primitives.alc"
 include "task_manager.alh"
 
 Void function __main():

+ 1 - 0
bootstrap/initial_code_task.alc

@@ -1,4 +1,5 @@
 include "bootstrap/primitives.alc"
+include "bootstrap/semi_primitives.alc"
 include "bootstrap/core_algorithm.alc"
 
 Void mutable function __main():

+ 0 - 2
bootstrap/primitives.alc

@@ -30,7 +30,6 @@ String function cast_e2s(a: Element) = ?primitives/cast_e2s
 String function cast_a2s(a: Action) = ?primitives/cast_a2s
 String function cast_v2s(a: Element) = ?primitives/cast_v2s
 String function cast_id2s(a: Element) = ?primitives/cast_id2s
-Element function dict_add(a: Element, b: Element, c: Element) = ?primitives/dict_add
 Element function dict_add_fast(a: Element, b: Element, c: Element) = ?primitives/dict_add_fast
 Element function dict_delete(a: Element, b: Element) = ?primitives/dict_delete
 Element function dict_delete_node(a: Element, b: Element) = ?primitives/dict_delete_node
@@ -50,7 +49,6 @@ Integer function integer_addition(a: Integer, b: Integer) = ?primitives/integer_
 Integer function integer_subtraction(a: Integer, b: Integer) = ?primitives/integer_subtraction
 Integer function integer_multiplication(a: Integer, b: Integer) = ?primitives/integer_multiplication
 Integer function integer_division(a: Integer, b: Integer) = ?primitives/integer_division
-Boolean function integer_gt(a: Integer, b: Integer) = ?primitives/integer_gt
 Boolean function integer_lt(a: Integer, b: Integer) = ?primitives/integer_lt
 Element function list_insert(a: Element, b: Element, c: Integer) = ?primitives/list_insert
 Element function list_delete(a: Element, b: Integer) = ?primitives/list_delete

+ 6 - 3
bootstrap/semi_primitives.alc

@@ -1,5 +1,8 @@
 include "primitives.alh"
 
+// This function must be kept internally, only called through the "sleep" and "interruptable_sleep" functions
+Float function __sleep(a : Float, b : Boolean) = ?primitives/__sleep
+
 Boolean function value_neq(a : Element, b : Element):
 	return bool_not(value_eq(a, b))!
 
@@ -9,7 +12,7 @@ Boolean function integer_gt(a : Element, b : Element):
 Boolean function float_gt(a : Element, b : Element):
 	return bool_or(float_lt(a, b), value_eq(a, b))!
 
-Void function dict_add(a : Element, b : Element, c : Element):
+Element function dict_add(a : Element, b : Element, c : Element):
 	create_edge(create_edge(a, c), b)
 	return a!
 
@@ -51,13 +54,13 @@ Element function set_pop(a : Element):
 		delete_element(edge)
 		return edge!
 	else:
-		return read_root()
+		return read_root()!
 
 Element function set_read(a : Element):
 	if (integer_gt(set_len(a), 0)):
 		return read_edge_dst(read_out(a, 0))!
 	else:
-		return read_root()
+		return read_root()!
 
 Void function sleep(a : Float):
 	__sleep(a, False)

+ 1 - 1
interface/HUTN/hutn_compiler/primitives_visitor.py

@@ -448,7 +448,7 @@ class PrimitivesVisitor(Visitor):
             self.dict(assign, "value", value)
             self.set_primitive(tree, (declare, assign))
         else:
-            self.set_primitive(tree, (declare, declare))
+            self.set_primitive(tree, declare)
 
     def visit_parameter(self, tree):
         n = self.node()

+ 0 - 1
interface/HUTN/includes/primitives.alh

@@ -96,7 +96,6 @@ Float function time()
 String function hash(a : String)
 Void function sleep(a : Float)
 Void function interruptable_sleep(a : Float)
-
 Element function exec(a : Element)
 Element function resolve(var_name : String)
 Boolean function has_input()