From 54b69afa96cd00b174b07c3f23b496b5e5b63858 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 17 Mar 2019 22:19:06 -0400 Subject: Now compiling program statements. --- lux-js/source/program.lux | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lux-js/source') 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)) -- cgit v1.2.3