aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux')
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux54
1 files changed, 54 insertions, 0 deletions
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux
new file mode 100644
index 000000000..a654fe4d0
--- /dev/null
+++ b/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux
@@ -0,0 +1,54 @@
+(.module:
+ lux
+ (lux (control [monad #+ do]))
+ (///// [compiler]
+ (compiler [synthesis]
+ [extension]))
+ [//runtime #+ Translator]
+ [//primitive]
+ [//structure]
+ [//reference]
+ [//function]
+ [//case]
+ [//loop])
+
+(def: #export (translate synthesis)
+ Translator
+ (case synthesis
+ (^template [<tag> <generator>]
+ (^ (<tag> value))
+ (<generator> value))
+ ([synthesis.bool //primitive.bool]
+ [synthesis.i64 //primitive.i64]
+ [synthesis.f64 //primitive.f64]
+ [synthesis.text //primitive.text])
+
+ (^ (synthesis.variant variantS))
+ (//structure.variant translate variantS)
+
+ (^ (synthesis.tuple members))
+ (//structure.tuple translate members)
+
+ (#synthesis.Reference reference)
+ (//reference.reference reference)
+
+ (^ (synthesis.branch/case case))
+ (//case.case translate case)
+
+ (^ (synthesis.branch/let let))
+ (//case.let translate let)
+
+ (^ (synthesis.branch/if if))
+ (//case.if translate if)
+
+ (^ (synthesis.loop/scope scope))
+ (//loop.scope translate scope)
+
+ (^ (synthesis.loop/recur updates))
+ (//loop.recur translate updates)
+
+ (^ (synthesis.function/abstraction abstraction))
+ (//function.function translate abstraction)
+
+ (^ (synthesis.function/apply application))
+ (//function.apply translate application)))