diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/tool/interpreter.lux | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/stdlib/source/library/lux/tool/interpreter.lux b/stdlib/source/library/lux/tool/interpreter.lux index 8cf01011c..a5e907a52 100644 --- a/stdlib/source/library/lux/tool/interpreter.lux +++ b/stdlib/source/library/lux/tool/interpreter.lux @@ -1,33 +1,33 @@ (.using - [library - [lux "*" - [control - [monad {"+" Monad do}] - ["[0]" try {"+" Try}] - ["ex" exception {"+" exception:}]] - [data - ["[0]" text ("[1]#[0]" equivalence) - ["%" format {"+" format}]]] - [type {"+" :sharing} - ["[0]" check]] - [compiler - ["[0]" phase - ["[0]" analysis - ["[0]" module] - ["[0]" type]] - ["[0]" generation] - ["[0]" directive {"+" State+ Operation} - ["[0]" total]] - ["[0]" extension]] - ["[0]" default - ["[0]" syntax] - ["[0]" platform {"+" Platform}] - ["[0]" init]] - ["[0]" cli {"+" Configuration}]] - [world - ["[0]" file {"+" File}] - ["[0]" console {"+" Console}]]]] - ["[0]" /type]) + [library + [lux "*" + [control + [monad {"+" Monad do}] + ["[0]" try {"+" Try}] + ["ex" exception {"+" exception:}]] + [data + ["[0]" text ("[1]#[0]" equivalence) + ["%" format {"+" format}]]] + [type {"+" :sharing} + ["[0]" check]] + [compiler + ["[0]" phase + ["[0]" analysis + ["[0]" module] + ["[0]" type]] + ["[0]" generation] + ["[0]" directive {"+" State+ Operation} + ["[0]" total]] + ["[0]" extension]] + ["[0]" default + ["[0]" syntax] + ["[0]" platform {"+" Platform}] + ["[0]" init]] + ["[0]" cli {"+" Configuration}]] + [world + ["[0]" file {"+" File}] + ["[0]" console {"+" Console}]]]] + ["[0]" /type]) (exception: .public (error [message Text]) message) @@ -75,14 +75,14 @@ (do Monad<!> [state (platform.initialize platform generation_bundle) state (platform.compile platform - (with@ cli.#module syntax.prelude configuration) - (with@ [extension.#state - directive.#analysis directive.#state - extension.#state - .#info .#mode] - {.#Interpreter} - state)) - [state _] (# (value@ platform.#file_system platform) + (has cli.#module syntax.prelude configuration) + (has [extension.#state + directive.#analysis directive.#state + extension.#state + .#info .#mode] + {.#Interpreter} + state)) + [state _] (# (the platform.#file_system platform) lift (phase.result' state enter_module)) _ (# Console<!> write ..welcome_message)] (in state))) @@ -102,9 +102,9 @@ (-> Code <Interpretation>)) (do [! phase.monad] [state (extension.lifted phase.state) - .let [analyse (value@ [directive.#analysis directive.#phase] state) - synthesize (value@ [directive.#synthesis directive.#phase] state) - generate (value@ [directive.#generation directive.#phase] state)] + .let [analyse (the [directive.#analysis directive.#phase] state) + synthesize (the [directive.#synthesis directive.#phase] state) + generate (the [directive.#generation directive.#phase] state)] [_ codeT codeA] (directive.lifted_analysis (analysis.with_scope (type.with_fresh_env @@ -156,10 +156,10 @@ (do phase.monad [[codeT codeV] (interpret configuration code) state phase.state] - (in (/type.represent (value@ [extension.#state - directive.#analysis directive.#state - extension.#state] - state) + (in (/type.represent (the [extension.#state + directive.#analysis directive.#state + extension.#state] + state) codeT codeV)))) @@ -174,15 +174,15 @@ (All (_ anchor expression directive) (-> <Context> (Try [<Context> Text]))) (do try.monad - [.let [[_where _offset _code] (value@ #source context)] - [source' input] (syntax.parse ..module syntax.no_aliases (text.size _code) (value@ #source context)) + [.let [[_where _offset _code] (the #source context)] + [source' input] (syntax.parse ..module syntax.no_aliases (text.size _code) (the #source context)) [state' representation] (let [... TODO: Simplify ASAP state (:sharing [anchor expression directive] <Context> context (State+ anchor expression directive) - (value@ #state context))] + (the #state context))] (<| (phase.result' state) ... TODO: Simplify ASAP (:sharing [anchor expression directive] @@ -190,10 +190,10 @@ context (Operation anchor expression directive Text) - (execute (value@ #configuration context) input))))] + (execute (the #configuration context) input))))] (in [(|> context - (with@ #state state') - (with@ #source source')) + (has #state state') + (has #source source')) representation])))) (def: .public (run! Monad<!> Console<!> platform configuration generation_bundle) @@ -217,7 +217,7 @@ (if (and (not multi_line?) (text#= ..exit_command line)) (# Console<!> write ..farewell_message) - (case (read_eval_print (revised@ #source (add_line line) context)) + (case (read_eval_print (revised #source (add_line line) context)) {try.#Success [context' representation]} (do ! [_ (# Console<!> write representation)] @@ -227,5 +227,5 @@ (if (ex.match? syntax.end_of_file error) (again context #1) (exec (log! (ex.error ..error error)) - (again (with@ #source ..fresh_source context) #0)))))) + (again (has #source ..fresh_source context) #0)))))) ))) |