|
@@ -22,15 +22,22 @@ String function JSON_print(model : Element):
|
|
|
String type
|
|
|
String attr_key
|
|
|
Element attr_keys
|
|
|
+ Boolean first
|
|
|
|
|
|
result = "["
|
|
|
keys_m = dict_keys(model["model"])
|
|
|
+ first = True
|
|
|
|
|
|
while (read_nr_out(keys_m) > 0):
|
|
|
v_m = set_pop(keys_m)
|
|
|
type = read_type(model["metamodel"], read_type(model, v_m))
|
|
|
|
|
|
if (bool_or(type == "Class", type == "Association")):
|
|
|
+ if (bool_not(first)):
|
|
|
+ result = result + ","
|
|
|
+ else:
|
|
|
+ first = False
|
|
|
+
|
|
|
result = result + "{"
|
|
|
result = (((result + "\"id\": \"") + v_m) + "\"")
|
|
|
result = (((result + ",") + "\"type\": \"") + read_type(model, v_m)) + "\""
|
|
@@ -46,8 +53,6 @@ String function JSON_print(model : Element):
|
|
|
|
|
|
result = result + "}"
|
|
|
|
|
|
- if (read_nr_out(keys_m) > 0):
|
|
|
- result = result + ","
|
|
|
result = result + "]"
|
|
|
|
|
|
return result!
|