diff options
author | Eduardo Julian | 2019-04-16 20:53:41 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-16 20:53:41 -0400 |
commit | 697707d8560a5735be38fd9b1ff91a02c289d48f (patch) | |
tree | 7f9e81974c9ec3ede82e7f2392ebba037e3e9df8 /new-luxc/source/luxc/lang/translation/jvm/expression.lux | |
parent | 42248854f0cb5e3364e6aae25527cee65cbda3e8 (diff) |
Made some new-luxc modules "old".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/expression.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/expression.lux | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/expression.lux b/new-luxc/source/luxc/lang/translation/jvm/expression.lux new file mode 100644 index 000000000..c6b77e549 --- /dev/null +++ b/new-luxc/source/luxc/lang/translation/jvm/expression.lux @@ -0,0 +1,70 @@ +(.module: + [lux #* + [tool + [compiler + ["." synthesis] + [phase + ["." extension]]]]] + [luxc + [lang + [host + [jvm (#+ Phase)]]]] + [// + ["." common] + ["." primitive] + ["." structure] + ["." reference] + ["." case] + ["." loop] + ["." function]]) + +(def: #export (translate synthesis) + Phase + (case synthesis + (^ (synthesis.bit value)) + (primitive.bit value) + + (^ (synthesis.i64 value)) + (primitive.i64 value) + + (^ (synthesis.f64 value)) + (primitive.f64 value) + + (^ (synthesis.text value)) + (primitive.text value) + + (^ (synthesis.variant [lefts right? value])) + (structure.variant translate lefts right? value) + + (^ (synthesis.tuple members)) + (structure.tuple translate members) + + (^ (synthesis.variable variable)) + (reference.variable variable) + + (^ (synthesis.constant constant)) + (reference.constant constant) + + (^ (synthesis.branch/let [input register expr])) + (case.let translate input register expr) + + (^ (synthesis.branch/if [test then else])) + (case.if translate test then else) + + (^ (synthesis.branch/case [input path])) + (case.case translate input path) + + (^ (synthesis.loop/recur data)) + (loop.recur translate data) + + (^ (synthesis.loop/scope data)) + (loop.scope translate data) + + (^ (synthesis.function/apply apply)) + (function.call translate apply) + + (^ (synthesis.function/abstraction abstraction)) + (function.function translate abstraction) + + (#synthesis.Extension extension) + (extension.apply translate extension))) |