aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/common.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/common.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/common.jvm.lux74
1 files changed, 37 insertions, 37 deletions
diff --git a/new-luxc/source/luxc/lang/translation/common.jvm.lux b/new-luxc/source/luxc/lang/translation/common.jvm.lux
index 7a16a749a..b75b0672b 100644
--- a/new-luxc/source/luxc/lang/translation/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/common.jvm.lux
@@ -1,4 +1,4 @@
-(;module:
+(.module:
[lux #- function]
(lux (control ["ex" exception #+ exception:])
[io]
@@ -10,22 +10,22 @@
[host]
(world [blob #+ Blob]
[file #+ File]))
- (luxc (lang [";L" variable #+ Register]
+ (luxc (lang [".L" variable #+ Register]
(host ["$" jvm]
(jvm ["$t" type]
["$d" def]
["$i" inst])))))
-(host;import org.objectweb.asm.Opcodes
+(host.import org/objectweb/asm/Opcodes
(#static V1_6 int))
-(host;import org.objectweb.asm.Label)
+(host.import org/objectweb/asm/Label)
-(host;import java.lang.Object)
+(host.import java/lang/Object)
-(host;import (java.lang.Class a))
+(host.import (java/lang/Class a))
-(host;import java.lang.ClassLoader
+(host.import java/lang/ClassLoader
(loadClass [String] (Class Object)))
(type: #export Bytecode Blob)
@@ -48,57 +48,57 @@
(def: #export (with-artifacts action)
(All [a] (-> (Meta a) (Meta [Artifacts a])))
- (;function [compiler]
- (case (action (update@ #;host
- (|>. (:! Host)
- (set@ #artifacts (dict;new text;Hash<Text>))
+ (.function [compiler]
+ (case (action (update@ #.host
+ (|>> (:! Host)
+ (set@ #artifacts (dict.new text.Hash<Text>))
(:! Void))
compiler))
- (#e;Success [compiler' output])
- (#e;Success [(update@ #;host
- (|>. (:! Host)
- (set@ #artifacts (|> (get@ #;host compiler) (:! Host) (get@ #artifacts)))
+ (#e.Success [compiler' output])
+ (#e.Success [(update@ #.host
+ (|>> (:! Host)
+ (set@ #artifacts (|> (get@ #.host compiler) (:! Host) (get@ #artifacts)))
(:! Void))
compiler')
- [(|> compiler' (get@ #;host) (:! Host) (get@ #artifacts))
+ [(|> compiler' (get@ #.host) (:! Host) (get@ #artifacts))
output]])
- (#e;Error error)
- (#e;Error error))))
+ (#e.Error error)
+ (#e.Error error))))
(def: #export (record-artifact name content)
(-> Text Blob (Meta Unit))
- (;function [compiler]
- (if (|> compiler (get@ #;host) (:! Host) (get@ #artifacts) (dict;contains? name))
- (ex;throw Cannot-Overwrite-Artifact name)
- (#e;Success [(update@ #;host
- (|>. (:! Host)
- (update@ #artifacts (dict;put name content))
+ (.function [compiler]
+ (if (|> compiler (get@ #.host) (:! Host) (get@ #artifacts) (dict.contains? name))
+ (ex.throw Cannot-Overwrite-Artifact name)
+ (#e.Success [(update@ #.host
+ (|>> (:! Host)
+ (update@ #artifacts (dict.put name content))
(:! Void))
compiler)
[]]))))
(def: #export (store-class name byte-code)
(-> Text Bytecode (Meta Unit))
- (;function [compiler]
- (let [store (|> (get@ #;host compiler)
+ (.function [compiler]
+ (let [store (|> (get@ #.host compiler)
(:! Host)
(get@ #store))]
- (if (dict;contains? name (|> store atom;read io;run))
- (ex;throw Class-Already-Stored name)
- (#e;Success [compiler (io;run (atom;update (dict;put name byte-code) store))])
+ (if (dict.contains? name (|> store atom.read io.run))
+ (ex.throw Class-Already-Stored name)
+ (#e.Success [compiler (io.run (atom.update (dict.put name byte-code) store))])
))))
(def: #export (load-class name)
(-> Text (Meta (Class Object)))
- (;function [compiler]
- (let [host (:! Host (get@ #;host compiler))
- store (|> host (get@ #store) atom;read io;run)]
- (if (dict;contains? name store)
- (#e;Success [compiler (ClassLoader.loadClass [name] (get@ #loader host))])
- (ex;throw Unknown-Class name)))))
+ (.function [compiler]
+ (let [host (:! Host (get@ #.host compiler))
+ store (|> host (get@ #store) atom.read io.run)]
+ (if (dict.contains? name store)
+ (#e.Success [compiler (ClassLoader::loadClass [name] (get@ #loader host))])
+ (ex.throw Unknown-Class name)))))
-(def: #export bytecode-version Int Opcodes.V1_6)
+## (def: #export bytecode-version Int Opcodes::V1_6)
(def: #export value-field Text "_value")
-(def: #export $Object $;Type ($t;class "java.lang.Object" (list)))
+(def: #export $Object $.Type ($t.class "java.lang.Object" (list)))