aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/generator/reference.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-10-26 14:48:05 -0400
committerEduardo Julian2017-10-26 14:48:05 -0400
commit1fabe19f7eacb668ef26cccde681dce5e2f98072 (patch)
treead2ead4ae5d7f997353e7b8223aa29725df40111 /new-luxc/source/luxc/generator/reference.jvm.lux
parent40e9eae7468af9b03f6c684171d83a521dd90e82 (diff)
- WIP: Wiring everything to get the compiler to work fully.
- Fixed a bug when combining field/method/class modifiers.
Diffstat (limited to 'new-luxc/source/luxc/generator/reference.jvm.lux')
-rw-r--r--new-luxc/source/luxc/generator/reference.jvm.lux12
1 files changed, 8 insertions, 4 deletions
diff --git a/new-luxc/source/luxc/generator/reference.jvm.lux b/new-luxc/source/luxc/generator/reference.jvm.lux
index 063994bac..0e77b1819 100644
--- a/new-luxc/source/luxc/generator/reference.jvm.lux
+++ b/new-luxc/source/luxc/generator/reference.jvm.lux
@@ -3,15 +3,14 @@
(lux (control [monad #+ do])
(data text/format)
[meta "meta/" Monad<Meta>])
- (luxc (lang ["ls" synthesis])
+ (luxc ["&" base]
+ (lang ["ls" synthesis])
(generator [";G" common]
[";G" function]
(host ["$" jvm]
(jvm ["$t" type]
["$i" inst])))))
-(def: $Object $;Type ($t;class "java.lang.Object" (list)))
-
(def: #export (generate-captured variable)
(-> ls;Variable (Meta $;Inst))
(do meta;Monad<Meta>
@@ -19,8 +18,13 @@
(wrap (|>. ($i;ALOAD +0)
($i;GETFIELD function-class
(|> variable i.inc (i.* -1) int-to-nat functionG;captured)
- $Object)))))
+ commonG;$Object)))))
(def: #export (generate-variable variable)
(-> ls;Variable (Meta $;Inst))
(meta/wrap ($i;ALOAD (int-to-nat variable))))
+
+(def: #export (generate-definition [def-module def-name])
+ (-> Ident (Meta $;Inst))
+ (let [bytecode-name (format def-module "/" (&;normalize-name def-name))]
+ (meta/wrap ($i;GETSTATIC bytecode-name commonG;value-field commonG;$Object))))