aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux.lux')
-rw-r--r--stdlib/source/lux.lux52
1 files changed, 36 insertions, 16 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index 8be7f8d26..e1244d970 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -548,6 +548,26 @@
(#Cons [["lux" "doc"] (#TextA "All the information contained within a Lux module.")]
default-def-meta-exported)))
+## (type: Type-Context
+## {#ex-counter Nat
+## #var-counter Nat
+## #var-bindings (List [Nat (Maybe Type)])})
+(_lux_def Type-Context
+ (#NamedT ["lux" "Type-Context"]
+ (#ProdT ## ex-counter
+ Nat
+ (#ProdT ## var-counter
+ Nat
+ ## var-bindings
+ (#AppT List
+ (#ProdT Nat
+ (#AppT Maybe Type))))))
+ (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "ex-counter")
+ (#Cons (#TextA "var-counter")
+ (#Cons (#TextA "var-bindings")
+ #Nil))))]
+ default-def-meta-exported))
+
## (type: Compiler-Mode
## #Release
## #Debug
@@ -592,7 +612,7 @@
## #cursor Cursor
## #modules (List [Text Module])
## #scopes (List Scope)
-## #type-vars (Bindings Nat (Maybe Type))
+## #type-context Type-Context
## #expected (Maybe Type)
## #seed Nat
## #scope-type-vars (List Nat)
@@ -610,8 +630,8 @@
Module))
(#ProdT ## "lux;scopes"
(#AppT List Scope)
- (#ProdT ## "lux;type-vars"
- (#AppT (#AppT Bindings Nat) (#AppT Maybe Type))
+ (#ProdT ## "lux;type-context"
+ Type-Context
(#ProdT ## "lux;expected"
(#AppT Maybe Type)
(#ProdT ## "lux;seed"
@@ -625,7 +645,7 @@
(#Cons (#TextA "cursor")
(#Cons (#TextA "modules")
(#Cons (#TextA "scopes")
- (#Cons (#TextA "type-vars")
+ (#Cons (#TextA "type-context")
(#Cons (#TextA "expected")
(#Cons (#TextA "seed")
(#Cons (#TextA "scope-type-vars")
@@ -1695,7 +1715,7 @@
(-> Ident ($' Lux Ident))
(let' [[module name] ident
{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars} state]
(_lux_case (get module modules)
@@ -1854,7 +1874,7 @@
($' Lux Text)
(_lux_case state
{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars}
(_lux_case (reverse scopes)
@@ -2336,7 +2356,7 @@
(function' [state]
(_lux_case state
{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected
#cursor cursor
#scope-type-vars scope-type-vars}
@@ -2591,12 +2611,12 @@
(-> Text ($' Lux AST))
(_lux_case state
{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected
#cursor cursor
#scope-type-vars scope-type-vars}
(#Right {#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed (n.+ +1 seed) #expected expected
#cursor cursor
#scope-type-vars scope-type-vars}
@@ -3462,7 +3482,7 @@
(-> Text (Lux Module))
(function [state]
(let [{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars} state]
(case (get name modules)
@@ -3525,7 +3545,7 @@
(Lux Type)
(function [state]
(let [{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars} state]
(case expected
@@ -4049,7 +4069,7 @@
(-> Text (Lux (List Text)))
(let [modules (case state
{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars}
modules)]
@@ -4104,7 +4124,7 @@
(-> Text Compiler (Maybe Type))
(case state
{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars}
(find (: (-> Scope (Maybe Type))
@@ -4126,7 +4146,7 @@
(-> Ident Compiler (Maybe Type))
(let [[v-prefix v-name] name
{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars} state]
(case (get v-prefix modules)
@@ -4145,7 +4165,7 @@
(-> Ident (Lux [Type Void]))
(let [[v-prefix v-name] name
{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars} state]
(case (get v-prefix modules)
@@ -5504,7 +5524,7 @@
(Lux (List Nat))
(case state
{#info info #source source #modules modules
- #scopes scopes #type-vars types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars}
(#Right state scope-type-vars)