diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-08-24 18:23:37 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-09-13 10:51:13 +0200 |
commit | 3e4e38f6987d7435232b175fd0070608b76b4d50 (patch) | |
tree | b65a1966b6fb27b0de42c8b90219e97b952fe7f6 /CC/EXPRESSIONS | |
parent | de4f1edc350636e4e2cde14ef1adda8716d394f6 (diff) | |
download | rules-cc-3e4e38f6987d7435232b175fd0070608b76b4d50.tar.gz |
Rules: Implement hierarchical defaults
Diffstat (limited to 'CC/EXPRESSIONS')
-rw-r--r-- | CC/EXPRESSIONS | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS index d04591f..7ebc8ad 100644 --- a/CC/EXPRESSIONS +++ b/CC/EXPRESSIONS @@ -48,6 +48,29 @@ , "body": {"type": "CALL_EXPRESSION", "name": "provider_list"} } } +, "defaults-base-provides": + { "doc": ["Query list-provider from 'base' targets (last wins)"] + , "vars": ["provider"] + , "vars_doc": + {"provider": ["The name of the list-provider in the provides map."]} + , "imports": {"provider_list": ["./", "..", "field_provider_list"]} + , "expression": + { "type": "let*" + , "bindings": [["fieldname", "base"]] + , "body": + { "type": "foldl" + , "var": "next" + , "accum_var": "curr" + , "range": {"type": "CALL_EXPRESSION", "name": "provider_list"} + , "body": + { "type": "if" + , "cond": {"type": "var", "name": "next"} + , "then": {"type": "var", "name": "next"} + , "else": {"type": "var", "name": "curr"} + } + } + } + } , "configure transition": { "vars": ["COMPILER_FAMILY"] , "expression": |