Browse Source

Fixed object_operations code for list of instantiable attributes

Yentl Van Tendeloo 8 years ago
parent
commit
a48812101d
1 changed files with 16 additions and 0 deletions
  1. 16 0
      bootstrap/object_operations.alc

+ 16 - 0
bootstrap/object_operations.alc

@@ -126,6 +126,22 @@ Element function getAttributeList(model : Element, element : String):
 	return result!
 	return result!
 
 
 Element function getInstantiatableAttributes(model : Element, element : String):
 Element function getInstantiatableAttributes(model : Element, element : String):
+	// TODO check if this works!
+	//output("WARNING: untested code triggered")
+	Element all_links
+	Element result
+	String link
+
+	result = create_node()
+
+	all_links = allOutgoingAssociationInstances(model, element, "Attribute")
+	while (read_nr_out(all_links) > 0):
+		link = set_pop(all_links)
+		dict_add(result, read_attribute(model, link, "name"), read_type(model, readAssociationDestination(model, link)))
+
+	return result!
+
+Element function getInstantiatableAttributes_old(model : Element, element : String):
 	Element result
 	Element result
 	result = create_node()
 	result = create_node()