aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2019-08-20 22:26:23 -0400
committerEduardo Julian2019-08-20 22:26:23 -0400
commit74662caf09a43bf3057f89ea9f3f7c8163e09851 (patch)
tree4783df3475163298d76e59c1d2ac41fd10eea826
parent59ededb795732e04ac8e1eaceb2b1509a1c1cc23 (diff)
Renamed "lux/target/jvm/descriptor" to "lux/target/jvm/type/descriptor".
-rw-r--r--new-luxc/source/luxc/lang/host/jvm/def.lux4
-rw-r--r--new-luxc/source/luxc/lang/host/jvm/inst.lux4
-rw-r--r--new-luxc/source/luxc/lang/statement/jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm.lux3
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/case.lux3
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/function.lux3
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/primitive.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux3
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/reference.lux3
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/runtime.lux10
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/structure.lux4
-rw-r--r--stdlib/source/lux/target/jvm/type/descriptor.lux (renamed from stdlib/source/lux/target/jvm/descriptor.lux)22
13 files changed, 39 insertions, 32 deletions
diff --git a/new-luxc/source/luxc/lang/host/jvm/def.lux b/new-luxc/source/luxc/lang/host/jvm/def.lux
index 9abf0db35..b663b9b31 100644
--- a/new-luxc/source/luxc/lang/host/jvm/def.lux
+++ b/new-luxc/source/luxc/lang/host/jvm/def.lux
@@ -14,11 +14,11 @@
["." list ("#/." functor)]]]
[target
[jvm
- ["." descriptor (#+ Descriptor)]
[encoding
["." name]]
["$t" type (#+ Method Class Type Parameter)
- ["." reflection]]]]]
+ ["." reflection]
+ ["." descriptor (#+ Descriptor)]]]]]
["." //])
(import: #long java/lang/Object)
diff --git a/new-luxc/source/luxc/lang/host/jvm/inst.lux b/new-luxc/source/luxc/lang/host/jvm/inst.lux
index a54367a72..8d5bd3b6e 100644
--- a/new-luxc/source/luxc/lang/host/jvm/inst.lux
+++ b/new-luxc/source/luxc/lang/host/jvm/inst.lux
@@ -22,11 +22,11 @@
[syntax (#+ syntax:)]]
[target
[jvm
- ["." descriptor (#+ Descriptor Primitive) ("#@." equivalence)]
[encoding
["." name]]
[type
- ["." box]]]]
+ ["." box]
+ ["." descriptor (#+ Descriptor Primitive) ("#@." equivalence)]]]]
[tool
[compiler
[phase (#+ Operation)]]]]
diff --git a/new-luxc/source/luxc/lang/statement/jvm.lux b/new-luxc/source/luxc/lang/statement/jvm.lux
index 4ca0744db..bc0cd375e 100644
--- a/new-luxc/source/luxc/lang/statement/jvm.lux
+++ b/new-luxc/source/luxc/lang/statement/jvm.lux
@@ -16,9 +16,9 @@
["." check (#+ Check)]]
[target
[jvm
- ["." descriptor (#+ Descriptor)]
["." type (#+ Var Parameter Class Argument Typed Return)
- [".T" lux]]]]
+ [".T" lux]
+ ["." descriptor (#+ Descriptor)]]]]
[tool
[compiler
["." statement (#+ Handler Bundle)]
diff --git a/new-luxc/source/luxc/lang/translation/jvm.lux b/new-luxc/source/luxc/lang/translation/jvm.lux
index b56d285d2..7388e8c30 100644
--- a/new-luxc/source/luxc/lang/translation/jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm.lux
@@ -21,7 +21,8 @@
[target
[jvm
["." loader (#+ Library)]
- ["." descriptor]]]
+ [type
+ ["." descriptor]]]]
[tool
[compiler
["." name]]]]
diff --git a/new-luxc/source/luxc/lang/translation/jvm/case.lux b/new-luxc/source/luxc/lang/translation/jvm/case.lux
index 1f3129cd2..f57671f36 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/case.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/case.lux
@@ -10,7 +10,8 @@
["n" nat]]]
[target
[jvm
- ["." descriptor]]]
+ [type
+ ["." descriptor]]]]
[tool
[compiler
["." synthesis (#+ Path Synthesis)]
diff --git a/new-luxc/source/luxc/lang/translation/jvm/function.lux b/new-luxc/source/luxc/lang/translation/jvm/function.lux
index 5da2839cd..dca622efa 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/function.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/function.lux
@@ -13,7 +13,8 @@
["." list ("#@." functor monoid)]]]
[target
[jvm
- ["." descriptor (#+ Descriptor Class Method Value)]]]
+ [type
+ ["." descriptor (#+ Descriptor Class Method Value)]]]]
[tool
[compiler
[arity (#+ Arity)]
diff --git a/new-luxc/source/luxc/lang/translation/jvm/primitive.lux b/new-luxc/source/luxc/lang/translation/jvm/primitive.lux
index 6903b065d..d5f8d56cb 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/primitive.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/primitive.lux
@@ -2,8 +2,8 @@
[lux (#- i64)
[target
[jvm
- ["." descriptor]
- ["$t" type]]]
+ [type
+ ["." descriptor]]]]
[tool
[compiler
[phase ("operation@." monad)]]]]
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux
index dbf3a13be..6e7891460 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux
@@ -16,7 +16,8 @@
["." dictionary]]]
[target
[jvm
- ["." descriptor]]]
+ [type
+ ["." descriptor]]]]
[tool
[compiler
["." synthesis (#+ Synthesis %synthesis)]
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux
index 62fd37fdb..a51d1715b 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux
@@ -20,10 +20,10 @@
["." set]]]
[target
["." jvm #_
- ["." descriptor (#+ Descriptor Value Primitive Object Method)]
["#" type (#+ Bound Generic Class Var Typed Argument Return)
["." box]
- ["." reflection]]]]
+ ["." reflection]
+ ["." descriptor (#+ Descriptor Value Primitive Object Method)]]]]
[tool
[compiler
[analysis (#+ Environment)]
diff --git a/new-luxc/source/luxc/lang/translation/jvm/reference.lux b/new-luxc/source/luxc/lang/translation/jvm/reference.lux
index 8352c7d6f..1995fcd74 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/reference.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/reference.lux
@@ -7,7 +7,8 @@
["%" format (#+ format)]]]
[target
[jvm
- ["." descriptor]]]
+ [type
+ ["." descriptor]]]]
[tool
[compiler
["." name]
diff --git a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux
index 755ae7a3b..0f3a89faf 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux
@@ -4,12 +4,12 @@
[monad (#+ do)]]
[data
[collection
- ["." list ("#/." functor)]]]
+ ["." list ("#@." functor)]]]
["." math]
[target
[jvm
- ["." descriptor (#+ Descriptor)]
- ["$t" type]]]
+ [type
+ ["." descriptor (#+ Descriptor)]]]]
[tool
[compiler
[arity (#+ Arity)]
@@ -329,10 +329,10 @@
(def: translate-function
(Operation ByteCode)
(let [applyI (|> (list.n/range 2 num-apply-variants)
- (list/map (function (_ arity)
+ (list@map (function (_ arity)
($d.method #$.Public $.noneM apply-method (apply-signature arity)
(let [preI (|> (list.n/range 0 (dec arity))
- (list/map _.ALOAD)
+ (list@map _.ALOAD)
_.fuse)]
(|>> preI
(_.INVOKEVIRTUAL //.$Function apply-method (apply-signature (dec arity)) #0)
diff --git a/new-luxc/source/luxc/lang/translation/jvm/structure.lux b/new-luxc/source/luxc/lang/translation/jvm/structure.lux
index 92bf41256..e224f1f2f 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/structure.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/structure.lux
@@ -13,8 +13,8 @@
["." list]]]
[target
[jvm
- ["." descriptor]
- ["$t" type (#+ Type)]]]
+ [type
+ ["." descriptor]]]]
[tool
[compiler
[synthesis (#+ Synthesis)]
diff --git a/stdlib/source/lux/target/jvm/descriptor.lux b/stdlib/source/lux/target/jvm/type/descriptor.lux
index 5452c16c7..52b5037bc 100644
--- a/stdlib/source/lux/target/jvm/descriptor.lux
+++ b/stdlib/source/lux/target/jvm/type/descriptor.lux
@@ -14,7 +14,7 @@
["." template]]
[type
abstract]]
- ["." // #_
+ ["." /// #_
[encoding
["#." name (#+ External)]]])
@@ -70,8 +70,8 @@
(def: #export class
(-> External (Descriptor Class))
- (|>> //name.internal
- //name.read
+ (|>> ///name.internal
+ ///name.read
(text.enclose [..class-prefix ..class-suffix])
:abstraction))
@@ -102,7 +102,9 @@
(-> (Descriptor Any) Text)
(|>> :representation))
- (structure: #export equivalence (All [brand] (Equivalence (Descriptor brand)))
+ (structure: #export equivalence
+ (All [brand] (Equivalence (Descriptor brand)))
+
(def: (= parameter subject)
(text@= (:representation parameter) (:representation subject))))
@@ -123,17 +125,18 @@
(|> descriptor :transmutation #.Right)
(|> descriptor :transmutation #.Left)))
+ (def: binary-name (|>> ///name.internal ///name.external))
+
(def: #export (class? descriptor)
(-> (Descriptor Value) (Maybe Text))
(let [repr (:representation descriptor)]
(if (and (text.starts-with? ..class-prefix repr)
(text.ends-with? ..class-suffix repr))
- (:: maybe.monad map
- (|>> //name.internal //name.external)
+ (|> repr
(text.clip (text.size ..class-prefix)
(n.- (text.size ..class-suffix)
- (text.size repr))
- repr))
+ (text.size repr)))
+ (:: maybe.monad map ..binary-name))
#.None)))
(def: #export class-name
@@ -148,7 +151,6 @@
(text.clip prefix-size
(n.- suffix-size
(text.size repr)))
- (:: maybe.monad map
- (|>> //name.internal //name.external))
+ (:: maybe.monad map ..binary-name)
maybe.assume))))))
)