summaryrefslogtreecommitdiff
path: root/EXPRESSIONS
diff options
context:
space:
mode:
Diffstat (limited to 'EXPRESSIONS')
-rw-r--r--EXPRESSIONS50
1 files changed, 50 insertions, 0 deletions
diff --git a/EXPRESSIONS b/EXPRESSIONS
index d9b8562..8c53612 100644
--- a/EXPRESSIONS
+++ b/EXPRESSIONS
@@ -95,4 +95,54 @@
}
}
}
+, "stage_artifact_to_singleton_field":
+ { "vars": ["artifact", "fieldname", "transition"]
+ , "expression":
+ { "type": "let*"
+ , "bindings":
+ [ [ "location"
+ , { "type": "++"
+ , "$1":
+ { "type": "foreach"
+ , "var": "src"
+ , "range":
+ {"type": "FIELD", "name": {"type": "var", "name": "fieldname"}}
+ , "body":
+ { "type": "keys"
+ , "$1":
+ { "type": "DEP_ARTIFACTS"
+ , "dep": {"type": "var", "name": "src"}
+ , "transition":
+ { "type": "var"
+ , "name": "transition"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ }
+ }
+ }
+ ]
+ , [ "staged_artifact"
+ , { "type": "foreach_map"
+ , "range": {"type": "var", "name": "artifact"}
+ , "var_val": "val"
+ , "body":
+ { "type": "foreach"
+ , "range": {"type": "var", "name": "location"}
+ , "var": "pos"
+ , "body":
+ { "type": "singleton_map"
+ , "key": {"type": "var", "name": "pos"}
+ , "value": {"type": "var", "name": "val"}
+ }
+ }
+ }
+ ]
+ ]
+ , "body":
+ { "type": "disjoint_map_union"
+ , "$1": {"type": "++", "$1": {"type": "var", "name": "staged_artifact"}}
+ }
+ }
+ }
}