Browse Source

Cleanup of code

Yentl Van Tendeloo 8 years ago
parent
commit
d4ef2746e5
2 changed files with 6 additions and 30 deletions
  1. 0 1
      bootstrap/object_operations.alc
  2. 6 29
      core/mini_modify.alc

+ 0 - 1
bootstrap/object_operations.alc

@@ -298,7 +298,6 @@ String function read_type(model : Element, name : String):
 				return ""!
 		else:
 			log("Untyped " + name)
-			log("Type mapping: " + dict_to_string(model["type_mapping"]))
 			return ""!
 	else:
 		log("Couldn't find type of " + name)

+ 6 - 29
core/mini_modify.alc

@@ -132,33 +132,10 @@ Element function modify(model : Element, write : Boolean):
 			else:
 				output("Permission denied")
 
-		elif (cmd == "attr_modify"):
-			if (write):
-				String model_name
-				output("Element to modify?")
-				model_name = input()
-				if (dict_in(model["model"], model_name)):
-					Element attrs
-					attrs = getAttributeList(model, model_name)
-					String attr_name
-					output("Attribute to modify?")
-					attr_name = input()
-					if (set_in(dict_keys(attrs), attr_name)):
-						output("New value?")
-						unset_attribute(model, model_name, attr_name)
-						instantiate_attribute(model, model_name, attr_name, input())
-						output("Modified!")
-					else:
-						output("No such attribute!")
-				else:
-					output("No such model!")
-			else:
-				output("Permission denied")
-
 		elif (cmd == "attr_add"):
 			if (write):
 				String model_name
-				output("Which model do you want to assign an attribute to?")
+				output("Which element do you want to assign an attribute to?")
 				model_name = input()
 				if (dict_in(model["model"], model_name)):
 					Element attrs
@@ -173,14 +150,14 @@ Element function modify(model : Element, write : Boolean):
 					else:
 						output("No such attribute!")
 				else:
-					output("No such model!")
+					output("No such element!")
 			else:
 				output("Permission denied")
 
 		elif (cmd == "attr_add_code"):
 			if (write):
 				String model_name
-				output("Which model do you want to assign a coded attribute to?")
+				output("Which element do you want to assign a coded attribute to?")
 				model_name = input()
 				if (dict_in(model["model"], model_name)):
 					Element attrs
@@ -195,14 +172,14 @@ Element function modify(model : Element, write : Boolean):
 					else:
 						output("No such attribute!")
 				else:
-					output("No such model!")
+					output("No such element!")
 			else:
 				output("Permission denied")
 
 		elif (cmd == "attr_del"):
 			if (write):
 				String model_name
-				output("Which model do you want to remove an attribute of?")
+				output("Which element do you want to remove an attribute of?")
 				model_name = input()
 				if (dict_in(model["model"], model_name)):
 					Element attrs
@@ -216,7 +193,7 @@ Element function modify(model : Element, write : Boolean):
 					else:
 						output("No such attribute!")
 				else:
-					output("No such model!")
+					output("No such element!")
 			else:
 				output("Permission denied")