aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/generator/case.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-10-18 12:42:46 -0400
committerEduardo Julian2017-10-18 12:42:46 -0400
commit901b09dada43ec6f3b21618800ec7400fda54a0d (patch)
treed62dde3df2ce4fd7d7cd8d0b177f6592f87817cb /new-luxc/source/luxc/generator/case.jvm.lux
parent14e381de130f0c8d3e333cf0523c6c98b9aa84b1 (diff)
- Updated to the latest changes in stdlib.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/generator/case.jvm.lux76
1 files changed, 38 insertions, 38 deletions
diff --git a/new-luxc/source/luxc/generator/case.jvm.lux b/new-luxc/source/luxc/generator/case.jvm.lux
index 88b3dd5d3..53912f5d0 100644
--- a/new-luxc/source/luxc/generator/case.jvm.lux
+++ b/new-luxc/source/luxc/generator/case.jvm.lux
@@ -1,7 +1,7 @@
(;module:
lux
(lux (control [monad #+ do])
- [macro "lux/" Monad<Lux>])
+ [meta "meta/" Monad<Meta>])
(luxc (lang ["ls" synthesis])
(generator [expr]
(host ["$" jvm]
@@ -50,60 +50,60 @@
false)))
(def: (generate-pattern' stack-depth @else @end path)
- (-> Nat $;Label $;Label ls;Path (Lux $;Inst))
+ (-> Nat $;Label $;Label ls;Path (Meta $;Inst))
(case path
(#ls;ExecP bodyS)
- (do macro;Monad<Lux>
+ (do meta;Monad<Meta>
[bodyI (expr;generate bodyS)]
(wrap (|>. (pop-altI stack-depth)
bodyI
($i;GOTO @end))))
#ls;UnitP
- (lux/wrap popI)
+ (meta/wrap popI)
(#ls;BindP register)
- (lux/wrap (|>. peekI
- ($i;ASTORE register)
- popI))
+ (meta/wrap (|>. peekI
+ ($i;ASTORE register)
+ popI))
(#ls;BoolP value)
- (lux/wrap (let [jumpI (if value $i;IFEQ $i;IFNE)]
- (|>. peekI
- ($i;unwrap #$;Boolean)
- (jumpI @else))))
+ (meta/wrap (let [jumpI (if value $i;IFEQ $i;IFNE)]
+ (|>. peekI
+ ($i;unwrap #$;Boolean)
+ (jumpI @else))))
(^template [<tag> <prep>]
(<tag> value)
- (lux/wrap (|>. peekI
- ($i;unwrap #$;Long)
- ($i;long (|> value <prep>))
- $i;LCMP
- ($i;IFNE @else))))
+ (meta/wrap (|>. peekI
+ ($i;unwrap #$;Long)
+ ($i;long (|> value <prep>))
+ $i;LCMP
+ ($i;IFNE @else))))
([#ls;NatP (:! Int)]
[#ls;IntP (: Int)]
[#ls;DegP (:! Int)])
(#ls;FracP value)
- (lux/wrap (|>. peekI
- ($i;unwrap #$;Double)
- ($i;double value)
- $i;DCMPL
- ($i;IFNE @else)))
+ (meta/wrap (|>. peekI
+ ($i;unwrap #$;Double)
+ ($i;double value)
+ $i;DCMPL
+ ($i;IFNE @else)))
(#ls;TextP value)
- (lux/wrap (|>. peekI
- ($i;string value)
- ($i;INVOKEVIRTUAL "java.lang.Object"
- "equals"
- ($t;method (list $Object)
- (#;Some $t;boolean)
- (list))
- false)
- ($i;IFEQ @else)))
+ (meta/wrap (|>. peekI
+ ($i;string value)
+ ($i;INVOKEVIRTUAL "java.lang.Object"
+ "equals"
+ ($t;method (list $Object)
+ (#;Some $t;boolean)
+ (list))
+ false)
+ ($i;IFEQ @else)))
(#ls;TupleP idx subP)
- (do macro;Monad<Lux>
+ (do meta;Monad<Meta>
[subI (generate-pattern' stack-depth @else @end subP)
#let [[idx tail?] (case idx
(#;Left idx)
@@ -134,7 +134,7 @@
subI))))
(#ls;VariantP idx subP)
- (do macro;Monad<Lux>
+ (do meta;Monad<Meta>
[subI (generate-pattern' stack-depth @else @end subP)
#let [[idx last?] (case idx
(#;Left idx)
@@ -167,14 +167,14 @@
subI))))
(#ls;SeqP leftP rightP)
- (do macro;Monad<Lux>
+ (do meta;Monad<Meta>
[leftI (generate-pattern' stack-depth @else @end leftP)
rightI (generate-pattern' stack-depth @else @end rightP)]
(wrap (|>. leftI
rightI)))
(#ls;AltP leftP rightP)
- (do macro;Monad<Lux>
+ (do meta;Monad<Meta>
[@alt-else $i;make-label
leftI (generate-pattern' (n.inc stack-depth) @alt-else @end leftP)
rightI (generate-pattern' stack-depth @else @end rightP)]
@@ -186,8 +186,8 @@
))
(def: (generate-pattern path @end)
- (-> ls;Path $;Label (Lux $;Inst))
- (do macro;Monad<Lux>
+ (-> ls;Path $;Label (Meta $;Inst))
+ (do meta;Monad<Meta>
[@else $i;make-label
pathI (generate-pattern' +1 @else @end path)]
(wrap (|>. pathI
@@ -201,8 +201,8 @@
($i;GOTO @end)))))
(def: #export (generate valueS path)
- (-> ls;Synthesis ls;Path (Lux $;Inst))
- (do macro;Monad<Lux>
+ (-> ls;Synthesis ls;Path (Meta $;Inst))
+ (do meta;Monad<Meta>
[@end $i;make-label
valueI (expr;generate valueS)
pathI (generate-pattern path @end)]