aboutsummaryrefslogtreecommitdiff
path: root/lux-lua
diff options
context:
space:
mode:
Diffstat (limited to 'lux-lua')
-rw-r--r--lux-lua/source/program.lux23
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)