diff options
Diffstat (limited to 'rules/transitions')
-rw-r--r-- | rules/transitions/EXPRESSIONS | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/rules/transitions/EXPRESSIONS b/rules/transitions/EXPRESSIONS index 8ea75500..4fd0d1e9 100644 --- a/rules/transitions/EXPRESSIONS +++ b/rules/transitions/EXPRESSIONS @@ -10,4 +10,48 @@ } } } +, "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"} + } + } } |