aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/r
diff options
context:
space:
mode:
authorEduardo Julian2017-11-01 13:36:15 -0400
committerEduardo Julian2017-11-01 13:36:15 -0400
commit88006e957373bbd72ec68897474303964885fc68 (patch)
treea34f88ea0921f56737c8881345245e11e7c8b546 /new-luxc/source/luxc/lang/translation/r
parent012f6bd41e527479dddbccbdab10daa78fd9a0fd (diff)
- Minor refactorings.
- Fixed some bugs. - Enabled macro-expansion for statements.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/reference.jvm.lux6
-rw-r--r--new-luxc/source/luxc/lang/translation/runtime.jvm.lux16
2 files changed, 11 insertions, 11 deletions
diff --git a/new-luxc/source/luxc/lang/translation/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/reference.jvm.lux
index 7c42f9f08..da86dd5b9 100644
--- a/new-luxc/source/luxc/lang/translation/reference.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/reference.jvm.lux
@@ -12,7 +12,7 @@
(translation [";T" common]
[";T" function]))))
-(def: #export (generate-captured variable)
+(def: #export (translate-captured variable)
(-> Variable (Meta $;Inst))
(do meta;Monad<Meta>
[function-class commonT;function]
@@ -21,11 +21,11 @@
(|> variable i.inc (i.* -1) int-to-nat functionT;captured)
commonT;$Object)))))
-(def: #export (generate-variable variable)
+(def: #export (translate-variable variable)
(-> Variable (Meta $;Inst))
(meta/wrap ($i;ALOAD (int-to-nat variable))))
-(def: #export (generate-definition [def-module def-name])
+(def: #export (translate-definition [def-module def-name])
(-> Ident (Meta $;Inst))
(let [bytecode-name (format def-module "/" (&;normalize-name def-name))]
(meta/wrap ($i;GETSTATIC bytecode-name commonT;value-field commonT;$Object))))
diff --git a/new-luxc/source/luxc/lang/translation/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/runtime.jvm.lux
index e5d237fc7..0a330ab73 100644
--- a/new-luxc/source/luxc/lang/translation/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/runtime.jvm.lux
@@ -449,7 +449,7 @@
$i;ARETURN)
update-tagI (|>. $i;ISUB ($i;ISTORE +1))
update-variantI (|>. ($i;ALOAD +0) datumI ($i;CHECKCAST ($t;descriptor $Variant)) ($i;ASTORE +0))
- wrongI (|>. $i;NULL $i;ARETURN)
+ failureI (|>. $i;NULL $i;ARETURN)
return-datumI (|>. ($i;ALOAD +0) datumI $i;ARETURN)])
(|>. ($i;label @begin)
($i;ILOAD +1) ## tag
@@ -458,7 +458,7 @@
$i;DUP2 ($i;IF_ICMPGT @further)
$i;DUP2 ($i;IF_ICMPLT @shorten)
## $i;POP2
- wrongI
+ failureI
($i;label @then) ## tag, sumT
($i;ALOAD +2) ## tag, sumT, wants-last?
($i;ALOAD +0) flagI ## tag, sumT, wants-last?, is-last?
@@ -478,7 +478,7 @@
shortenI
($i;label @wrong) ## tag, sumT
## $i;POP2
- wrongI)))
+ failureI)))
($d;method #$;Public $;staticM "pm_left" ($t;method (list $Tuple $t;int) (#;Some $Object) (list))
(<| $i;with-label (function [@begin])
$i;with-label (function [@not-recursive])
@@ -555,7 +555,7 @@
$i;ARETURN)))
)))
-(def: generate-runtime
+(def: translate-runtime
(Meta commonT;Bytecode)
(do meta;Monad<Meta>
[_ (wrap [])
@@ -569,7 +569,7 @@
_ (commonT;store-class hostL;runtime-class bytecode)]
(wrap bytecode)))
-(def: generate-function
+(def: translate-function
(Meta commonT;Bytecode)
(do meta;Monad<Meta>
[_ (wrap [])
@@ -600,9 +600,9 @@
_ (commonT;store-class hostL;function-class bytecode)]
(wrap bytecode)))
-(def: #export generate
+(def: #export translate
(Meta [commonT;Bytecode commonT;Bytecode])
(do meta;Monad<Meta>
- [runtime-bc generate-runtime
- function-bc generate-function]
+ [runtime-bc translate-runtime
+ function-bc translate-function]
(wrap [runtime-bc function-bc])))