aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool/compiler/phase
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/tool/compiler/phase/directive.lux (renamed from stdlib/source/lux/tool/compiler/phase/statement.lux)8
-rw-r--r--stdlib/source/lux/tool/compiler/phase/extension/directive/lux.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/statement/lux.lux)160
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation.lux96
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/extension.lux10
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/reference.lux20
5 files changed, 147 insertions, 147 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/statement.lux b/stdlib/source/lux/tool/compiler/phase/directive.lux
index 250d14721..f79f2b586 100644
--- a/stdlib/source/lux/tool/compiler/phase/statement.lux
+++ b/stdlib/source/lux/tool/compiler/phase/directive.lux
@@ -18,11 +18,11 @@
["#/" // #_
[reference (#+)]
["#." analysis]
- ["/" statement (#+ Phase)]]])
+ ["/" directive (#+ Phase)]]])
-(exception: #export (not-a-statement {code Code})
+(exception: #export (not-a-directive {code Code})
(exception.report
- ["Statement" (%.code code)]))
+ ["Directive" (%.code code)]))
(exception: #export (invalid-macro-call {code Code})
(exception.report
@@ -76,4 +76,4 @@
(wrap requirements))
_
- (//.throw not-a-statement code))))))
+ (//.throw not-a-directive code))))))
diff --git a/stdlib/source/lux/tool/compiler/phase/extension/statement/lux.lux b/stdlib/source/lux/tool/compiler/phase/extension/directive/lux.lux
index eef4731d2..9344169f2 100644
--- a/stdlib/source/lux/tool/compiler/phase/extension/statement/lux.lux
+++ b/stdlib/source/lux/tool/compiler/phase/extension/directive/lux.lux
@@ -31,18 +31,18 @@
["#/" // #_
["#." analysis]
["#." synthesis (#+ Synthesis)]
- ["#." statement (#+ Import Requirements Phase Operation Handler Bundle)]
+ ["#." directive (#+ Import Requirements Phase Operation Handler Bundle)]
[default
["#." evaluation]]]]])
(def: #export (custom [syntax handler])
- (All [anchor expression statement s]
+ (All [anchor expression directive s]
(-> [(Parser s)
(-> Text
- (Phase anchor expression statement)
+ (Phase anchor expression directive)
s
- (Operation anchor expression statement Requirements))]
- (Handler anchor expression statement)))
+ (Operation anchor expression directive Requirements))]
+ (Handler anchor expression directive)))
(function (_ extension-name phase inputs)
(case (s.run syntax inputs)
(#try.Success inputs)
@@ -53,12 +53,12 @@
## TODO: Inline "evaluate!'" into "evaluate!" ASAP
(def: (evaluate!' generate code//type codeS)
- (All [anchor expression statement]
- (-> (////generation.Phase anchor expression statement)
+ (All [anchor expression directive]
+ (-> (////generation.Phase anchor expression directive)
Type
Synthesis
- (Operation anchor expression statement [Type expression Any])))
- (/////statement.lift-generation
+ (Operation anchor expression directive [Type expression Any])))
+ (/////directive.lift-generation
(do ////.monad
[codeT (generate codeS)
count ////generation.next
@@ -66,47 +66,47 @@
(wrap [code//type codeT codeV]))))
(def: (evaluate! type codeC)
- (All [anchor expression statement]
- (-> Type Code (Operation anchor expression statement [Type expression Any])))
+ (All [anchor expression directive]
+ (-> Type Code (Operation anchor expression directive [Type expression Any])))
(do ////.monad
[state (///.lift ////.get-state)
- #let [analyse (get@ [#/////statement.analysis #/////statement.phase] state)
- synthesize (get@ [#/////statement.synthesis #/////statement.phase] state)
- generate (get@ [#/////statement.generation #/////statement.phase] state)]
- [_ codeA] (/////statement.lift-analysis
+ #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
+ synthesize (get@ [#/////directive.synthesis #/////directive.phase] state)
+ generate (get@ [#/////directive.generation #/////directive.phase] state)]
+ [_ codeA] (/////directive.lift-analysis
(/////analysis.with-scope
(typeA.with-fresh-env
(typeA.with-type type
(analyse codeC)))))
- codeS (/////statement.lift-synthesis
+ codeS (/////directive.lift-synthesis
(synthesize codeA))]
(evaluate!' generate type codeS)))
## TODO: Inline "definition'" into "definition" ASAP
(def: (definition' generate name code//type codeS)
- (All [anchor expression statement]
- (-> (////generation.Phase anchor expression statement)
+ (All [anchor expression directive]
+ (-> (////generation.Phase anchor expression directive)
Name
Type
Synthesis
- (Operation anchor expression statement [Type expression Text Any])))
- (/////statement.lift-generation
+ (Operation anchor expression directive [Type expression Text Any])))
+ (/////directive.lift-generation
(do ////.monad
[codeT (generate codeS)
- [target-name value statement] (////generation.define! name codeT)
- _ (////generation.save! false name statement)]
+ [target-name value directive] (////generation.define! name codeT)
+ _ (////generation.save! false name directive)]
(wrap [code//type codeT target-name value]))))
(def: (definition name expected codeC)
- (All [anchor expression statement]
+ (All [anchor expression directive]
(-> Name (Maybe Type) Code
- (Operation anchor expression statement [Type expression Text Any])))
+ (Operation anchor expression directive [Type expression Text Any])))
(do ////.monad
[state (///.lift ////.get-state)
- #let [analyse (get@ [#/////statement.analysis #/////statement.phase] state)
- synthesize (get@ [#/////statement.synthesis #/////statement.phase] state)
- generate (get@ [#/////statement.generation #/////statement.phase] state)]
- [_ code//type codeA] (/////statement.lift-analysis
+ #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
+ synthesize (get@ [#/////directive.synthesis #/////directive.phase] state)
+ generate (get@ [#/////directive.generation #/////directive.phase] state)]
+ [_ code//type codeA] (/////directive.lift-analysis
(/////analysis.with-scope
(typeA.with-fresh-env
(case expected
@@ -122,21 +122,21 @@
[codeA (typeA.with-type expected
(analyse codeC))]
(wrap [expected codeA]))))))
- codeS (/////statement.lift-synthesis
+ codeS (/////directive.lift-synthesis
(synthesize codeA))]
(definition' generate name code//type codeS)))
(def: (refresh expander host-analysis)
- (All [anchor expression statement]
- (-> Expander /////analysis.Bundle (Operation anchor expression statement Any)))
+ (All [anchor expression directive]
+ (-> Expander /////analysis.Bundle (Operation anchor expression directive Any)))
(do ////.monad
[[bundle state] ////.get-state
#let [eval (/////evaluation.evaluator expander
- (get@ [#/////statement.synthesis #/////statement.state] state)
- (get@ [#/////statement.generation #/////statement.state] state)
- (get@ [#/////statement.generation #/////statement.phase] state))]]
+ (get@ [#/////directive.synthesis #/////directive.state] state)
+ (get@ [#/////directive.generation #/////directive.state] state)
+ (get@ [#/////directive.generation #/////directive.phase] state))]]
(////.set-state [bundle
- (update@ [#/////statement.analysis #/////statement.state]
+ (update@ [#/////directive.analysis #/////directive.state]
(: (-> /////analysis.State+ /////analysis.State+)
(|>> product.right
[(///analysis.bundle eval host-analysis)]))
@@ -148,18 +148,18 @@
(case inputsC+
(^ (list [_ (#.Identifier ["" short-name])] valueC annotationsC [_ (#.Bit exported?)]))
(do ////.monad
- [current-module (/////statement.lift-analysis
+ [current-module (/////directive.lift-analysis
(///.lift macro.current-module-name))
#let [full-name [current-module short-name]]
[type valueT valueN value] (..definition full-name #.None valueC)
[_ annotationsT annotations] (evaluate! Code annotationsC)
- _ (/////statement.lift-analysis
+ _ (/////directive.lift-analysis
(module.define short-name (#.Right [exported? type (:coerce Code annotations) value])))
#let [_ (log! (format "Definition " (%.name full-name)))]
- _ (/////statement.lift-generation
+ _ (/////directive.lift-generation
(////generation.learn full-name valueN))
_ (..refresh expander host-analysis)]
- (wrap /////statement.no-requirements))
+ (wrap /////directive.no-requirements))
_
(////.throw ///.invalid-syntax [extension-name %.code inputsC+]))))
@@ -170,21 +170,21 @@
[($_ p.and s.local-identifier s.any s.any (s.tuple (p.some s.text)) s.bit)
(function (_ extension-name phase [short-name valueC annotationsC tags exported?])
(do ////.monad
- [current-module (/////statement.lift-analysis
+ [current-module (/////directive.lift-analysis
(///.lift macro.current-module-name))
#let [full-name [current-module short-name]]
[_ annotationsT annotations] (evaluate! Code annotationsC)
#let [annotations (:coerce Code annotations)]
[type valueT valueN value] (..definition full-name (#.Some .Type) valueC)
- _ (/////statement.lift-analysis
+ _ (/////directive.lift-analysis
(do ////.monad
[_ (module.define short-name (#.Right [exported? type annotations value]))]
(module.declare-tags tags exported? (:coerce Type value))))
#let [_ (log! (format "Definition " (%.name full-name)))]
- _ (/////statement.lift-generation
+ _ (/////directive.lift-generation
(////generation.learn full-name valueN))
_ (..refresh expander host-analysis)]
- (wrap /////statement.no-requirements)))]))
+ (wrap /////directive.no-requirements)))]))
(def: imports
(Parser (List Import))
@@ -200,7 +200,7 @@
(do ////.monad
[[_ annotationsT annotationsV] (evaluate! Code annotationsC)
#let [annotationsV (:coerce Code annotationsV)]
- _ (/////statement.lift-analysis
+ _ (/////directive.lift-analysis
(do @
[_ (monad.map @ (function (_ [module alias])
(do @
@@ -210,8 +210,8 @@
_ (module.alias alias module))))
imports)]
(module.set-annotations annotationsV)))]
- (wrap {#/////statement.imports imports
- #/////statement.referrals (list)})))]))
+ (wrap {#/////directive.imports imports
+ #/////directive.referrals (list)})))]))
(exception: #export (cannot-alias-an-alias {local Alias} {foreign Alias} {target Name})
(exception.report
@@ -238,92 +238,92 @@
(function (_ extension-name phase [alias def-name])
(do ////.monad
[_ (///.lift
- (////.sub [(get@ [#/////statement.analysis #/////statement.state])
- (set@ [#/////statement.analysis #/////statement.state])]
+ (////.sub [(get@ [#/////directive.analysis #/////directive.state])
+ (set@ [#/////directive.analysis #/////directive.state])]
(define-alias alias def-name)))]
- (wrap /////statement.no-requirements)))]))
+ (wrap /////directive.no-requirements)))]))
(template [<mame> <type> <scope>]
[(def: <mame>
- (All [anchor expression statement]
- (Handler anchor expression statement))
+ (All [anchor expression directive]
+ (Handler anchor expression directive))
(function (handler extension-name phase inputsC+)
(case inputsC+
(^ (list [_ (#.Text name)] valueC))
(do ////.monad
- [[_ handlerT handlerV] (evaluate! (:by-example [anchor expression statement]
- {(Handler anchor expression statement)
+ [[_ handlerT handlerV] (evaluate! (:by-example [anchor expression directive]
+ {(Handler anchor expression directive)
handler}
<type>)
valueC)
_ (<| <scope>
(///.install name)
- (:share [anchor expression statement]
- {(Handler anchor expression statement)
+ (:share [anchor expression directive]
+ {(Handler anchor expression directive)
handler}
{<type>
(:assume handlerV)}))]
- (wrap /////statement.no-requirements))
+ (wrap /////directive.no-requirements))
_
(////.throw ///.invalid-syntax [extension-name %.code inputsC+]))))]
- [def::analysis /////analysis.Handler /////statement.lift-analysis]
- [def::synthesis /////synthesis.Handler /////statement.lift-synthesis]
- [def::generation (////generation.Handler anchor expression statement) /////statement.lift-generation]
- [def::statement (/////statement.Handler anchor expression statement) (<|)]
+ [def::analysis /////analysis.Handler /////directive.lift-analysis]
+ [def::synthesis /////synthesis.Handler /////directive.lift-synthesis]
+ [def::generation (////generation.Handler anchor expression directive) /////directive.lift-generation]
+ [def::directive (/////directive.Handler anchor expression directive) (<|)]
)
## TODO; Both "prepare-program" and "define-program" exist only
## because the old compiler couldn"t handle a fully-inlined definition
## for "def::program". Inline them ASAP.
(def: (prepare-program analyse synthesize programC)
- (All [anchor expression statement output]
+ (All [anchor expression directive output]
(-> /////analysis.Phase
/////synthesis.Phase
Code
- (Operation anchor expression statement Synthesis)))
+ (Operation anchor expression directive Synthesis)))
(do ////.monad
- [[_ programA] (/////statement.lift-analysis
+ [[_ programA] (/////directive.lift-analysis
(/////analysis.with-scope
(typeA.with-fresh-env
(typeA.with-type (type (-> (List Text) (IO Any)))
(analyse programC)))))]
- (/////statement.lift-synthesis
+ (/////directive.lift-synthesis
(synthesize programA))))
(def: (define-program generate program programS)
- (All [anchor expression statement output]
- (-> (////generation.Phase anchor expression statement)
- (-> expression statement)
+ (All [anchor expression directive output]
+ (-> (////generation.Phase anchor expression directive)
+ (-> expression directive)
Synthesis
- (////generation.Operation anchor expression statement Any)))
+ (////generation.Operation anchor expression directive Any)))
(do ////.monad
[programG (generate programS)]
(////generation.save! false ["" ""] (program programG))))
(def: (def::program program)
- (All [anchor expression statement]
- (-> (-> expression statement) (Handler anchor expression statement)))
+ (All [anchor expression directive]
+ (-> (-> expression directive) (Handler anchor expression directive)))
(function (handler extension-name phase inputsC+)
(case inputsC+
(^ (list programC))
(do ////.monad
[state (///.lift ////.get-state)
- #let [analyse (get@ [#/////statement.analysis #/////statement.phase] state)
- synthesize (get@ [#/////statement.synthesis #/////statement.phase] state)
- generate (get@ [#/////statement.generation #/////statement.phase] state)]
+ #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
+ synthesize (get@ [#/////directive.synthesis #/////directive.phase] state)
+ generate (get@ [#/////directive.generation #/////directive.phase] state)]
programS (prepare-program analyse synthesize programC)
- _ (/////statement.lift-generation
+ _ (/////directive.lift-generation
(define-program generate program programS))]
- (wrap /////statement.no-requirements))
+ (wrap /////directive.no-requirements))
_
(////.throw ///.invalid-syntax [extension-name %.code inputsC+]))))
(def: (bundle::def expander host-analysis program)
- (All [anchor expression statement]
- (-> Expander /////analysis.Bundle (-> expression statement) (Bundle anchor expression statement)))
+ (All [anchor expression directive]
+ (-> Expander /////analysis.Bundle (-> expression directive) (Bundle anchor expression directive)))
(<| (///bundle.prefix "def")
(|> ///bundle.empty
(dictionary.put "module" def::module)
@@ -332,13 +332,13 @@
(dictionary.put "analysis" def::analysis)
(dictionary.put "synthesis" def::synthesis)
(dictionary.put "generation" def::generation)
- (dictionary.put "statement" def::statement)
+ (dictionary.put "directive" def::directive)
(dictionary.put "program" (def::program program))
)))
(def: #export (bundle expander host-analysis program)
- (All [anchor expression statement]
- (-> Expander /////analysis.Bundle (-> expression statement) (Bundle anchor expression statement)))
+ (All [anchor expression directive]
+ (-> Expander /////analysis.Bundle (-> expression directive) (Bundle anchor expression directive)))
(<| (///bundle.prefix "lux")
(|> ///bundle.empty
(dictionary.put "def" (lux::def expander host-analysis))
diff --git a/stdlib/source/lux/tool/compiler/phase/generation.lux b/stdlib/source/lux/tool/compiler/phase/generation.lux
index aa7d09d66..cbd0bba9b 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation.lux
@@ -59,29 +59,29 @@
{#scope-name Text
#inner-functions Nat})
-(signature: #export (Host expression statement)
+(signature: #export (Host expression directive)
(: (-> Text expression (Try Any))
evaluate!)
- (: (-> Text statement (Try Any))
+ (: (-> Text directive (Try Any))
execute!)
- (: (-> Name expression (Try [Text Any statement]))
+ (: (-> Name expression (Try [Text Any directive]))
define!))
-(type: #export (Buffer statement) (Row [Name statement]))
-(type: #export (Output statement) (Row [Module (Buffer statement)]))
+(type: #export (Buffer directive) (Row [Name directive]))
+(type: #export (Output directive) (Row [Module (Buffer directive)]))
-(type: #export (State anchor expression statement)
+(type: #export (State anchor expression directive)
{#context Context
#anchor (Maybe anchor)
- #host (Host expression statement)
- #buffer (Maybe (Buffer statement))
- #output (Output statement)
+ #host (Host expression directive)
+ #buffer (Maybe (Buffer directive))
+ #output (Output directive)
#counter Nat
#name-cache Registry})
(template [<special> <general>]
- [(type: #export (<special> anchor expression statement)
- (<general> (State anchor expression statement) Synthesis expression))]
+ [(type: #export (<special> anchor expression directive)
+ (<general> (State anchor expression directive) Synthesis expression))]
[State+ extension.State]
[Operation extension.Operation]
@@ -91,9 +91,9 @@
)
(def: #export (state host)
- (All [anchor expression statement]
- (-> (Host expression statement)
- (..State anchor expression statement)))
+ (All [anchor expression directive]
+ (-> (Host expression directive)
+ (..State anchor expression directive)))
{#context {#scope-name ""
#inner-functions 0}
#anchor #.None
@@ -104,9 +104,9 @@
#name-cache (dictionary.new name.hash)})
(def: #export (with-context expr)
- (All [anchor expression statement output]
- (-> (Operation anchor expression statement output)
- (Operation anchor expression statement [Text output])))
+ (All [anchor expression directive output]
+ (-> (Operation anchor expression directive output)
+ (Operation anchor expression directive [Text output])))
(function (_ [bundle state])
(let [[old-scope old-inner] (get@ #context state)
new-scope (format old-scope "c" (%.nat old-inner))]
@@ -119,8 +119,8 @@
(#try.Failure error)))))
(def: #export context
- (All [anchor expression statement]
- (Operation anchor expression statement Text))
+ (All [anchor expression directive]
+ (Operation anchor expression directive Text))
(extension.read (|>> (get@ #context)
(get@ #scope-name))))
@@ -132,7 +132,7 @@
[(exception: #export <exception>)
(def: #export <with-declaration>
- (All [anchor expression statement output] <with-type>)
+ (All [anchor expression directive output] <with-type>)
(function (_ body)
(function (_ [bundle state])
(case (body [bundle (set@ <tag> (#.Some <with-value>) state)])
@@ -144,8 +144,8 @@
(#try.Failure error)))))
(def: #export <get>
- (All [anchor expression statement]
- (Operation anchor expression statement <get-type>))
+ (All [anchor expression directive]
+ (Operation anchor expression directive <get-type>))
(function (_ (^@ stateE [bundle state]))
(case (get@ <tag> state)
(#.Some output)
@@ -155,49 +155,49 @@
(exception.throw <exception> []))))
(def: #export (<set> value)
- (All [anchor expression statement]
- (-> <get-type> (Operation anchor expression statement Any)))
+ (All [anchor expression directive]
+ (-> <get-type> (Operation anchor expression directive Any)))
(function (_ [bundle state])
(#try.Success [[bundle (set@ <tag> (#.Some value) state)]
[]])))]
[#anchor
(with-anchor anchor)
- (-> anchor (Operation anchor expression statement output)
- (Operation anchor expression statement output))
+ (-> anchor (Operation anchor expression directive output)
+ (Operation anchor expression directive output))
anchor
set-anchor anchor anchor no-anchor]
[#buffer
with-buffer
- (-> (Operation anchor expression statement output)
- (Operation anchor expression statement output))
+ (-> (Operation anchor expression directive output)
+ (Operation anchor expression directive output))
..empty-buffer
- set-buffer buffer (Buffer statement) no-active-buffer]
+ set-buffer buffer (Buffer directive) no-active-buffer]
)
(def: #export output
- (All [anchor expression statement]
- (Operation anchor expression statement (Output statement)))
+ (All [anchor expression directive]
+ (Operation anchor expression directive (Output directive)))
(extension.read (get@ #output)))
(def: #export next
- (All [anchor expression statement]
- (Operation anchor expression statement Nat))
+ (All [anchor expression directive]
+ (Operation anchor expression directive Nat))
(do //.monad
[count (extension.read (get@ #counter))
_ (extension.update (update@ #counter inc))]
(wrap count)))
(def: #export (gensym prefix)
- (All [anchor expression statement]
- (-> Text (Operation anchor expression statement Text)))
+ (All [anchor expression directive]
+ (-> Text (Operation anchor expression directive Text)))
(:: //.monad map (|>> %.nat (format prefix)) ..next))
(template [<name> <inputT>]
[(def: #export (<name> label code)
- (All [anchor expression statement]
- (-> Text <inputT> (Operation anchor expression statement Any)))
+ (All [anchor expression directive]
+ (-> Text <inputT> (Operation anchor expression directive Any)))
(function (_ (^@ state+ [bundle state]))
(case (:: (get@ #host state) <name> label code)
(#try.Success output)
@@ -207,12 +207,12 @@
(exception.throw cannot-interpret error))))]
[evaluate! expression]
- [execute! statement]
+ [execute! directive]
)
(def: #export (define! name code)
- (All [anchor expression statement]
- (-> Name expression (Operation anchor expression statement [Text Any statement])))
+ (All [anchor expression directive]
+ (-> Name expression (Operation anchor expression directive [Text Any directive])))
(function (_ (^@ stateE [bundle state]))
(case (:: (get@ #host state) define! name code)
(#try.Success output)
@@ -222,8 +222,8 @@
(exception.throw cannot-interpret error))))
(def: #export (save! execute? name code)
- (All [anchor expression statement]
- (-> Bit Name statement (Operation anchor expression statement Any)))
+ (All [anchor expression directive]
+ (-> Bit Name directive (Operation anchor expression directive Any)))
(do //.monad
[label (..gensym "save")
_ (if execute?
@@ -240,15 +240,15 @@
(//.throw no-buffer-for-saving-code name))))
(def: #export (save-buffer! target)
- (All [anchor expression statement]
- (-> Module (Operation anchor expression statement Any)))
+ (All [anchor expression directive]
+ (-> Module (Operation anchor expression directive Any)))
(do //.monad
[buffer ..buffer]
(extension.update (update@ #output (row.add [target buffer])))))
(def: #export (remember lux-name)
- (All [anchor expression statement]
- (-> Name (Operation anchor expression statement Text)))
+ (All [anchor expression directive]
+ (-> Name (Operation anchor expression directive Text)))
(function (_ (^@ stateE [_ state]))
(let [cache (get@ #name-cache state)]
(case (dictionary.get lux-name cache)
@@ -259,8 +259,8 @@
(exception.throw unknown-lux-name [lux-name cache])))))
(def: #export (learn lux-name host-name)
- (All [anchor expression statement]
- (-> Name Text (Operation anchor expression statement Any)))
+ (All [anchor expression directive]
+ (-> Name Text (Operation anchor expression directive Any)))
(function (_ [bundle state])
(let [cache (get@ #name-cache state)]
(case (dictionary.get lux-name cache)
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/extension.lux b/stdlib/source/lux/tool/compiler/phase/generation/extension.lux
index 2dddb89f6..91e1b661c 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/extension.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/extension.lux
@@ -27,12 +27,12 @@
(type: #export (Variadic of) (-> (List of) of))
(syntax: (arity: {arity s.nat} {name s.local-identifier} type)
- (with-gensyms [g!_ g!extension g!name g!phase g!inputs g!of g!anchor g!expression g!statement]
+ (with-gensyms [g!_ g!extension g!name g!phase g!inputs g!of g!anchor g!expression g!directive]
(do @
[g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))]
(wrap (list (` (def: #export ((~ (code.local-identifier name)) (~ g!extension))
- (All [(~ g!anchor) (~ g!expression) (~ g!statement)]
- (-> ((~ type) (~ g!expression)) (//.Handler (~ g!anchor) (~ g!expression) (~ g!statement))))
+ (All [(~ g!anchor) (~ g!expression) (~ g!directive)]
+ (-> ((~ type) (~ g!expression)) (//.Handler (~ g!anchor) (~ g!expression) (~ g!directive))))
(function ((~ g!_) (~ g!name) (~ g!phase) (~ g!inputs))
(case (~ g!inputs)
(^ (list (~+ g!input+)))
@@ -52,8 +52,8 @@
(arity: 3 trinary ..Trinary)
(def: #export (variadic extension)
- (All [anchor expression statement]
- (-> (Variadic expression) (//.Handler anchor expression statement)))
+ (All [anchor expression directive]
+ (-> (Variadic expression) (//.Handler anchor expression directive)))
(function (_ extension-name)
(function (_ phase inputsS)
(do ///.monad
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/reference.lux b/stdlib/source/lux/tool/compiler/phase/generation/reference.lux
index 110d78d0d..8a80953e9 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/reference.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/reference.lux
@@ -17,14 +17,14 @@
local)
(: (-> Register expression)
foreign)
- (: (All [anchor statement]
- (-> Variable (//.Operation anchor expression statement)))
+ (: (All [anchor directive]
+ (-> Variable (//.Operation anchor expression directive)))
variable)
- (: (All [anchor statement]
- (-> Name (//.Operation anchor expression statement)))
+ (: (All [anchor directive]
+ (-> Name (//.Operation anchor expression directive)))
constant)
- (: (All [anchor statement]
- (-> Reference (//.Operation anchor expression statement)))
+ (: (All [anchor directive]
+ (-> Reference (//.Operation anchor expression directive)))
reference))
(def: (variable-maker prefix variable)
@@ -54,8 +54,8 @@
variable (:share [expression]
{(-> Text expression)
variable}
- {(All [anchor statement]
- (-> Variable (//.Operation anchor expression statement)))
+ {(All [anchor directive]
+ (-> Variable (//.Operation anchor expression directive)))
(|>> (case> (#////reference.Local register)
(local register)
@@ -65,8 +65,8 @@
constant (:share [expression]
{(-> Text expression)
constant}
- {(All [anchor statement]
- (-> Name (//.Operation anchor expression statement)))
+ {(All [anchor directive]
+ (-> Name (//.Operation anchor expression directive)))
(|>> //.remember (///@map constant))})]
(structure
(def: local local)