From 4433c9bcd6c6cac44c018aad2e21a5b4d7cc4896 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 29 Nov 2017 22:49:56 -0400 Subject: - Adapted main codebase to the latest syntatic changes. --- new-luxc/source/luxc/lang/host/jvm/type.lux | 148 ++++++++++++++-------------- 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'new-luxc/source/luxc/lang/host/jvm/type.lux') diff --git a/new-luxc/source/luxc/lang/host/jvm/type.lux b/new-luxc/source/luxc/lang/host/jvm/type.lux index 03246540c..b29ffc4a0 100644 --- a/new-luxc/source/luxc/lang/host/jvm/type.lux +++ b/new-luxc/source/luxc/lang/host/jvm/type.lux @@ -1,4 +1,4 @@ -(;module: +(.module: [lux #- char] (lux (data [text] text/format @@ -7,132 +7,132 @@ ## Types (do-template [ ] - [(def: #export $;Type (#$;Primitive ))] - - [boolean #$;Boolean] - [byte #$;Byte] - [short #$;Short] - [int #$;Int] - [long #$;Long] - [float #$;Float] - [double #$;Double] - [char #$;Char] + [(def: #export $.Type (#$.Primitive ))] + + [boolean #$.Boolean] + [byte #$.Byte] + [short #$.Short] + [int #$.Int] + [long #$.Long] + [float #$.Float] + [double #$.Double] + [char #$.Char] ) (def: #export (class name params) - (-> Text (List $;Generic) $;Type) - (#$;Generic (#$;Class name params))) + (-> Text (List $.Generic) $.Type) + (#$.Generic (#$.Class name params))) (def: #export (var name) - (-> Text $;Type) - (#$;Generic (#$;Var name))) + (-> Text $.Type) + (#$.Generic (#$.Var name))) (def: #export (wildcard bound) - (-> (Maybe [$;Bound $;Generic]) $;Type) - (#$;Generic (#$;Wildcard bound))) + (-> (Maybe [$.Bound $.Generic]) $.Type) + (#$.Generic (#$.Wildcard bound))) (def: #export (array depth elemT) - (-> Nat $;Type $;Type) + (-> Nat $.Type $.Type) (case depth +0 elemT - _ (#$;Array (array (n.dec depth) elemT)))) + _ (#$.Array (array (n/dec depth) elemT)))) (def: #export (binary-name class) (-> Text Text) - (text;replace-all "." "/" class)) + (text.replace-all "." "/" class)) (def: #export (descriptor type) - (-> $;Type Text) + (-> $.Type Text) (case type - (#$;Primitive prim) + (#$.Primitive prim) (case prim - #$;Boolean "Z" - #$;Byte "B" - #$;Short "S" - #$;Int "I" - #$;Long "J" - #$;Float "F" - #$;Double "D" - #$;Char "C") - - (#$;Array sub) + #$.Boolean "Z" + #$.Byte "B" + #$.Short "S" + #$.Int "I" + #$.Long "J" + #$.Float "F" + #$.Double "D" + #$.Char "C") + + (#$.Array sub) (format "[" (descriptor sub)) - (#$;Generic generic) + (#$.Generic generic) (case generic - (#$;Class class params) + (#$.Class class params) (format "L" (binary-name class) ";") - (^or (#$;Var name) (#$;Wildcard ?bound)) - (descriptor (#$;Generic (#$;Class "java.lang.Object" (list))))) + (^or (#$.Var name) (#$.Wildcard ?bound)) + (descriptor (#$.Generic (#$.Class "java.lang.Object" (list))))) )) (def: #export (signature type) - (-> $;Type Text) + (-> $.Type Text) (case type - (#$;Primitive prim) + (#$.Primitive prim) (case prim - #$;Boolean "Z" - #$;Byte "B" - #$;Short "S" - #$;Int "I" - #$;Long "J" - #$;Float "F" - #$;Double "D" - #$;Char "C") - - (#$;Array sub) + #$.Boolean "Z" + #$.Byte "B" + #$.Short "S" + #$.Int "I" + #$.Long "J" + #$.Float "F" + #$.Double "D" + #$.Char "C") + + (#$.Array sub) (format "[" (signature sub)) - (#$;Generic generic) + (#$.Generic generic) (case generic - (#$;Class class params) - (let [=params (if (list;empty? params) + (#$.Class class params) + (let [=params (if (list.empty? params) "" (format "<" (|> params - (list/map (|>. #$;Generic signature)) - (text;join-with "")) + (list/map (|>> #$.Generic signature)) + (text.join-with "")) ">"))] (format "L" (binary-name class) =params ";")) - (#$;Var name) + (#$.Var name) (format "T" name ";") - (#$;Wildcard #;None) + (#$.Wildcard #.None) "*" (^template [ ] - (#$;Wildcard (#;Some [ bound])) - (format (signature (#$;Generic bound)))) - ([#$;Upper "+"] - [#$;Lower "-"])) + (#$.Wildcard (#.Some [ bound])) + (format (signature (#$.Generic bound)))) + ([#$.Upper "+"] + [#$.Lower "-"])) )) ## Methods (def: #export (method args return exceptions) - (-> (List $;Type) (Maybe $;Type) (List $;Generic) $;Method) - {#$;args args #$;return return #$;exceptions exceptions}) + (-> (List $.Type) (Maybe $.Type) (List $.Generic) $.Method) + {#$.args args #$.return return #$.exceptions exceptions}) (def: #export (method-descriptor method) - (-> $;Method Text) - (format "(" (text;join-with "" (list/map descriptor (get@ #$;args method))) ")" - (case (get@ #$;return method) - #;None + (-> $.Method Text) + (format "(" (text.join-with "" (list/map descriptor (get@ #$.args method))) ")" + (case (get@ #$.return method) + #.None "V" - (#;Some return) + (#.Some return) (descriptor return)))) (def: #export (method-signature method) - (-> $;Method Text) - (format "(" (|> (get@ #$;args method) (list/map signature) (text;join-with "")) ")" - (case (get@ #$;return method) - #;None + (-> $.Method Text) + (format "(" (|> (get@ #$.args method) (list/map signature) (text.join-with "")) ")" + (case (get@ #$.return method) + #.None "V" - (#;Some return) + (#.Some return) (signature return)) - (|> (get@ #$;exceptions method) - (list/map (|>. #$;Generic signature (format "^"))) - (text;join-with "")))) + (|> (get@ #$.exceptions method) + (list/map (|>> #$.Generic signature (format "^"))) + (text.join-with "")))) -- cgit v1.2.3