diff options
author | Eduardo Julian | 2017-10-21 00:38:55 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-21 00:38:55 -0400 |
commit | 0bc56fdc626ee601ca2c4ba0502f76e76d765fa0 (patch) | |
tree | 7abc9bfda606a0b861c9f2b33d9d949f217d8458 /new-luxc/source/luxc/analyser/procedure/host.jvm.lux | |
parent | a564de58ec5c91c8069abc3848649a4a0cfd7956 (diff) |
- Updated new compiler to latest version of stdlib.
Diffstat (limited to 'new-luxc/source/luxc/analyser/procedure/host.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/analyser/procedure/host.jvm.lux | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/new-luxc/source/luxc/analyser/procedure/host.jvm.lux b/new-luxc/source/luxc/analyser/procedure/host.jvm.lux index 63931c6f2..e45e7d807 100644 --- a/new-luxc/source/luxc/analyser/procedure/host.jvm.lux +++ b/new-luxc/source/luxc/analyser/procedure/host.jvm.lux @@ -30,7 +30,7 @@ (def: #export null-class Text "#Null") (do-template [<name> <class>] - [(def: #export <name> Type (#;Host <class> (list)))] + [(def: #export <name> Type (#;Primitive <class> (list)))] ## Boxes [Boolean "java.lang.Boolean"] @@ -186,10 +186,10 @@ #;None (&;fail (invalid-array-type expectedT))) - (^ (#;Host "#Array" (list elemT))) + (^ (#;Primitive "#Array" (list elemT))) (recur elemT (n.inc level)) - (#;Host class _) + (#;Primitive class _) (wrap [level class]) _ @@ -206,7 +206,7 @@ (def: (check-jvm objectT) (-> Type (Meta Text)) (case objectT - (#;Host name _) + (#;Primitive name _) (meta/wrap name) (#;Named name unnamed) @@ -245,13 +245,13 @@ (do meta;Monad<Meta> [] (case elemT - (#;Host name #;Nil) + (#;Primitive name #;Nil) (let [boxed-name (|> (dict;get name boxes) (maybe;default name))] - (wrap [(#;Host boxed-name #;Nil) + (wrap [(#;Primitive boxed-name #;Nil) boxed-name])) - (#;Host name _) + (#;Primitive name _) (if (dict;contains? name boxes) (&;fail (format "Primitives cannot be parameterized: " name)) (:: meta;Monad<Meta> wrap [elemT name])) @@ -479,7 +479,7 @@ [_ (#;Text class)] (do meta;Monad<Meta> [_ (load-class class) - _ (&;infer (#;Host "java.lang.Class" (list (#;Host class (list)))))] + _ (&;infer (#;Primitive "java.lang.Class" (list (#;Primitive class (list)))))] (wrap (#la;Procedure proc (list (#la;Text class))))) _ @@ -586,13 +586,13 @@ class-name (Class.getName [] java-type)] (meta/wrap (case (array;size (Class.getTypeParameters [] java-type)) +0 - (#;Host class-name (list)) + (#;Primitive class-name (list)) arity (|> (list;n.range +0 (n.dec arity)) list;reverse (list/map (|>. (n.* +2) n.inc #;Bound)) - (#;Host class-name) + (#;Primitive class-name) (type;univ-q arity))))) (host;instance? ParameterizedType java-type) @@ -604,8 +604,8 @@ (ParameterizedType.getActualTypeArguments []) array;to-list (monad;map @ (java-type-to-lux-type mappings)))] - (meta/wrap (#;Host (Class.getName [] (:! (Class Object) raw)) - paramsT))) + (meta/wrap (#;Primitive (Class.getName [] (:! (Class Object) raw)) + paramsT))) (&;throw JVM-Type-Is-Not-Class (type-descriptor raw)))) (host;instance? GenericArrayType java-type) @@ -613,7 +613,7 @@ [innerT (|> (:! GenericArrayType java-type) (GenericArrayType.getGenericComponentType []) (java-type-to-lux-type mappings))] - (wrap (#;Host "#Array" (list innerT)))) + (wrap (#;Primitive "#Array" (list innerT)))) ## else (&;throw Cannot-Convert-To-Lux-Type (type-descriptor java-type)))) @@ -631,7 +631,7 @@ (def: (correspond-type-params class type) (-> (Class Object) Type (Meta Mappings)) (case type - (#;Host name params) + (#;Primitive name params) (let [class-name (Class.getName [] class) class-params (array;to-list (Class.getTypeParameters [] class))] (if (text/= class-name name) @@ -654,13 +654,13 @@ (cond (dict;contains? to-name boxes) (let [box (maybe;assume (dict;get to-name boxes))] (if (text/= box from-name) - (wrap [(choose direction to-name from-name) (#;Host to-name (list))]) + (wrap [(choose direction to-name from-name) (#;Primitive to-name (list))]) (&;throw Cannot-Cast-To-Primitive (format from-name " => " to-name)))) (dict;contains? from-name boxes) (let [box (maybe;assume (dict;get from-name boxes))] (do @ - [[_ castT] (cast direction to (#;Host box (list)))] + [[_ castT] (cast direction to (#;Primitive box (list)))] (wrap [(choose direction to-name from-name) castT]))) (text/= to-name from-name) @@ -748,7 +748,7 @@ (list/map (TypeVariable.getName [])))] mappings (: (Meta Mappings) (case objectT - (#;Host _class-name _class-params) + (#;Primitive _class-name _class-params) (do @ [#let [num-params (list;size _class-params) num-vars (list;size var-names)] @@ -998,7 +998,7 @@ inputsT _ - (list& (#;Host owner-name (list;reverse owner-tvarsT)) + (list& (#;Primitive owner-name (list;reverse owner-tvarsT)) inputsT))) outputT)]] (wrap [methodT exceptionsT])))) @@ -1056,7 +1056,7 @@ exceptionsT (|> (Constructor.getGenericExceptionTypes [] constructor) array;to-list (monad;map @ (java-type-to-lux-type mappings))) - #let [objectT (#;Host owner-name (list;reverse owner-tvarsT)) + #let [objectT (#;Primitive owner-name (list;reverse owner-tvarsT)) constructorT (<| (type;univ-q num-all-tvars) (type;function inputsT) objectT)]] |