aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/lux.lux63
1 files changed, 41 insertions, 22 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index 520e55434..19a7b4716 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -485,6 +485,26 @@
Text])]))
default-def-meta-exported)
+## (type: Module-State
+## #Active
+## #Compiled
+## #Cached)
+(_lux_def Module-State
+ (#NamedT ["lux" "Module-State"]
+ (#SumT
+ ## #Active
+ Unit
+ (#SumT
+ ## #Compiled
+ Unit
+ ## #Cached
+ Unit)))
+ (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "Active")
+ (#Cons (#TextA "Compiled")
+ (#Cons (#TextA "Cached")
+ #Nil))))]
+ default-def-meta-exported))
+
## (type: Module
## {#module-hash Int
## #module-aliases (List [Text Text])
@@ -493,6 +513,7 @@
## #tags (List [Text [Nat (List Ident) Bool Type]])
## #types (List [Text [(List Ident) Bool Type]])}
## #module-anns Anns
+## #module-state Module-State
## )
(_lux_def Module
(#NamedT ["lux" "Module"]
@@ -518,8 +539,9 @@
(#ProdT (#AppT List Ident)
(#ProdT Bool
Type))))
- ## "lux;module-anns"
- Anns)
+ (#ProdT ## "lux;module-anns"
+ Anns
+ Module-State))
))))))
(#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "module-hash")
(#Cons (#TextA "module-aliases")
@@ -528,7 +550,8 @@
(#Cons (#TextA "tags")
(#Cons (#TextA "types")
(#Cons (#TextA "module-anns")
- #Nil))))))))]
+ (#Cons (#TextA "module-state")
+ #Nil)))))))))]
(#Cons [["lux" "doc"] (#TextA "All the information contained within a Lux module.")]
default-def-meta-exported)))
@@ -556,21 +579,17 @@
default-def-meta-exported)))
## (type: Compiler-Info
-## {#compiler-name Text
-## #compiler-version Text
+## {#compiler-version Text
## #compiler-mode Compiler-Mode})
(_lux_def Compiler-Info
(#NamedT ["lux" "Compiler-Info"]
- (#ProdT ## "lux;compiler-name"
+ (#ProdT ## "lux;compiler-version"
Text
- (#ProdT ## "lux;compiler-version"
- Text
- ## "lux;compiler-mode"
- Compiler-Mode)))
- (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "compiler-name")
- (#Cons (#TextA "compiler-version")
- (#Cons (#TextA "compiler-mode")
- #Nil))))]
+ ## "lux;compiler-mode"
+ Compiler-Mode))
+ (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "compiler-version")
+ (#Cons (#TextA "compiler-mode")
+ #Nil)))]
(#Cons [["lux" "doc"] (#TextA "Information about the current version and type of compiler that is running.")]
default-def-meta-exported)))
@@ -1697,7 +1716,7 @@
#seed seed #expected expected #cursor cursor
#scope-type-vars scope-type-vars} state]
(_lux_case (get module modules)
- (#Some {#module-hash _ #module-aliases _ #defs defs #imports _ #tags tags #types types #module-anns _})
+ (#Some {#module-hash _ #module-aliases _ #defs defs #imports _ #tags tags #types types #module-anns _ #module-state _})
(_lux_case (get name defs)
(#Some [def-type def-meta def-value])
(_lux_case (get-meta ["lux" "alias"] def-meta)
@@ -2206,7 +2225,7 @@
($' Maybe Macro))
(do Monad<Maybe>
[$module (get module modules)
- gdef (let' [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags #types types #module-anns _} (_lux_: Module $module)]
+ gdef (let' [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags #types types #module-anns _ #module-state _} (_lux_: Module $module)]
(get name bindings))]
(let' [[def-type def-meta def-value] (_lux_: Def gdef)]
(_lux_case (get-meta ["lux" "macro?"] def-meta)
@@ -3374,7 +3393,7 @@
(-> Ident (Lux [Nat (List Ident) Bool Type]))
(do Monad<Lux>
[=module (find-module module)
- #let [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags-table #types types #module-anns _} =module]]
+ #let [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags-table #types types #module-anns _ #module-state _} =module]]
(case (get name tags-table)
(#Some output)
(return output)
@@ -3397,7 +3416,7 @@
(#NamedT [module name] _)
(do Monad<Lux>
[=module (find-module module)
- #let [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags #types types #module-anns _} =module]]
+ #let [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags #types types #module-anns _ #module-state _} =module]]
(case (get name types)
(#Some [tags exported? (#NamedT _ _type)])
(case (resolve-struct-type _type)
@@ -3956,7 +3975,7 @@
_
(list))))
- (let [{#module-hash _ #module-aliases _ #defs defs #imports _ #tags tags #types types #module-anns _} =module]
+ (let [{#module-hash _ #module-aliases _ #defs defs #imports _ #tags tags #types types #module-anns _ #module-state _} =module]
defs))]
(#Right state (List/join to-alias)))
@@ -4022,7 +4041,7 @@
#None
#None
- (#Some {#defs defs #module-hash _ #module-aliases _ #imports _ #tags tags #types types #module-anns _})
+ (#Some {#defs defs #module-hash _ #module-aliases _ #imports _ #tags tags #types types #module-anns _ #module-state _})
(case (get v-name defs)
#None
#None
@@ -4041,7 +4060,7 @@
#None
(#Left (Text/append "Unknown definition: " (Ident/encode name)))
- (#Some {#defs defs #module-hash _ #module-aliases _ #imports _ #tags tags #types types #module-anns _})
+ (#Some {#defs defs #module-hash _ #module-aliases _ #imports _ #tags tags #types types #module-anns _ #module-state _})
(case (get v-name defs)
#None
(#Left (Text/append "Unknown definition: " (Ident/encode name)))
@@ -4344,7 +4363,7 @@
(-> Text Text (Lux Bool))
(do Monad<Lux>
[module (find-module module-name)
- #let [{#module-hash _ #module-aliases _ #defs _ #imports imports #tags _ #types _ #module-anns _} module]]
+ #let [{#module-hash _ #module-aliases _ #defs _ #imports imports #tags _ #types _ #module-anns _ #module-state _} module]]
(wrap (is-member? imports import-name))))
(macro: #export (default tokens state)