aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/target/jvm/type
diff options
context:
space:
mode:
authorEduardo Julian2022-01-19 22:30:05 -0400
committerEduardo Julian2022-01-19 22:30:05 -0400
commitc98d05fcb43714dc7e2ce07ab3fa17b78f21b3bf (patch)
tree99704fb276b197d2b3295fc1304f3f493828556d /stdlib/source/library/lux/target/jvm/type
parente3dc47dafccb1d21a5c162e4329afd72ddb00650 (diff)
Fixes for the pure-Lux JVM compiler machinery. [Part 9]
Diffstat (limited to 'stdlib/source/library/lux/target/jvm/type')
-rw-r--r--stdlib/source/library/lux/target/jvm/type/parser.lux12
-rw-r--r--stdlib/source/library/lux/target/jvm/type/signature.lux12
2 files changed, 18 insertions, 6 deletions
diff --git a/stdlib/source/library/lux/target/jvm/type/parser.lux b/stdlib/source/library/lux/target/jvm/type/parser.lux
index 5aa5fc3f1..76289b082 100644
--- a/stdlib/source/library/lux/target/jvm/type/parser.lux
+++ b/stdlib/source/library/lux/target/jvm/type/parser.lux
@@ -200,9 +200,17 @@
(def: exception
(Parser (Type Class))
- (|> (..class' ..parameter)
+ (|> ..class
(<>.after (<text>.this //signature.exception_prefix))))
+(def: .public var_declaration
+ (Parser [(Type Var) (Type Class)])
+ (do <>.monad
+ [name ..var_name
+ _ (<text>.this //signature.format_type_parameter_infix)
+ type ..class]
+ (in [(//.var name) type])))
+
(def: .public method
(-> (Type Method)
[(List (Type Var))
@@ -214,7 +222,7 @@
(Type Return)
(List (Type Class))])
($_ <>.and
- (|> (<>.some ..var)
+ (|> (<>.some (<>#each product.left ..var_declaration))
(<>.after (<text>.this //signature.parameters_start))
(<>.before (<text>.this //signature.parameters_end))
(<>.else (list)))
diff --git a/stdlib/source/library/lux/target/jvm/type/signature.lux b/stdlib/source/library/lux/target/jvm/type/signature.lux
index b19087691..f38e433b5 100644
--- a/stdlib/source/library/lux/target/jvm/type/signature.lux
+++ b/stdlib/source/library/lux/target/jvm/type/signature.lux
@@ -109,15 +109,19 @@
(-> (Signature Declaration) (Signature Class))
(|>> :transmutation))
- (def: .public arguments_start "(")
- (def: .public arguments_end ")")
+ (template [<char> <name>]
+ [(def: .public <name> <char>)]
- (def: .public exception_prefix "^")
+ ["(" arguments_start]
+ [")" arguments_end]
+ ["^" exception_prefix]
+ [":" format_type_parameter_infix]
+ )
(def: class_bound
(|> (..class "java.lang.Object" (list))
..signature
- (format ":")))
+ (format ..format_type_parameter_infix)))
(def: .public (method [type_variables inputs output exceptions])
(-> [(List (Signature Var))