aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-04-08 20:39:39 -0400
committerEduardo Julian2019-04-08 20:39:39 -0400
commit0e8ad54e4b9a285a213478232d0155466854225b (patch)
tree421a72647be1fa2cea429dc1018c4f23ed8bda11 /new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux
parentd4ded2084127fd8953d2889d72bab889213000a1 (diff)
Moved Ruby back-end code to stdlib.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux35
1 files changed, 0 insertions, 35 deletions
diff --git a/new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux
deleted file mode 100644
index 3c2124565..000000000
--- a/new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux
+++ /dev/null
@@ -1,35 +0,0 @@
-(.module:
- lux
- (lux (control [monad #+ do])
- (data [text]
- text/format
- (coll [list "list/" Functor<List>]))
- [macro])
- (luxc [lang]
- (lang ["ls" synthesis]
- (host [ruby #+ Ruby Expression Statement])))
- [//]
- (// [".T" reference]))
-
-(def: #export (translate-loop translate offset initsS+ bodyS)
- (-> (-> ls.Synthesis (Meta Expression)) Nat (List ls.Synthesis) ls.Synthesis
- (Meta Expression))
- (do macro.Monad<Meta>
- [loop-name (:: @ map (|>> %code lang.normalize-name)
- (macro.gensym "loop"))
- initsO+ (monad.map @ translate initsS+)
- bodyO (//.with-anchor [loop-name offset]
- (translate bodyS))
- #let [registersO+ (|> (list.n/range +0 (dec (list.size initsS+)))
- (list/map (|>> (n/+ offset) referenceT.variable)))]
- _ (//.save (ruby.function! loop-name registersO+
- (ruby.return! bodyO)))]
- (wrap (ruby.apply loop-name initsO+))))
-
-(def: #export (translate-recur translate argsS+)
- (-> (-> ls.Synthesis (Meta Expression)) (List ls.Synthesis)
- (Meta Expression))
- (do macro.Monad<Meta>
- [[loop-name offset] //.anchor
- argsO+ (monad.map @ translate argsS+)]
- (wrap (ruby.apply loop-name argsO+))))