diff options
author | Eduardo Julian | 2017-11-29 22:49:56 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-29 22:49:56 -0400 |
commit | 4433c9bcd6c6cac44c018aad2e21a5b4d7cc4896 (patch) | |
tree | 0c166db6e01b41dfadd01801b5242967f2363b7d /new-luxc/source/luxc/lang/host/jvm/type.lux | |
parent | 77c113a3455cdbc4bb485a94f67f392480cdcfbf (diff) |
- Adapted main codebase to the latest syntatic changes.
Diffstat (limited to 'new-luxc/source/luxc/lang/host/jvm/type.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/host/jvm/type.lux | 148 |
1 files changed, 74 insertions, 74 deletions
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 [<name> <primitive>] - [(def: #export <name> $;Type (#$;Primitive <primitive>))] - - [boolean #$;Boolean] - [byte #$;Byte] - [short #$;Short] - [int #$;Int] - [long #$;Long] - [float #$;Float] - [double #$;Double] - [char #$;Char] + [(def: #export <name> $.Type (#$.Primitive <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 [<tag> <prefix>] - (#$;Wildcard (#;Some [<tag> bound])) - (format <prefix> (signature (#$;Generic bound)))) - ([#$;Upper "+"] - [#$;Lower "-"])) + (#$.Wildcard (#.Some [<tag> bound])) + (format <prefix> (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 "")))) |