aboutsummaryrefslogtreecommitdiff
path: root/lux-js
diff options
context:
space:
mode:
authorEduardo Julian2022-02-19 08:03:44 -0400
committerEduardo Julian2022-02-19 08:03:44 -0400
commit23f6d4d19c7f5d1f5b4f6db8a72cf52388689357 (patch)
tree1e6e73ceacb4280ed976752fbda6ce8ced2cdae1 /lux-js
parente3986e8a7b9a997441477cdb333d3a8537dc49fb (diff)
Optimizations for the pure-Lux JVM compiler. [Part 3]
Diffstat (limited to 'lux-js')
-rw-r--r--lux-js/source/program.lux46
1 files changed, 22 insertions, 24 deletions
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux
index 36e2fd023..b670da4fa 100644
--- a/lux-js/source/program.lux
+++ b/lux-js/source/program.lux
@@ -60,13 +60,13 @@
["[0]" platform {"+" Platform}]]
[meta
["[0]" cli]
+ ["[0]" context]
[archive {"+" Archive}
["[0]" unit]]
["[0]" packager "_"
["[1]" script]]]]]]]
[program
- ["/" compositor
- ["[1][0]" static]]])
+ ["/" compositor]])
(exception: (null_has_no_lux_representation [code (Maybe _.Expression)])
(case code
@@ -671,26 +671,24 @@
(list))))
(program: [service cli.service]
- (let [extension ".js"]
- (exec (do async.monad
- [platform (async.future ..platform)
- _ (/.compiler [/static.#host @.js
- /static.#host_module_extension extension
- /static.#target (cli.target service)
- /static.#artifact_extension extension]
- ..expander
- analysis.bundle
- (io.io platform)
- generation.bundle
- (function.constant extension/bundle.empty)
- ..program
- [(And Register Text) _.Expression _.Statement]
- ..extender
- service
- [(packager.package _.use_strict _.code _.then ..scope)
- (format (cli.target service)
- (# (value@ platform.#&file_system platform) separator)
- "program"
- extension)])]
- (..declare_success! []))
+ (let [context (context.js (cli.target service))]
+ (exec
+ (do async.monad
+ [platform (async.future ..platform)
+ _ (/.compiler context
+ ..expander
+ analysis.bundle
+ (io.io platform)
+ generation.bundle
+ (function.constant extension/bundle.empty)
+ ..program
+ [(And Register Text) _.Expression _.Statement]
+ ..extender
+ service
+ [(packager.package _.use_strict _.code _.then ..scope)
+ (format (cli.target service)
+ (# (value@ platform.#&file_system platform) separator)
+ "program"
+ (value@ context.#artifact_extension context))])]
+ (..declare_success! []))
(io.io []))))