Sfoglia il codice sorgente

commit some long outstanding changes

Joeri Exelmans 2 settimane fa
parent
commit
558772fbe4
2 ha cambiato i file con 7 aggiunte e 3 eliminazioni
  1. 1 2
      bootstrap/scd.py
  2. 6 1
      transformation/rewriter.py

+ 1 - 2
bootstrap/scd.py

@@ -78,8 +78,7 @@ def bootstrap_scd(state: State) -> UUID:
     add_edge_element("gc_inh_element", glob_constr_node, element_node)
     # # Attribute inherits from Element
     add_edge_element("attr_inh_element", attr_node, element_node)
-    # # Association inherits from Element
-    # add_edge_element("assoc_inh_element", assoc_edge, element_node)
+    # # Association inherits from Class
     add_edge_element("assoc_inh_element", assoc_edge, class_node)
     # # AttributeLink inherits from Element
     add_edge_element("attr_link_inh_element", attr_link_edge, element_node)

+ 6 - 1
transformation/rewriter.py

@@ -223,7 +223,12 @@ def rewrite(state,
             result = exec_then_eval(python_expr,
                 _globals=eval_globals,
                 _locals={'this': host_obj}) # 'this' can be used to read the previous value of the slot
-            host_odapi.overwrite_primitive_value(host_obj_name, result, is_code=False)
+            # print("EVAL", common_name, python_expr, "RESULT", result, host_obj_name)
+            try:
+                host_odapi.overwrite_primitive_value(host_obj_name, result, is_code=False)
+            except Exception as e:
+                e.add_note(f"while evaluating attribute {common_name}")
+                raise
         else:
             msg = f"Don't know what to do with element '{common_name}' -> '{host_obj_name}:{host_type}')"
             # print(msg)