Przeglądaj źródła

Removed redundant input() statements and fixed some bugs

Yentl Van Tendeloo 9 lat temu
rodzic
commit
fb18c942fb
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6 6
      integration/code/cbd_semantics.alc

+ 6 - 6
integration/code/cbd_semantics.alc

@@ -273,16 +273,16 @@ Void function execute_cbd(design_model : Element):
 		elif (cmd == "read_available_attributes"):
 			// Returns a list of all available attributes
 			Element attr_list
-			attr_list = dict_keys(getAttributeList(model, cmd))
+			attr_list = dict_keys(getAttributeList(design_model, cmd))
 			while (0 < read_nr_out(attr_list)):
-				output("AVAILABLE_ATTR_VALUE " + set_pop(attr_list))
+				output("AVAILABLE_ATTR_VALUE " + cast_v2s(set_pop(attr_list)))
 			output("AVAILABLE_ATTR_END")
 
 		elif (cmd == "read_attribute"):
 			// Returns the value of an attribute
-			output("ATTR_VALUE " + cast_v2s(read_attribute(runtime_model, input(), input())))
+			output("ATTR_VALUE " + cast_v2s(read_attribute(design_model, input(), input())))
 
-		elif (boolean_or(boolean_or(cmd == "set_attribute", cmd == "instantiate_node"), cmd == "instantiate_association")):
+		elif (bool_or(bool_or(cmd == "set_attribute", cmd == "instantiate_node"), cmd == "instantiate_association")):
 			// Modify the structure
 			if (cmd == "set_attribute"):
 				// Setting an attribute
@@ -292,11 +292,11 @@ Void function execute_cbd(design_model : Element):
 				attribute_name = input()
 
 				// Delete it if it exists already
-				if (boolean_not(element_eq(read_attribute(design_model, element_name, attribute_name), read_root()))):
+				if (bool_not(element_eq(read_attribute(design_model, element_name, attribute_name), read_root()))):
 					unset_attribute(design_model, element_name, attribute_name)
 
 				// And finally set it
-				instantiate_attribute(design_model, input(), input(), input())
+				instantiate_attribute(design_model, element_name, attribute_name, input())
 
 			elif (cmd == "instantiate_node"):
 				// Instantiate a node