aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/generator/eval.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-11-01 00:51:45 -0400
committerEduardo Julian2017-11-01 00:51:45 -0400
commit012f6bd41e527479dddbccbdab10daa78fd9a0fd (patch)
tree621f344a09acd52736f343d94582b3f1a2f0c5f9 /new-luxc/source/luxc/generator/eval.jvm.lux
parent71d7a4c7206155e09f3e1e1d8699561ea6967382 (diff)
- Re-organized code-generation, and re-named it "translation".
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))))))