diff options
author | Eduardo Julian | 2018-07-21 02:10:54 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-07-21 02:10:54 -0400 |
commit | 660c7fe6af927c6e668a86e44fd2f0a9b1fb8b8b (patch) | |
tree | 3110462b0bca61fd2f9082b1c352bd5346b11662 /stdlib/source/lux/compiler/default/phase/translation/scheme/reference.jvm.lux | |
parent | 76e97634aaab09c89a895a6f6e863d10479821d1 (diff) |
- Re-named "Compiler" to "Phase".
- Re-structured the compiler infrastructure.
Diffstat (limited to 'stdlib/source/lux/compiler/default/phase/translation/scheme/reference.jvm.lux')
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/reference.jvm.lux | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/stdlib/source/lux/compiler/default/phase/translation/scheme/reference.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/reference.jvm.lux new file mode 100644 index 000000000..3fca5842f --- /dev/null +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/reference.jvm.lux @@ -0,0 +1,60 @@ +(.module: + [lux #* + [control + pipe] + [data + [text + format]]] + [// + [runtime (#+ Operation)] + [/// ("operation/." Monad<Operation>) + [analysis (#+ Variant Tuple)] + [synthesis (#+ Synthesis)] + [// + ["." reference (#+ Register Variable Reference)] + ["." name] + [// + [host + ["_" scheme (#+ Expression Var)]]]]]]) + +(do-template [<name> <prefix>] + [(def: #export <name> + (-> Register Var) + (|>> .int %i (format <prefix>) _.var))] + + [local' "l"] + [foreign' "f"] + ) + +(def: #export variable' + (-> Variable Var) + (|>> (case> (#reference.Local register) + (local' register) + + (#reference.Foreign register) + (foreign' register)))) + +(def: #export variable + (-> Variable (Operation Var)) + (|>> ..variable' + operation/wrap)) + +(def: #export constant' + (-> Ident Var) + (|>> name.definition _.var)) + +(def: #export constant + (-> Ident (Operation Var)) + (|>> constant' operation/wrap)) + +(def: #export reference' + (-> Reference Expression) + (|>> (case> (#reference.Constant value) + (..constant' value) + + (#reference.Variable value) + (..variable' value)))) + +(def: #export reference + (-> Reference (Operation Expression)) + (|>> reference' operation/wrap)) |