summaryrefslogtreecommitdiff
path: root/transitions
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-07-12 15:29:23 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-07-12 15:29:23 +0200
commitbdeabd1b99600bd8bdd1c002dc73e7863b23d0d3 (patch)
treed7b5282cd0fabff63073f759cab37880ed2afb79 /transitions
parent642f0b1637a331b072d63138157bae23b14c7b59 (diff)
parentaa14a481ce7645f6fb78ce7548a1f60920599d49 (diff)
downloadrules-cc-bdeabd1b99600bd8bdd1c002dc73e7863b23d0d3.tar.gz
Merge branch 'just-rules' into rules
Diffstat (limited to 'transitions')
-rw-r--r--transitions/EXPRESSIONS44
1 files changed, 44 insertions, 0 deletions
diff --git a/transitions/EXPRESSIONS b/transitions/EXPRESSIONS
index 92be685..db401a0 100644
--- a/transitions/EXPRESSIONS
+++ b/transitions/EXPRESSIONS
@@ -26,4 +26,48 @@
, "else": {"type": "empty_map"}
}
}
+, "target properties":
+ { "vars": ["ARCH", "TARGET_ARCH", "ARCH_DISPATCH"]
+ , "expression":
+ { "type": "let*"
+ , "bindings":
+ [ [ "TARGET_ARCH"
+ , { "type": "var"
+ , "name": "TARGET_ARCH"
+ , "default": {"type": "var", "name": "ARCH"}
+ }
+ ]
+ ]
+ , "body":
+ { "type": "if"
+ , "cond":
+ { "type": "=="
+ , "$1": {"type": "var", "name": "TARGET_ARCH"}
+ , "$2": null
+ }
+ , "then": {"type": "empty_map"}
+ , "else":
+ { "type": "lookup"
+ , "map":
+ { "type": "var"
+ , "name": "ARCH_DISPATCH"
+ , "default": {"type": "empty_map"}
+ }
+ , "key": {"type": "var", "name": "TARGET_ARCH"}
+ , "default": {"type": "empty_map"}
+ }
+ }
+ }
+ }
+, "maybe for host":
+ { "vars": ["ARCH", "HOST_ARCH", "TARGET_ARCH", "ARCH_DISPATCH"]
+ , "imports":
+ {"target properties": "target properties", "for host": "for host"}
+ , "expression":
+ { "type": "if"
+ , "cond": {"type": "CALL_EXPRESSION", "name": "target properties"}
+ , "then": {"type": "empty_map"}
+ , "else": {"type": "CALL_EXPRESSION", "name": "for host"}
+ }
+ }
}