From adfcea9d9a67dca8627e9c5da9e81b03c1c83857 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 4 Mar 2022 15:47:26 +0100 Subject: Add rule ["patch", "file"] ... to patch a single file, logically in place. --- EXPRESSIONS | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'EXPRESSIONS') 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"}} + } + } + } } -- cgit v1.2.3