aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler
diff options
context:
space:
mode:
authorEduardo Julian2022-03-14 17:03:38 -0400
committerEduardo Julian2022-03-14 17:03:38 -0400
commit62299ecdc93b39f6a22b1f89779f55dfa735fb3c (patch)
tree5456440c78bbdb1cd51e9156a7cd47ebf73b7edd /stdlib/source/library/lux/tool/compiler
parent792f88d0640831f426728b41d62d94fdcc4959d3 (diff)
Made JVM "import:" syntax consistent with the other "import:"s.
Diffstat (limited to 'stdlib/source/library/lux/tool/compiler')
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux106
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux3
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux15
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux78
5 files changed, 107 insertions, 99 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
index ea13344ed..18e485a46 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
@@ -81,70 +81,73 @@
[module
[descriptor {"+" Module}]]]]]]]]])
-(import: java/lang/ClassLoader)
+(import: java/lang/ClassLoader
+ "[1]::[0]")
(import: java/lang/Object
- ["[1]::[0]"
- (equals [java/lang/Object] boolean)])
+ "[1]::[0]"
+ (equals [java/lang/Object] boolean))
-(import: java/lang/reflect/Type)
+(import: java/lang/reflect/Type
+ "[1]::[0]")
(import: (java/lang/reflect/TypeVariable d)
- ["[1]::[0]"
- (getName [] java/lang/String)
- (getBounds [] [java/lang/reflect/Type])])
+ "[1]::[0]"
+ (getName [] java/lang/String)
+ (getBounds [] [java/lang/reflect/Type]))
(import: java/lang/reflect/Modifier
- ["[1]::[0]"
- ("static" isStatic [int] boolean)
- ("static" isFinal [int] boolean)
- ("static" isInterface [int] boolean)
- ("static" isAbstract [int] boolean)
- ("static" isPublic [int] boolean)
- ("static" isProtected [int] boolean)])
+ "[1]::[0]"
+ ("static" isStatic [int] boolean)
+ ("static" isFinal [int] boolean)
+ ("static" isInterface [int] boolean)
+ ("static" isAbstract [int] boolean)
+ ("static" isPublic [int] boolean)
+ ("static" isProtected [int] boolean))
-(import: java/lang/annotation/Annotation)
+(import: java/lang/annotation/Annotation
+ "[1]::[0]")
(import: java/lang/reflect/Method
- ["[1]::[0]"
- (getName [] java/lang/String)
- (getModifiers [] int)
- (getDeclaringClass [] (java/lang/Class java/lang/Object))
- (getTypeParameters [] [(java/lang/reflect/TypeVariable java/lang/reflect/Method)])
- (getGenericParameterTypes [] [java/lang/reflect/Type])
- (getDeclaredAnnotations [] [java/lang/annotation/Annotation])
-
- (getReturnType [] (java/lang/Class java/lang/Object))
- (getGenericReturnType [] "?" java/lang/reflect/Type)
-
- (getExceptionTypes [] [(java/lang/Class java/lang/Object)])
- (getGenericExceptionTypes [] [java/lang/reflect/Type])])
+ "[1]::[0]"
+ (getName [] java/lang/String)
+ (getModifiers [] int)
+ (getDeclaringClass [] (java/lang/Class java/lang/Object))
+ (getTypeParameters [] [(java/lang/reflect/TypeVariable java/lang/reflect/Method)])
+ (getGenericParameterTypes [] [java/lang/reflect/Type])
+ (getDeclaredAnnotations [] [java/lang/annotation/Annotation])
+
+ (getReturnType [] (java/lang/Class java/lang/Object))
+ (getGenericReturnType [] "?" java/lang/reflect/Type)
+
+ (getExceptionTypes [] [(java/lang/Class java/lang/Object)])
+ (getGenericExceptionTypes [] [java/lang/reflect/Type]))
(import: (java/lang/reflect/Constructor c)
- ["[1]::[0]"
- (getModifiers [] int)
- (getDeclaringClass [] (java/lang/Class c))
- (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/reflect/Constructor c))])
- (getGenericParameterTypes [] [java/lang/reflect/Type])
- (getExceptionTypes [] [(java/lang/Class java/lang/Object)])
- (getGenericExceptionTypes [] [java/lang/reflect/Type])
- (getDeclaredAnnotations [] [java/lang/annotation/Annotation])])
+ "[1]::[0]"
+ (getModifiers [] int)
+ (getDeclaringClass [] (java/lang/Class c))
+ (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/reflect/Constructor c))])
+ (getGenericParameterTypes [] [java/lang/reflect/Type])
+ (getExceptionTypes [] [(java/lang/Class java/lang/Object)])
+ (getGenericExceptionTypes [] [java/lang/reflect/Type])
+ (getDeclaredAnnotations [] [java/lang/annotation/Annotation]))
(import: (java/lang/Class c)
- ["[1]::[0]"
- ("static" forName [java/lang/String] "try" (java/lang/Class java/lang/Object))
- (getName [] java/lang/String)
- (getModifiers [] int)
- (isAssignableFrom [(java/lang/Class java/lang/Object)] boolean)
- (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/Class c))])
- (getGenericInterfaces [] [java/lang/reflect/Type])
- (getGenericSuperclass [] "?" java/lang/reflect/Type)
- (getDeclaredField [java/lang/String] "try" java/lang/reflect/Field)
- (getConstructors [] [(java/lang/reflect/Constructor java/lang/Object)])
- (getDeclaredMethods [] [java/lang/reflect/Method])
- (getDeclaredAnnotations [] [java/lang/annotation/Annotation])
- (getSuperclass [] "?" (java/lang/Class java/lang/Object))
- (getInterfaces [] [(java/lang/Class java/lang/Object)])])
+ "[1]::[0]"
+ ("static" forName [java/lang/String] "try" (java/lang/Class java/lang/Object))
+ (getName [] java/lang/String)
+ (getModifiers [] int)
+ (isAssignableFrom [(java/lang/Class java/lang/Object)] boolean)
+ (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/Class c))])
+ (getGenericInterfaces [] [java/lang/reflect/Type])
+ (getGenericSuperclass [] "?" java/lang/reflect/Type)
+ (getDeclaredField [java/lang/String] "try" java/lang/reflect/Field)
+ (getConstructors [] [(java/lang/reflect/Constructor java/lang/Object)])
+ (getDeclaredMethods [] [java/lang/reflect/Method])
+ (getDeclaredAnnotations [] [java/lang/annotation/Annotation])
+ (getSuperclass [] "?" (java/lang/Class java/lang/Object))
+ (getInterfaces [] [(java/lang/Class java/lang/Object)]))
(template [<name>]
[(exception: .public (<name> [class External
@@ -551,7 +554,8 @@
{.#None}
(in (jvm.class ..object_class (list)))))
- {.#Ex id}
+ (^or {.#Ex id}
+ {.#Parameter id})
(phase#in (jvm.class ..object_class (list)))
(^template [<tag>]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
index a69d511f3..8c314121a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
@@ -961,7 +961,8 @@
_ (generation.log! (format "JVM Interface " (%.text name)))]
(in directive.no_requirements))))]))
-(import: java/lang/ClassLoader)
+(import: java/lang/ClassLoader
+ "[1]::[0]")
(def: .public (bundle class_loader extender)
(-> java/lang/ClassLoader Extender (Bundle Anchor (Bytecode Any) Definition))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux
index d4c947953..dc3e63e85 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux
@@ -49,18 +49,19 @@
)
(import: java/lang/reflect/Field
- ["[1]::[0]"
- (get ["?" java/lang/Object] "try" "?" java/lang/Object)])
+ "[1]::[0]"
+ (get ["?" java/lang/Object] "try" "?" java/lang/Object))
(import: (java/lang/Class a)
- ["[1]::[0]"
- (getField [java/lang/String] "try" java/lang/reflect/Field)])
+ "[1]::[0]"
+ (getField [java/lang/String] "try" java/lang/reflect/Field))
(import: java/lang/Object
- ["[1]::[0]"
- (getClass [] (java/lang/Class java/lang/Object))])
+ "[1]::[0]"
+ (getClass [] (java/lang/Class java/lang/Object)))
-(import: java/lang/ClassLoader)
+(import: java/lang/ClassLoader
+ "[1]::[0]")
(def: value::modifier ($_ modifier#composite field.public field.final field.static))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux
index 27cba044c..c1b79618b 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux
@@ -79,8 +79,8 @@
(_.invokestatic $Double "valueOf" (type.method [(list) (list type.double) $Double (list)])))
(import: java/lang/Double
- ["[1]::[0]"
- ("static" doubleToRawLongBits "manual" [double] int)])
+ "[1]::[0]"
+ ("static" doubleToRawLongBits "manual" [double] int))
(def: d0_bits
Int
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux
index 4e1c841b5..1e27186b1 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux
@@ -48,73 +48,75 @@
[jvm
["[0]" runtime {"+" Definition}]]]]]]]]])
-(import: java/lang/Object)
+(import: java/lang/Object
+ "[1]::[0]")
-(import: java/lang/String)
+(import: java/lang/String
+ "[1]::[0]")
(import: java/util/jar/Attributes
- ["[1]::[0]"
- (put [java/lang/Object java/lang/Object] "?" java/lang/Object)])
+ "[1]::[0]"
+ (put [java/lang/Object java/lang/Object] "?" java/lang/Object))
(import: java/util/jar/Attributes$Name
- ["[1]::[0]"
- ("static" MAIN_CLASS java/util/jar/Attributes$Name)
- ("static" MANIFEST_VERSION java/util/jar/Attributes$Name)])
+ "[1]::[0]"
+ ("static" MAIN_CLASS java/util/jar/Attributes$Name)
+ ("static" MANIFEST_VERSION java/util/jar/Attributes$Name))
(import: java/util/jar/Manifest
- ["[1]::[0]"
- (new [])
- (getMainAttributes [] java/util/jar/Attributes)])
+ "[1]::[0]"
+ (new [])
+ (getMainAttributes [] java/util/jar/Attributes))
(import: java/io/Flushable
- ["[1]::[0]"
- (flush [] void)])
+ "[1]::[0]"
+ (flush [] void))
(import: java/io/Closeable
- ["[1]::[0]"
- (close [] void)])
+ "[1]::[0]"
+ (close [] void))
(import: java/io/OutputStream
- ["[1]::[0]"
- (write [[byte] int int] void)])
+ "[1]::[0]"
+ (write [[byte] int int] void))
(import: java/io/ByteArrayOutputStream
- ["[1]::[0]"
- (new [int])
- (toByteArray [] [byte])])
+ "[1]::[0]"
+ (new [int])
+ (toByteArray [] [byte]))
(import: java/util/zip/ZipEntry
- ["[1]::[0]"
- (getName [] java/lang/String)
- (isDirectory [] boolean)
- (getSize [] long)])
+ "[1]::[0]"
+ (getName [] java/lang/String)
+ (isDirectory [] boolean)
+ (getSize [] long))
(import: java/util/zip/ZipOutputStream
- ["[1]::[0]"
- (write [[byte] int int] void)
- (closeEntry [] void)])
+ "[1]::[0]"
+ (write [[byte] int int] void)
+ (closeEntry [] void))
(import: java/util/jar/JarEntry
- ["[1]::[0]"
- (new [java/lang/String])])
+ "[1]::[0]"
+ (new [java/lang/String]))
(import: java/util/jar/JarOutputStream
- ["[1]::[0]"
- (new [java/io/OutputStream java/util/jar/Manifest])
- (putNextEntry [java/util/zip/ZipEntry] "try" void)])
+ "[1]::[0]"
+ (new [java/io/OutputStream java/util/jar/Manifest])
+ (putNextEntry [java/util/zip/ZipEntry] "try" void))
(import: java/io/ByteArrayInputStream
- ["[1]::[0]"
- (new [[byte]])])
+ "[1]::[0]"
+ (new [[byte]]))
(import: java/io/InputStream
- ["[1]::[0]"
- (read [[byte] int int] int)])
+ "[1]::[0]"
+ (read [[byte] int int] int))
(import: java/util/jar/JarInputStream
- ["[1]::[0]"
- (new [java/io/InputStream])
- (getNextJarEntry [] "try" "?" java/util/jar/JarEntry)])
+ "[1]::[0]"
+ (new [java/io/InputStream])
+ (getNextJarEntry [] "try" "?" java/util/jar/JarEntry))
(def: byte
1)