aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/eval.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/eval.jvm.lux (renamed from new-luxc/source/luxc/generator/eval.jvm.lux)23
1 files changed, 11 insertions, 12 deletions
diff --git a/new-luxc/source/luxc/generator/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/eval.jvm.lux
index 2f0ce1c24..9514741f8 100644
--- a/new-luxc/source/luxc/generator/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/eval.jvm.lux
@@ -1,9 +1,8 @@
(;module:
lux
(lux (control monad)
- (data ["R" error]
- text/format)
- [meta #+ Monad<Meta> "Meta/" Monad<Meta>]
+ (data text/format)
+ [meta]
[host #+ do-to])
(luxc ["&" base]
(host ["$" jvm]
@@ -11,8 +10,8 @@
["$d" def]
["$i" inst]))
(lang ["la" analysis]
- ["ls" synthesis])
- (generator ["&;" common])
+ ["ls" synthesis]
+ (translation [";T" common]))
))
(host;import java.lang.Object)
@@ -56,26 +55,26 @@
(def: #export (eval valueI)
(-> $;Inst (Meta Top))
- (do Monad<Meta>
+ (do meta;Monad<Meta>
[class-name (:: @ map %code (meta;gensym "eval"))
#let [writer (|> (do-to (ClassWriter.new ClassWriter.COMPUTE_MAXS)
- (ClassWriter.visit [&common;bytecode-version
+ (ClassWriter.visit [commonT;bytecode-version
(i.+ Opcodes.ACC_PUBLIC Opcodes.ACC_SUPER)
class-name
(host;null)
"java/lang/Object"
(host;null)]))
($d;field #$;Public ($_ $;++F $;finalF $;staticF)
- &common;value-field &common;$Object)
+ commonT;value-field commonT;$Object)
($d;method #$;Public ($_ $;++M $;staticM $;strictM)
"<clinit>"
($t;method (list) #;None (list))
(|>. valueI
- ($i;PUTSTATIC class-name &common;value-field &common;$Object)
+ ($i;PUTSTATIC class-name commonT;value-field commonT;$Object)
$i;RETURN)))
bytecode (ClassWriter.toByteArray [] (do-to writer (ClassWriter.visitEnd [])))]
- _ (&common;store-class class-name bytecode)
- class (&common;load-class class-name)]
+ _ (commonT;store-class class-name bytecode)
+ class (commonT;load-class class-name)]
(wrap (|> class
- (Class.getField [&common;value-field])
+ (Class.getField [commonT;value-field])
(Field.get (host;null))))))