aboutsummaryrefslogtreecommitdiff
path: root/lux-js/source
diff options
context:
space:
mode:
authorEduardo Julian2019-03-17 22:19:06 -0400
committerEduardo Julian2019-03-17 22:19:06 -0400
commit54b69afa96cd00b174b07c3f23b496b5e5b63858 (patch)
tree79b89aeb923b6212de76379beb6c823d39d4af3a /lux-js/source
parenta6f04f38c0170e93e8f1ab2cfcde3cbf59f88b0b (diff)
Now compiling program statements.
Diffstat (limited to 'lux-js/source')
-rw-r--r--lux-js/source/program.lux17
1 files changed, 16 insertions, 1 deletions
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux
index f927a0cef..9cd93a9eb 100644
--- a/lux-js/source/program.lux
+++ b/lux-js/source/program.lux
@@ -483,5 +483,20 @@
#platform.phase js.generate
#platform.runtime runtime.generate})))
+(def: (program program)
+ (-> _.Expression _.Statement)
+ (let [@process (_.var "process")
+ raw-inputs (_.? (|> (|> @process _.type-of (_.= (_.string "undefined")) _.not)
+ (_.and (|> @process (_.the "argv"))))
+ (|> @process (_.the "argv"))
+ (_.array (list)))]
+ (_.statement (_.apply/2 program
+ (runtime.lux//program-args raw-inputs)
+ _.null))))
+
(program: [{service /cli.service}]
- (/.compiler ..expander ..platform extension.bundle service))
+ (/.compiler ..expander
+ ..platform
+ extension.bundle
+ ..program
+ service))