Browse Source

Fixed the same problem in modelling.alc as well

Yentl Van Tendeloo 8 years ago
parent
commit
c2e9037bb6
2 changed files with 11 additions and 10 deletions
  1. BIN
      bootstrap/bootstrap.m.gz
  2. 11 10
      bootstrap/modelling.alc

BIN
bootstrap/bootstrap.m.gz


+ 11 - 10
bootstrap/modelling.alc

@@ -145,17 +145,18 @@ Element function get_superclasses(model : Element, name : String):
 	result = create_node()
 	i = 0
 
-	while (0 < list_len(nodes)):
+	while (list_len(nodes) > 0):
 		elem = set_pop(nodes)
-		create_edge(result, reverseKeyLookup(model["model"], elem))
-		// Read out all outgoing edges
-		num_edges = read_nr_out(elem)
-		j = 0
-		while (j < num_edges):
-			edge = read_out(elem, j)
-			if (element_eq(dict_read_node(model["type_mapping"], edge), model["inheritance"])):
-				set_add(nodes, read_edge_dst(edge))
-			j = j + 1
+		if (bool_not(set_in(result, reverseKeyLookup(model["model"], elem)))):
+			create_edge(result, reverseKeyLookup(model["model"], elem))
+			// Read out all outgoing edges
+			num_edges = read_nr_out(elem)
+			j = 0
+			while (j < num_edges):
+				edge = read_out(elem, j)
+				if (element_eq(dict_read_node(model["type_mapping"], edge), model["inheritance"])):
+					set_add(nodes, read_edge_dst(edge))
+				j = j + 1
 
 	return result!