diff options
author | Eduardo Julian | 2019-03-18 21:08:32 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-03-18 21:08:32 -0400 |
commit | 11d6d0076f1384c7713e0e055dc1e8fbad4197ad (patch) | |
tree | 86224028d319ef7ba41ec3164a7044872567b47b /stdlib/source/lux/tool | |
parent | 285de1ae1925c2b030bd96032498ccbaa6fc90c9 (diff) |
Changed how compiler output is accumulated to ensure correct order when generating the final executable file.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/tool/compiler/meta/packager/script.lux | 22 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/generation.lux | 20 |
2 files changed, 20 insertions, 22 deletions
diff --git a/stdlib/source/lux/tool/compiler/meta/packager/script.lux b/stdlib/source/lux/tool/compiler/meta/packager/script.lux index e51afe7a2..ac4582346 100644 --- a/stdlib/source/lux/tool/compiler/meta/packager/script.lux +++ b/stdlib/source/lux/tool/compiler/meta/packager/script.lux @@ -1,13 +1,13 @@ (.module: [lux #* [data + ["." product] ["." text format ["." encoding]] [collection - ["." dictionary] ["." row] - ["." list ("#@." functor fold)]]] + ["." list ("#@." monad fold)]]] [host ["_" js]] [tool @@ -21,18 +21,16 @@ (All [statements] (-> (Output statements) Binary)) (|> outputs - dictionary.entries + row.to-list (list@map (function (_ [module buffer]) (|> buffer row.to-list (:coerce (List [Name _.Statement])) - (list@fold (function (_ [artifact content] pre!) - (|> content - (_.comment (%name artifact)) - (_.then pre!))) - (_.comment module - _.use-strict)) - (: _.Statement) - _.code))) - (text.join-with text.new-line) + (list@map product.right)))) + list@join + (list@fold (function (_ post! pre!) + (_.then pre! post!)) + _.use-strict) + (: _.Statement) + _.code encoding.to-utf8)) diff --git a/stdlib/source/lux/tool/compiler/phase/generation.lux b/stdlib/source/lux/tool/compiler/phase/generation.lux index 203c5d4ab..a22077df4 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation.lux +++ b/stdlib/source/lux/tool/compiler/phase/generation.lux @@ -1,5 +1,5 @@ (.module: - [lux #* + [lux (#- Module) [control [monad (#+ do)] ["." exception (#+ exception:)]] @@ -11,13 +11,14 @@ format] [collection ["." row (#+ Row)] - ["." dictionary (#+ Dictionary)]]] - [world - [file (#+ Path)]]] + ["." dictionary (#+ Dictionary)]]]] ["." // ["." extension] [// - [synthesis (#+ Synthesis)]]]) + [synthesis (#+ Synthesis)] + [meta + [archive + [descriptor (#+ Module)]]]]]) (exception: #export (cannot-interpret {error Text}) (exception.report @@ -57,8 +58,7 @@ define!)) (type: #export (Buffer statement) (Row [Name statement])) - -(type: #export (Output statement) (Dictionary Path (Buffer statement))) +(type: #export (Output statement) (Row [Module (Buffer statement)])) (type: #export (State anchor expression statement) {#context Context @@ -89,7 +89,7 @@ #anchor #.None #host host #buffer #.None - #output (dictionary.new text.hash) + #output row.empty #counter 0 #name-cache (dictionary.new name.hash)}) @@ -224,10 +224,10 @@ (def: #export (save-buffer! target) (All [anchor expression statement] - (-> Path (Operation anchor expression statement Any))) + (-> Module (Operation anchor expression statement Any))) (do //.monad [buffer ..buffer] - (extension.update (update@ #output (dictionary.put target buffer))))) + (extension.update (update@ #output (row.add [target buffer]))))) (def: #export (remember lux-name) (All [anchor expression statement] |