aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source
diff options
context:
space:
mode:
authorEduardo Julian2017-10-21 00:38:55 -0400
committerEduardo Julian2017-10-21 00:38:55 -0400
commit0bc56fdc626ee601ca2c4ba0502f76e76d765fa0 (patch)
tree7abc9bfda606a0b861c9f2b33d9d949f217d8458 /new-luxc/source
parenta564de58ec5c91c8069abc3848649a4a0cfd7956 (diff)
- Updated new compiler to latest version of stdlib.
Diffstat (limited to 'new-luxc/source')
-rw-r--r--new-luxc/source/luxc/analyser/inference.lux4
-rw-r--r--new-luxc/source/luxc/analyser/procedure/host.jvm.lux38
-rw-r--r--new-luxc/source/luxc/module/descriptor/type.lux10
3 files changed, 26 insertions, 26 deletions
diff --git a/new-luxc/source/luxc/analyser/inference.lux b/new-luxc/source/luxc/analyser/inference.lux
index edb90e73d..86832ae9e 100644
--- a/new-luxc/source/luxc/analyser/inference.lux
+++ b/new-luxc/source/luxc/analyser/inference.lux
@@ -22,8 +22,8 @@
(def: #export (replace-var var-id bound-idx type)
(-> Nat Nat Type Type)
(case type
- (#;Host name params)
- (#;Host name (L/map (replace-var var-id bound-idx) params))
+ (#;Primitive name params)
+ (#;Primitive name (L/map (replace-var var-id bound-idx) params))
(^template [<tag>]
(<tag> left right)
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)]]
diff --git a/new-luxc/source/luxc/module/descriptor/type.lux b/new-luxc/source/luxc/module/descriptor/type.lux
index 6c5501e54..2f5b8667b 100644
--- a/new-luxc/source/luxc/module/descriptor/type.lux
+++ b/new-luxc/source/luxc/module/descriptor/type.lux
@@ -15,7 +15,7 @@
[(def: <name> &;Signal <code>)]
[type-signal "T"]
- [host-signal "^"]
+ [primitive-signal "^"]
[void-signal "0"]
[unit-signal "1"]
[product-signal "*"]
@@ -36,8 +36,8 @@
(type/= Type type))
type-signal
(case type
- (#;Host name params)
- (format host-signal name &;stop-signal (&;encode-list encode-type params))
+ (#;Primitive name params)
+ (format primitive-signal name &;stop-signal (&;encode-list encode-type params))
#;Void
void-signal
@@ -115,11 +115,11 @@
[#;Var var-signal])]
($_ l;either
(do l;Monad<Lexer>
- [_ (l;text host-signal)
+ [_ (l;text primitive-signal)
name (l;many' (l;none-of &;stop-signal))
_ (l;text &;stop-signal)
params (&;decode-list type-decoder)]
- (wrap (#;Host name params)))
+ (wrap (#;Primitive name params)))
<simple>
<combinators>
<abstractions>