aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/case.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/case.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/case.jvm.lux12
1 files changed, 12 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/lang/translation/case.jvm.lux b/new-luxc/source/luxc/lang/translation/case.jvm.lux
index 09ffae328..3e05ba334 100644
--- a/new-luxc/source/luxc/lang/translation/case.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/case.jvm.lux
@@ -199,6 +199,18 @@
$i;NULL
($i;GOTO @end)))))
+(def: #export (translate-if testI thenI elseI)
+ (-> $;Inst $;Inst $;Inst $;Inst)
+ (<| $i;with-label (function [@else])
+ $i;with-label (function [@end])
+ (|>. testI
+ ($i;IFEQ @else)
+ thenI
+ ($i;GOTO @end)
+ ($i;label @else)
+ elseI
+ ($i;label @end))))
+
(def: #export (translate-case translate valueS path)
(-> (-> ls;Synthesis (Meta $;Inst))
ls;Synthesis ls;Path (Meta $;Inst))