summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-11-05 16:27:27 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-11-06 14:37:16 +0100
commitee8a8d511fb5c8d0cbad8a5979759ce853e8d767 (patch)
treed9061a648fba7cffe3d6dd6b39f4543afd669d40
parent9e7f2b68357dc1fbd073244e5a242a8317c8207d (diff)
downloadrules-cc-ee8a8d511fb5c8d0cbad8a5979759ce853e8d767.tar.gz
Use quote and quasi-quote to simplify some expressions
-rw-r--r--CC/test/EXPRESSIONS17
-rw-r--r--EXPRESSIONS2
-rw-r--r--lint/RULES3
-rw-r--r--shell/test/RULES17
4 files changed, 16 insertions, 23 deletions
diff --git a/CC/test/EXPRESSIONS b/CC/test/EXPRESSIONS
index b42401b..18028f8 100644
--- a/CC/test/EXPRESSIONS
+++ b/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/EXPRESSIONS b/EXPRESSIONS
index b974026..0c1f611 100644
--- a/EXPRESSIONS
+++ b/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/lint/RULES b/lint/RULES
index 0fba127..0da42d2 100644
--- a/lint/RULES
+++ b/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/shell/test/RULES b/shell/test/RULES
index 98fdab0..3d49db2 100644
--- a/shell/test/RULES
+++ b/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"