diff options
author | Eduardo Julian | 2020-12-02 06:42:20 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-02 06:42:20 -0400 |
commit | 34e310622bdeb1d0588c0664c0e78cbaa84f837c (patch) | |
tree | eb7c04185b57c781f45d0ccdb955bc9afc2aa8dc /lux-jvm/source/luxc/lang/translation/jvm | |
parent | 982a19e0c5d57b53f9726b780fec4c18f0787b4f (diff) |
Re-named "::" and ":::" macros to "\" and "\\", to be consistent with the convention that only macros that deal with types may start with a colon.
Diffstat (limited to '')
6 files changed, 42 insertions, 33 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm.lux b/lux-jvm/source/luxc/lang/translation/jvm.lux index 30a130150..dce3017f5 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm.lux @@ -42,13 +42,16 @@ ) (import: java/lang/reflect/Field - (get [#? java/lang/Object] #try #? java/lang/Object)) + ["#::." + (get [#? java/lang/Object] #try #? java/lang/Object)]) (import: (java/lang/Class a) - (getField [java/lang/String] #try java/lang/reflect/Field)) + ["#::." + (getField [java/lang/String] #try java/lang/reflect/Field)]) (import: java/lang/Object - (getClass [] (java/lang/Class java/lang/Object))) + ["#::." + (getClass [] (java/lang/Class java/lang/Object))]) (import: java/lang/ClassLoader) @@ -124,7 +127,7 @@ (io.run (do (try.with io.monad) [_ (loader.store eval-class bytecode library) class (loader.load eval-class loader) - value (:: io.monad wrap (..class-value eval-class class))] + value (\ io.monad wrap (..class-value eval-class class))] (wrap [value [eval-class bytecode]]))))) @@ -132,7 +135,7 @@ (-> Library java/lang/ClassLoader Definition (Try Any)) (io.run (do (try.with io.monad) [existing-class? (|> (atom.read library) - (:: io.monad map (dictionary.contains? class-name)) + (\ io.monad map (dictionary.contains? class-name)) (try.lift io.monad) (: (IO (Try Bit)))) _ (if existing-class? @@ -153,8 +156,8 @@ (: Host (structure (def: (evaluate! context valueI) - (:: try.monad map product.left - (..evaluate! library loader context valueI))) + (\ try.monad map product.left + (..evaluate! library loader context valueI))) (def: execute! (..execute! library loader)) @@ -175,7 +178,7 @@ [#let [class-name (..class-name context)] _ (loader.store class-name bytecode library) class (loader.load class-name loader)] - (:: io.monad wrap (..class-value class-name class)))))))))) + (\ io.monad wrap (..class-value class-name class)))))))))) (def: #export $Variant (type.array ..$Value)) (def: #export $Tuple (type.array ..$Value)) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux index 0388c5c7f..e73ea068e 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux @@ -53,8 +53,9 @@ (phase.throw extension.invalid-syntax [extension-name %synthesis input])))) (import: java/lang/Double - (#static MIN_VALUE java/lang/Double) - (#static MAX_VALUE java/lang/Double)) + ["#::." + (#static MIN_VALUE java/lang/Double) + (#static MAX_VALUE java/lang/Double)]) (def: $String (type.class "java.lang.String" (list))) (def: $CharSequence (type.class "java.lang.CharSequence" (list))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux index 86b814bad..77f421703 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -956,20 +956,20 @@ _.ARETURN) (#.Right returnT) - (cond (or (:: type.equivalence = type.boolean returnT) - (:: type.equivalence = type.byte returnT) - (:: type.equivalence = type.short returnT) - (:: type.equivalence = type.int returnT) - (:: type.equivalence = type.char returnT)) + (cond (or (\ type.equivalence = type.boolean returnT) + (\ type.equivalence = type.byte returnT) + (\ type.equivalence = type.short returnT) + (\ type.equivalence = type.int returnT) + (\ type.equivalence = type.char returnT)) _.IRETURN - (:: type.equivalence = type.long returnT) + (\ type.equivalence = type.long returnT) _.LRETURN - (:: type.equivalence = type.float returnT) + (\ type.equivalence = type.float returnT) _.FRETURN - ## (:: type.equivalence = type.double returnT) + ## (\ type.equivalence = type.double returnT) _.DRETURN)))) (def: class::anonymous @@ -1038,7 +1038,7 @@ returnT exceptionsT]) (|>> bodyG (returnI returnT))))))) - (:: @ map _def.fuse)) + (\ @ map _def.fuse)) #let [directive [anonymous-class-name (_def.class #$.V1_6 #$.Public $.finalC anonymous-class-name (list) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux index 2e0aba43e..2d8bff828 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux @@ -23,12 +23,14 @@ (operation@wrap (_.GETSTATIC Boolean (if value "TRUE" "FALSE") Boolean))))) (import: java/lang/Byte - (#static MAX_VALUE byte) - (#static MIN_VALUE byte)) + ["#::." + (#static MAX_VALUE byte) + (#static MIN_VALUE byte)]) (import: java/lang/Short - (#static MAX_VALUE short) - (#static MIN_VALUE short)) + ["#::." + (#static MAX_VALUE short) + (#static MIN_VALUE short)]) (def: #export (i64 value) (-> (I64 Any) (Operation Inst)) @@ -64,7 +66,8 @@ (operation@wrap (|>> constantI (_.wrap type.long)))))) (import: java/lang/Double - (#static doubleToRawLongBits #manual [double] int)) + ["#::." + (#static doubleToRawLongBits #manual [double] int)]) (def: d0-bits Int diff --git a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux index 61eac8dcc..c7570d01a 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux @@ -38,8 +38,8 @@ (def: (foreign archive variable) (-> Archive Register (Operation Inst)) (do {@ phase.monad} - [class-name (:: @ map //.class-name - (generation.context archive))] + [class-name (\ @ map //.class-name + (generation.context archive))] (wrap (|>> (_.ALOAD 0) (_.GETFIELD (type.class class-name (list)) (|> variable .nat foreign-name) @@ -61,6 +61,6 @@ (def: #export (constant archive name) (-> Archive Name (Operation Inst)) (do {@ phase.monad} - [class-name (:: @ map //.class-name - (generation.remember archive name))] + [class-name (\ @ map //.class-name + (generation.remember archive name))] (wrap (_.GETSTATIC (type.class class-name (list)) //.value-field //.$Value)))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux index c268cb14a..d91ed3d14 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux @@ -55,18 +55,20 @@ (_.int (.int idx)) memberI _.AASTORE))))) - (:: @ map _.fuse))] + (\ @ map _.fuse))] (wrap (|>> (_.int (.int size)) (_.array //runtime.$Value) membersI)))) (import: java/lang/Byte - (#static MAX_VALUE byte) - (#static MIN_VALUE byte)) + ["#::." + (#static MAX_VALUE byte) + (#static MIN_VALUE byte)]) (import: java/lang/Short - (#static MAX_VALUE short) - (#static MIN_VALUE short)) + ["#::." + (#static MAX_VALUE short) + (#static MIN_VALUE short)]) (def: #export (tagI lefts right?) (-> Nat Bit Inst) |