|
@@ -63,9 +63,13 @@ def create_get_length(expression):
|
|
|
# pylint: disable=I0011,C0103
|
|
|
def __set_add(a, b):
|
|
|
store_a, load_a = tree_ir.evaluate_and_load(a)
|
|
|
+ store_b, load_b = tree_ir.evaluate_and_load(b)
|
|
|
return tree_ir.create_block(
|
|
|
store_a,
|
|
|
- tree_ir.CreateEdgeInstruction(load_a, b),
|
|
|
+ store_b,
|
|
|
+ tree_ir.CreateEdgeInstruction(
|
|
|
+ tree_ir.CreateEdgeInstruction(load_a, a),
|
|
|
+ load_b),
|
|
|
load_a)
|
|
|
|
|
|
def __dict_add(a, b, c):
|
|
@@ -283,6 +287,8 @@ MISC_INTRINSICS = {
|
|
|
tree_ir.LiteralInstruction('task_root')),
|
|
|
|
|
|
# Dictionary operations
|
|
|
+ 'dict_create' : tree_ir.CreateNodeInstruction,
|
|
|
+ 'dict_len': __read_nr_out,
|
|
|
'dict_read' :
|
|
|
lambda a, b:
|
|
|
tree_ir.ReadDictionaryValueInstruction(
|
|
@@ -298,11 +304,13 @@ MISC_INTRINSICS = {
|
|
|
'dict_len' : __read_nr_out,
|
|
|
|
|
|
# Set operations
|
|
|
- #'set_add' : __set_add,
|
|
|
+ 'set_create' : tree_ir.CreateNodeInstruction,
|
|
|
+ 'set_add' : __set_add,
|
|
|
+ 'set_len' : __read_nr_out,
|
|
|
|
|
|
# List operations
|
|
|
+ 'list_create' : tree_ir.CreateNodeInstruction,
|
|
|
'list_len' : __read_nr_out,
|
|
|
-
|
|
|
'list_read' : __list_read,
|
|
|
'list_append' : __list_append,
|
|
|
|
|
@@ -454,6 +462,8 @@ MISC_CFG_INTRINSICS = {
|
|
|
'dict_in' : __dict_in_cfg,
|
|
|
'dict_in_node' : __dict_in_node_cfg,
|
|
|
|
|
|
+ 'set_in' : __dict_in_cfg,
|
|
|
+
|
|
|
# List operations
|
|
|
'list_len' : __read_nr_out_cfg
|
|
|
}
|