diff options
author | Eduardo Julian | 2021-02-10 19:04:18 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-02-10 19:04:18 -0400 |
commit | a5e2f99430384fff580646a553b1e8ae27e07acd (patch) | |
tree | 185681c6b41cec359a20cbb094e33048cbec921b /lux-lua/source | |
parent | d99c47989a1047cd24019fd5ce434e701b5d3519 (diff) |
Continuing with Lua
Diffstat (limited to '')
-rw-r--r-- | lux-lua/source/program.lux | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index fc0e15eeb..517d0e746 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -374,7 +374,7 @@ (run! (_.return (_.var (reference.artifact context))))))))]))) (def: platform - (IO [Baggage (Platform _.Var _.Expression _.Statement)]) + (IO [Baggage (Platform [Register _.Label] _.Expression _.Statement)]) (do io.monad [[baggage host] ..host] (wrap [baggage @@ -386,9 +386,13 @@ (def: (program context program) (Program _.Expression _.Statement) - (_.statement (_.apply/* (list (runtime.lux//program_args (_.var "arg")) - _.nil) - program))) + (let [$program (_.var (reference.artifact context))] + ($_ _.then + (_.function $program (list) + (_.statement (_.apply/* (list (runtime.lux//program_args (_.var "arg")) + runtime.unit) + program))) + (_.statement (_.apply/* (list) $program))))) (for {@.old (def: (extender [state_context executor]) @@ -433,11 +437,12 @@ (-> Any (Promise Any)) (promise.future (\ world/program.default exit +0))) -(def: scope +(def: (scope program) (-> _.Statement _.Statement) - (|>> (_.closure (list)) - (_.apply/* (list)) - _.statement)) + (let [$program (_.var "lux_program")] + ($_ _.then + (_.function $program (list) program) + (_.statement (_.apply/* (list) $program))))) (program: [{service /cli.service}] (let [extension ".lua"] @@ -454,7 +459,7 @@ generation.bundle extension/bundle.empty ..program - [_.Var _.Expression _.Statement] + [(& Register _.Label) _.Expression _.Statement] (..extender baggage) service [(packager.package (_.manual "") _.code _.then ..scope) |