Sfoglia il codice sorgente

Remove lots of redundant typing code

Yentl Van Tendeloo 7 anni fa
parent
commit
038f2d6fac
1 ha cambiato i file con 0 aggiunte e 27 eliminazioni
  1. 0 27
      bootstrap/typing.alc

+ 0 - 27
bootstrap/typing.alc

@@ -50,7 +50,6 @@ Void function set_type_mapping(model : Element, type_mapping_model : Element):
 				dict_add_fast(type_mapping, rev_model[cast_id2s(read_edge_src(type_mapping_model[key]))], rev_metamodel[cast_id2s(read_edge_dst(type_mapping_model[key]))])
 
 	dict_overwrite(model, "type_mapping", type_mapping)
-	dict_overwrite(model, "type_mapping_model", type_mapping_model)
 	return!
 
 Element function elements_typed_by(model : Element, type_name : String):
@@ -83,36 +82,10 @@ Void function retype(model : Element, element : String, type : String):
 	// Retype a model, deleting any previous type the element had
 	// The type string is evaluated in the metamodel previously specified
 	dict_overwrite(model["type_mapping"], element, type)
-
-	// TODO this is a serious problem, which we now want to avoid...
-	if (cast_id2s(model["model"][element]) == "0"):
-		return!
-
-	// Remove previous type
-	String elem
-	elem = cast_id2s(model["model"][element])
-	if (dict_in(model["type_mapping_model"], elem)):
-		dict_delete(model["type_mapping_model"], elem)
-
-	// Add element of the model
-	dict_add_fast(model["type_mapping_model"], cast_id2s(model["model"][element]), model["model"][element])
-
-	// Add element of metamodel if not yet there
-	Element type_entry
-	type_entry = model["metamodel"]["model"][type]
-	if (bool_not(dict_in(model["type_mapping_model"], cast_id2s(type_entry)))):
-		dict_add_fast(model["type_mapping_model"], cast_id2s(type_entry), type_entry)
-
-	// Draw a link between them: the typing link
-	Element new_edge
-	new_edge = create_edge(model["model"][element], type_entry)
-	dict_add_fast(model["type_mapping_model"], cast_id2s(new_edge), new_edge)
-
 	return!
 
 Void function new_type_mapping(model : Element):
 	dict_overwrite(model, "type_mapping", dict_create())
-	dict_overwrite(model["type_mapping_model"], "model", dict_create())
 	return !
 
 Void function remove_type(model : Element, name : String):