From a20974ba714485fe2d6fdb50340d4315d09cebbe Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 5 Nov 2024 16:27:27 +0100 Subject: Use quote and quasi-quote to simplify some expressions --- rules/CC/test/EXPRESSIONS | 17 +++++++---------- rules/EXPRESSIONS | 2 +- rules/lint/RULES | 3 +-- rules/shell/test/RULES | 17 +++++++---------- 4 files changed, 16 insertions(+), 23 deletions(-) (limited to 'rules') diff --git a/rules/CC/test/EXPRESSIONS b/rules/CC/test/EXPRESSIONS index b42401be..18028f8e 100644 --- a/rules/CC/test/EXPRESSIONS +++ b/rules/CC/test/EXPRESSIONS @@ -348,19 +348,16 @@ } ] , [ "artifacts" - , { "type": "map_union" + , { "type": "`" , "$1": - [ { "type": "singleton_map" - , "key": "pwd" - , "value": {"type": "BLOB", "data": "/summary"} - } - , {"type": "var", "name": "summary"} - , { "type": "singleton_map" - , "key": "work" - , "value": + { "pwd": + {"type": ",", "$1": {"type": "BLOB", "data": "/summary"}} + , "work": + { "type": "," + , "$1": {"type": "TREE", "$1": {"type": "var", "name": "attempts"}} } - ] + } } ] , [ "runfiles" diff --git a/rules/EXPRESSIONS b/rules/EXPRESSIONS index b974026e..0c1f611f 100644 --- a/rules/EXPRESSIONS +++ b/rules/EXPRESSIONS @@ -126,7 +126,7 @@ , "expression": { "type": "map_union" , "$1": - [ {"type": "singleton_map", "key": "PATH", "value": "/bin:/usr/bin"} + [ {"type": "'", "$1": {"PATH": "/bin:/usr/bin"}} , {"type": "var", "name": "ENV", "default": {"type": "empty_map"}} ] } diff --git a/rules/lint/RULES b/rules/lint/RULES index 0fba1271..0da42d2f 100644 --- a/rules/lint/RULES +++ b/rules/lint/RULES @@ -93,8 +93,7 @@ , "call_lint": ["call_lint"] , "call_summary": ["call_summary"] } - , "config_transitions": - {"targets": [{"type": "singleton_map", "key": "LINT", "value": true}]} + , "config_transitions": {"targets": [{"type": "'", "$1": {"LINT": true}}]} , "anonymous": {"lint": {"target": "targets", "provider": "lint", "rule_map": {}}} , "imports": diff --git a/rules/shell/test/RULES b/rules/shell/test/RULES index 98fdab03..3d49db21 100644 --- a/rules/shell/test/RULES +++ b/rules/shell/test/RULES @@ -310,19 +310,16 @@ } ] , [ "artifacts" - , { "type": "map_union" + , { "type": "`" , "$1": - [ { "type": "singleton_map" - , "key": "pwd" - , "value": {"type": "BLOB", "data": "/summary"} - } - , {"type": "var", "name": "summary"} - , { "type": "singleton_map" - , "key": "work" - , "value": + { "pwd": + {"type": ",", "$1": {"type": "BLOB", "data": "/summary"}} + , "work": + { "type": "," + , "$1": {"type": "TREE", "$1": {"type": "var", "name": "attempts"}} } - ] + } } ] , [ "runfiles" -- cgit v1.2.3