aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm
diff options
context:
space:
mode:
authorEduardo Julian2022-01-09 05:35:12 -0400
committerEduardo Julian2022-01-09 05:35:12 -0400
commitb7873d4b68ffc041f9ff134c52a32b54c20febf9 (patch)
treeb4892c00eee2e57ebd763b646dc4a89796235000 /lux-jvm
parent54e219ee24c1508713d07473cd8a3b04c7f8fe18 (diff)
Fixed a bug when testing extensions on the JVM compiler.
Diffstat (limited to 'lux-jvm')
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/case.lux11
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/expression.lux3
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux6
3 files changed, 16 insertions, 4 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
index 0c9ad675f..94a3deb05 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
@@ -1,6 +1,6 @@
(.using
[library
- [lux {"-" Type Label Primitive if let case}
+ [lux {"-" Type Label Primitive if exec let case}
[abstract
["[0]" monad {"+" do}]]
[control
@@ -253,6 +253,15 @@
elseI
(_.label @end))))))
+(def: .public (exec phase archive [this that])
+ (Generator [Synthesis Synthesis])
+ (do phase.monad
+ [this! (phase archive this)
+ that! (phase archive that)]
+ (in (|>> this!
+ _.POP
+ that!))))
+
(def: .public (let phase archive [inputS register exprS])
(Generator [Synthesis Nat Synthesis])
(do phase.monad
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux
index c92212370..8749b2ef2 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux
@@ -47,6 +47,9 @@
(^ (synthesis.constant constant))
(reference.constant archive constant)
+ (^ (synthesis.branch/exec it))
+ (case.exec translate archive it)
+
(^ (synthesis.branch/let data))
(case.let translate archive data)
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
index 7048bdd25..17165b434 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -820,7 +820,7 @@
hidden
[_ {synthesis.#Control {synthesis.#Branch {synthesis.#Case _ path}}}]
- (loop [path path]
+ (loop [path (: synthesis.Path path)]
(case path
(^or {synthesis.#Pop}
{synthesis.#Access _}
@@ -908,8 +908,8 @@
(^template [<tag>]
[(^ <tag>)
body])
- ([{//////synthesis.#Primitive _}]
- [(//////synthesis.constant _)])
+ ([{synthesis.#Primitive _}]
+ [(synthesis.constant _)])
(^ (synthesis.variant [lefts right? sub]))
(synthesis.variant [lefts right? (again sub)])