From 5dbf134346424602b0104d1f749c1a9eac6f21af Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 12 Jan 2021 17:31:48 -0400 Subject: Compiler now shows suggestions when encountering unknown definitions. --- lux-js/source/program.lux | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'lux-js') diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux index c923aace5..48392d358 100644 --- a/lux-js/source/program.lux +++ b/lux-js/source/program.lux @@ -562,8 +562,8 @@ #platform.runtime runtime.generate #platform.write (|>> _.code (\ encoding.utf8 encode))}))) -(def: (program namer context program) - (-> (-> Context Text) (Program _.Expression _.Statement)) +(def: (program context program) + (-> (Program _.Expression _.Statement)) (let [@process (_.var "process") on_node_js? (|> (|> @process _.type_of (_.= (_.string "undefined")) _.not) (_.and (|> @process (_.the "argv")))) @@ -619,21 +619,25 @@ (list)))) (program: [{service /cli.service}] - (exec (do promise.monad - [_ (/.compiler {#/static.host @.js - #/static.host_module_extension ".js" - #/static.target (/cli.target service) - #/static.artifact_extension ".js"} - ..expander - analysis.bundle - ..platform - generation.bundle - extension/bundle.empty - (..program reference.artifact) - [(& Register Text) _.Expression _.Statement] - ..extender - service - [(packager.package _.use_strict _.code _.then ..scope) - (format (/cli.target service) (\ file.default separator) "program.js")])] - (..declare_success! [])) - (io.io []))) + (let [extension ".js"] + (exec (do promise.monad + [_ (/.compiler {#/static.host @.js + #/static.host_module_extension extension + #/static.target (/cli.target service) + #/static.artifact_extension extension} + ..expander + analysis.bundle + ..platform + generation.bundle + extension/bundle.empty + ..program + [(& Register Text) _.Expression _.Statement] + ..extender + service + [(packager.package _.use_strict _.code _.then ..scope) + (format (/cli.target service) + (\ file.default separator) + "program" + extension)])] + (..declare_success! [])) + (io.io [])))) -- cgit v1.2.3