瀏覽代碼

Small change to serve as proof of concept for the change of dict_read

Yentl Van Tendeloo 9 年之前
父節點
當前提交
3c49843b8d
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      bootstrap/library.alc

+ 3 - 3
bootstrap/library.alc

@@ -12,8 +12,8 @@ Element function export_node(model_name : String, model_reference : Element):
 	while(counter_i < length):
 		if (bool_not(dict_in(current, list_read(splitted, counter_i)))):
 			// Create it first
-			dict_add(current, list_read(splitted, counter_i), create_node())
-		current = dict_read(current, list_read(splitted, counter_i))
+			dict_add(current, splitted[counter_i], create_node())
+		current = current[list_read(splitted, counter_i)]
 		counter_i = counter_i + 1
 	
 	// current now contains the place where we should add the element
@@ -31,7 +31,7 @@ Element function import_node(model_name : String):
 	Element current
 	current = dict_read(read_root(), "__hierarchy")
 	while (counter_i < length):
-		current = dict_read(current, list_read(splitted, counter_i))
+		current = current[splitted[counter_i]]
 		counter_i = counter_i + 1
 
 	return current