firefly-compiler 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/.hintrc +4 -4
  2. package/README.md +1 -1
  3. package/core/HttpClient.ff +1 -1
  4. package/lsp/LanguageServer.ff +32 -7
  5. package/lsp/stderr.txt +1 -0
  6. package/lsp/stdin.txt +11 -0
  7. package/lsp/stdout.txt +41 -0
  8. package/lux/Main.ff +56 -2
  9. package/meetup/AutoCompletion.ff +6 -0
  10. package/output/js/ff/compiler/Builder.mjs +444 -444
  11. package/output/js/ff/compiler/Compiler.mjs +416 -416
  12. package/output/js/ff/compiler/Dependencies.mjs +389 -389
  13. package/output/js/ff/compiler/Deriver.mjs +1170 -1170
  14. package/output/js/ff/compiler/Dictionaries.mjs +1309 -1309
  15. package/output/js/ff/compiler/Environment.mjs +1015 -1015
  16. package/output/js/ff/compiler/Inference.mjs +4268 -4268
  17. package/output/js/ff/compiler/JsEmitter.mjs +5391 -5391
  18. package/output/js/ff/compiler/JsImporter.mjs +266 -266
  19. package/output/js/ff/compiler/LspHook.mjs +793 -793
  20. package/output/js/ff/compiler/Main.mjs +1675 -1675
  21. package/output/js/ff/compiler/Parser.mjs +4008 -4008
  22. package/output/js/ff/compiler/Patterns.mjs +927 -927
  23. package/output/js/ff/compiler/Resolver.mjs +2307 -2307
  24. package/output/js/ff/compiler/Substitution.mjs +1150 -1150
  25. package/output/js/ff/compiler/Syntax.mjs +12434 -12434
  26. package/output/js/ff/compiler/Token.mjs +3096 -3096
  27. package/output/js/ff/compiler/Tokenizer.mjs +593 -593
  28. package/output/js/ff/compiler/Unification.mjs +1752 -1752
  29. package/output/js/ff/compiler/Wildcards.mjs +608 -608
  30. package/output/js/ff/compiler/Workspace.mjs +687 -687
  31. package/output/js/ff/core/Any.mjs +143 -143
  32. package/output/js/ff/core/Array.mjs +547 -547
  33. package/output/js/ff/core/AssetSystem.mjs +274 -274
  34. package/output/js/ff/core/Atomic.mjs +154 -154
  35. package/output/js/ff/core/Bool.mjs +152 -152
  36. package/output/js/ff/core/Box.mjs +112 -112
  37. package/output/js/ff/core/BrowserSystem.mjs +126 -126
  38. package/output/js/ff/core/Buffer.mjs +395 -395
  39. package/output/js/ff/core/BuildSystem.mjs +296 -296
  40. package/output/js/ff/core/Channel.mjs +189 -189
  41. package/output/js/ff/core/Char.mjs +149 -149
  42. package/output/js/ff/core/Core.mjs +300 -300
  43. package/output/js/ff/core/Duration.mjs +116 -116
  44. package/output/js/ff/core/Equal.mjs +179 -179
  45. package/output/js/ff/core/Error.mjs +142 -142
  46. package/output/js/ff/core/FileHandle.mjs +150 -150
  47. package/output/js/ff/core/Float.mjs +225 -225
  48. package/output/js/ff/core/HttpClient.mjs +190 -190
  49. package/output/js/ff/core/Instant.mjs +109 -109
  50. package/output/js/ff/core/Int.mjs +265 -265
  51. package/output/js/ff/core/IntMap.mjs +280 -280
  52. package/output/js/ff/core/JsSystem.mjs +238 -238
  53. package/output/js/ff/core/JsValue.mjs +708 -708
  54. package/output/js/ff/core/List.mjs +2334 -2334
  55. package/output/js/ff/core/Lock.mjs +229 -229
  56. package/output/js/ff/core/Log.mjs +163 -163
  57. package/output/js/ff/core/Map.mjs +362 -362
  58. package/output/js/ff/core/NodeSystem.mjs +294 -294
  59. package/output/js/ff/core/Nothing.mjs +104 -104
  60. package/output/js/ff/core/Option.mjs +1015 -1015
  61. package/output/js/ff/core/Ordering.mjs +730 -730
  62. package/output/js/ff/core/Pair.mjs +331 -331
  63. package/output/js/ff/core/Path.mjs +545 -545
  64. package/output/js/ff/core/RbMap.mjs +1940 -1940
  65. package/output/js/ff/core/Serializable.mjs +428 -428
  66. package/output/js/ff/core/Set.mjs +254 -254
  67. package/output/js/ff/core/Show.mjs +205 -205
  68. package/output/js/ff/core/SourceLocation.mjs +229 -229
  69. package/output/js/ff/core/Stack.mjs +529 -529
  70. package/output/js/ff/core/Stream.mjs +1304 -1304
  71. package/output/js/ff/core/String.mjs +365 -365
  72. package/output/js/ff/core/StringMap.mjs +280 -280
  73. package/output/js/ff/core/Task.mjs +320 -320
  74. package/output/js/ff/core/Try.mjs +507 -507
  75. package/output/js/ff/core/Unit.mjs +151 -151
  76. package/package.json +29 -29
  77. package/vscode/package-lock.json +5 -5
  78. package/vscode/package.json +1 -1
@@ -1,140 +1,140 @@
1
- import * as import$0 from 'url';
2
-
3
- import * as ff_compiler_Main from "../../ff/compiler/Main.mjs"
4
-
5
- import * as ff_compiler_Builder from "../../ff/compiler/Builder.mjs"
6
-
7
- import * as ff_compiler_Compiler from "../../ff/compiler/Compiler.mjs"
8
-
9
- import * as ff_compiler_Dependencies from "../../ff/compiler/Dependencies.mjs"
10
-
11
- import * as ff_compiler_Inference from "../../ff/compiler/Inference.mjs"
12
-
13
- import * as ff_compiler_JsEmitter from "../../ff/compiler/JsEmitter.mjs"
14
-
15
- import * as ff_compiler_LspHook from "../../ff/compiler/LspHook.mjs"
16
-
17
- import * as ff_compiler_Parser from "../../ff/compiler/Parser.mjs"
18
-
19
- import * as ff_compiler_Resolver from "../../ff/compiler/Resolver.mjs"
20
-
21
- import * as ff_compiler_Syntax from "../../ff/compiler/Syntax.mjs"
22
-
23
- import * as ff_compiler_Tokenizer from "../../ff/compiler/Tokenizer.mjs"
24
-
25
- import * as ff_compiler_Unification from "../../ff/compiler/Unification.mjs"
26
-
27
- import * as ff_core_Any from "../../ff/core/Any.mjs"
28
-
29
- import * as ff_core_Array from "../../ff/core/Array.mjs"
30
-
31
- import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
32
-
33
- import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
34
-
35
- import * as ff_core_Bool from "../../ff/core/Bool.mjs"
36
-
37
- import * as ff_core_Box from "../../ff/core/Box.mjs"
38
-
39
- import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
40
-
41
- import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
42
-
43
- import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
44
-
45
- import * as ff_core_Channel from "../../ff/core/Channel.mjs"
46
-
47
- import * as ff_core_Char from "../../ff/core/Char.mjs"
48
-
49
- import * as ff_core_Core from "../../ff/core/Core.mjs"
50
-
51
- import * as ff_core_Duration from "../../ff/core/Duration.mjs"
52
-
53
- import * as ff_core_Equal from "../../ff/core/Equal.mjs"
54
-
55
- import * as ff_core_Error from "../../ff/core/Error.mjs"
56
-
57
- import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
58
-
59
- import * as ff_core_Float from "../../ff/core/Float.mjs"
60
-
61
- import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
62
-
63
- import * as ff_core_Instant from "../../ff/core/Instant.mjs"
64
-
65
- import * as ff_core_Int from "../../ff/core/Int.mjs"
66
-
67
- import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
68
-
69
- import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
70
-
71
- import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
72
-
73
- import * as ff_core_List from "../../ff/core/List.mjs"
74
-
75
- import * as ff_core_Lock from "../../ff/core/Lock.mjs"
76
-
77
- import * as ff_core_Log from "../../ff/core/Log.mjs"
78
-
79
- import * as ff_core_Map from "../../ff/core/Map.mjs"
80
-
81
- import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
82
-
83
- import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
84
-
85
- import * as ff_core_Option from "../../ff/core/Option.mjs"
86
-
87
- import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
88
-
89
- import * as ff_core_Pair from "../../ff/core/Pair.mjs"
90
-
91
- import * as ff_core_Path from "../../ff/core/Path.mjs"
92
-
93
- import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
94
-
95
- import * as ff_core_Set from "../../ff/core/Set.mjs"
96
-
97
- import * as ff_core_Show from "../../ff/core/Show.mjs"
98
-
99
- import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
100
-
101
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
102
-
103
- import * as ff_core_Stream from "../../ff/core/Stream.mjs"
104
-
105
- import * as ff_core_String from "../../ff/core/String.mjs"
106
-
107
- import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
108
-
109
- import * as ff_core_Task from "../../ff/core/Task.mjs"
110
-
111
- import * as ff_core_Try from "../../ff/core/Try.mjs"
112
-
113
- import * as ff_core_Unit from "../../ff/core/Unit.mjs"
114
-
115
- // type MainCommand
116
- const BootstrapCommand$ = {BootstrapCommand: true};
117
- export function BootstrapCommand() {
118
- return BootstrapCommand$;
119
- }
120
- export function RunCommand(mainPath_, argument_) {
121
- return {RunCommand: true, mainPath_, argument_};
122
- }
123
- export function BrowserCommand(mainPath_) {
124
- return {BrowserCommand: true, mainPath_};
125
- }
126
- export function BuildCommand(mainPath_) {
127
- return {BuildCommand: true, mainPath_};
128
- }
129
- export function CheckCommand(filePath_) {
130
- return {CheckCommand: true, filePath_};
131
- }
132
-
133
- // type CommandLineError
134
- export function CommandLineError(problem_) {
135
- return {problem_};
136
- }
137
-
1
+ import * as import$0 from 'url';
2
+
3
+ import * as ff_compiler_Main from "../../ff/compiler/Main.mjs"
4
+
5
+ import * as ff_compiler_Builder from "../../ff/compiler/Builder.mjs"
6
+
7
+ import * as ff_compiler_Compiler from "../../ff/compiler/Compiler.mjs"
8
+
9
+ import * as ff_compiler_Dependencies from "../../ff/compiler/Dependencies.mjs"
10
+
11
+ import * as ff_compiler_Inference from "../../ff/compiler/Inference.mjs"
12
+
13
+ import * as ff_compiler_JsEmitter from "../../ff/compiler/JsEmitter.mjs"
14
+
15
+ import * as ff_compiler_LspHook from "../../ff/compiler/LspHook.mjs"
16
+
17
+ import * as ff_compiler_Parser from "../../ff/compiler/Parser.mjs"
18
+
19
+ import * as ff_compiler_Resolver from "../../ff/compiler/Resolver.mjs"
20
+
21
+ import * as ff_compiler_Syntax from "../../ff/compiler/Syntax.mjs"
22
+
23
+ import * as ff_compiler_Tokenizer from "../../ff/compiler/Tokenizer.mjs"
24
+
25
+ import * as ff_compiler_Unification from "../../ff/compiler/Unification.mjs"
26
+
27
+ import * as ff_core_Any from "../../ff/core/Any.mjs"
28
+
29
+ import * as ff_core_Array from "../../ff/core/Array.mjs"
30
+
31
+ import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
32
+
33
+ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
34
+
35
+ import * as ff_core_Bool from "../../ff/core/Bool.mjs"
36
+
37
+ import * as ff_core_Box from "../../ff/core/Box.mjs"
38
+
39
+ import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
40
+
41
+ import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
42
+
43
+ import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
44
+
45
+ import * as ff_core_Channel from "../../ff/core/Channel.mjs"
46
+
47
+ import * as ff_core_Char from "../../ff/core/Char.mjs"
48
+
49
+ import * as ff_core_Core from "../../ff/core/Core.mjs"
50
+
51
+ import * as ff_core_Duration from "../../ff/core/Duration.mjs"
52
+
53
+ import * as ff_core_Equal from "../../ff/core/Equal.mjs"
54
+
55
+ import * as ff_core_Error from "../../ff/core/Error.mjs"
56
+
57
+ import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
58
+
59
+ import * as ff_core_Float from "../../ff/core/Float.mjs"
60
+
61
+ import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
62
+
63
+ import * as ff_core_Instant from "../../ff/core/Instant.mjs"
64
+
65
+ import * as ff_core_Int from "../../ff/core/Int.mjs"
66
+
67
+ import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
68
+
69
+ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
70
+
71
+ import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
72
+
73
+ import * as ff_core_List from "../../ff/core/List.mjs"
74
+
75
+ import * as ff_core_Lock from "../../ff/core/Lock.mjs"
76
+
77
+ import * as ff_core_Log from "../../ff/core/Log.mjs"
78
+
79
+ import * as ff_core_Map from "../../ff/core/Map.mjs"
80
+
81
+ import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
82
+
83
+ import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
84
+
85
+ import * as ff_core_Option from "../../ff/core/Option.mjs"
86
+
87
+ import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
88
+
89
+ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
90
+
91
+ import * as ff_core_Path from "../../ff/core/Path.mjs"
92
+
93
+ import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
94
+
95
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
96
+
97
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
98
+
99
+ import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
100
+
101
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
102
+
103
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
104
+
105
+ import * as ff_core_String from "../../ff/core/String.mjs"
106
+
107
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
108
+
109
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
110
+
111
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
112
+
113
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
114
+
115
+ // type MainCommand
116
+ const BootstrapCommand$ = {BootstrapCommand: true};
117
+ export function BootstrapCommand() {
118
+ return BootstrapCommand$;
119
+ }
120
+ export function RunCommand(mainPath_, argument_) {
121
+ return {RunCommand: true, mainPath_, argument_};
122
+ }
123
+ export function BrowserCommand(mainPath_) {
124
+ return {BrowserCommand: true, mainPath_};
125
+ }
126
+ export function BuildCommand(mainPath_) {
127
+ return {BuildCommand: true, mainPath_};
128
+ }
129
+ export function CheckCommand(filePath_) {
130
+ return {CheckCommand: true, filePath_};
131
+ }
132
+
133
+ // type CommandLineError
134
+ export function CommandLineError(problem_) {
135
+ return {problem_};
136
+ }
137
+
138
138
  export const usageString_ = `
139
139
  usage: firefly <main-file> [<main-arguments>] | <command> [<command-arguments>]
140
140
 
@@ -144,666 +144,666 @@ These are the commands:
144
144
  build <main-file> Build the main file
145
145
  check <firefly-file> Check the firefly source file for errors
146
146
  bootstrap Bootstrap the compiler
147
- `;
148
-
149
- export function main_(system_) {
150
- const fireflyPath_ = ff_compiler_Main.detectFireflyPath_(system_);
151
- function buildScript_(mainFile_, mainPackagePair_, emitTarget_, resolvedDependencies_) {
152
- const fixedPackagePaths_ = (ff_core_Map.Map_contains(resolvedDependencies_.packagePaths_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair)
153
- ? resolvedDependencies_.packagePaths_
154
- : ff_core_Map.Map_add(resolvedDependencies_.packagePaths_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_core_Path.Path_slash(fireflyPath_, "core"), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair));
155
- const compilerModulePath_ = ((ff_core_Equal.notEquals_(emitTarget_, ff_compiler_JsEmitter.EmitBrowser(), ff_compiler_JsEmitter.ff_core_Equal_Equal$ff_compiler_JsEmitter_EmitTarget) && ff_core_Equal.notEquals_(emitTarget_, ff_compiler_JsEmitter.EmitExecutable(), ff_compiler_JsEmitter.ff_core_Equal_Equal$ff_compiler_JsEmitter_EmitTarget))
156
- ? ff_core_Option.Some(ff_core_Path.Path_slash(ff_core_Path.Path_slash(ff_core_Path.Path_slash(ff_core_Path.Path_slash(fireflyPath_, "output"), "js"), "ff"), "compiler/Builder.mjs"))
157
- : ff_core_Option.None());
158
- const targetName_ = (((_1) => {
159
- {
160
- if(_1.EmitBuild) {
161
- return "build"
162
- return
163
- }
164
- }
165
- {
166
- if(_1.EmitNode) {
167
- return "node"
168
- return
169
- }
170
- }
171
- {
172
- if(_1.EmitBrowser) {
173
- return "browser"
174
- return
175
- }
176
- }
177
- {
178
- if(_1.EmitExecutable) {
179
- return "executable"
180
- return
181
- }
182
- }
183
- }))(emitTarget_);
184
- ff_compiler_Builder.build_(system_, emitTarget_, mainPackagePair_, mainFile_, (((_c) => {
185
- return ff_compiler_Dependencies.ResolvedDependencies(_c.mainPackagePair_, _c.packages_, fixedPackagePaths_, _c.singleFilePackages_)
186
- }))(resolvedDependencies_), compilerModulePath_, ff_core_Path.Path_slash(ff_core_NodeSystem.NodeSystem_path(system_, ".firefly"), "temporary"), ff_core_Path.Path_path(ff_core_Path.Path_path(ff_core_NodeSystem.NodeSystem_path(system_, ".firefly"), "output"), targetName_), false)
187
- }
188
- function runCommand_(command_) {
189
- {
190
- const command_a = command_;
191
- {
192
- if(command_a.RunCommand) {
193
- const mainFile_ = command_a.mainPath_;
194
- const arguments_ = command_a.argument_;
195
- const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
196
- ff_compiler_Main.prepareFireflyDirectory_(ff_core_NodeSystem.NodeSystem_path(system_, "."));
197
- const localMainFile_ = ff_core_Path.Path_base(ff_core_NodeSystem.NodeSystem_path(system_, mainFile_));
198
- buildScript_(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitNode(), resolvedDependencies_);
199
- ff_compiler_Main.importAndRun_(fireflyPath_, "node", resolvedDependencies_.mainPackagePair_, localMainFile_, arguments_)
200
- return
201
- }
202
- }
203
- {
204
- if(command_a.BrowserCommand) {
205
- const mainFile_ = command_a.mainPath_;
206
- const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
207
- ff_compiler_Main.prepareFireflyDirectory_(ff_core_NodeSystem.NodeSystem_path(system_, "."));
208
- const localMainFile_ = ff_core_Path.Path_base(ff_core_NodeSystem.NodeSystem_path(system_, mainFile_));
209
- buildScript_(mainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBrowser(), resolvedDependencies_);
210
- ff_compiler_Main.bundleForBrowser_(system_, resolvedDependencies_.mainPackagePair_, localMainFile_)
211
- return
212
- }
213
- }
214
- {
215
- if(command_a.BuildCommand) {
216
- const mainFile_ = command_a.mainPath_;
217
- const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
218
- ff_compiler_Main.prepareFireflyDirectory_(ff_core_NodeSystem.NodeSystem_path(system_, "."));
219
- const localMainFile_ = ff_core_Path.Path_base(ff_core_NodeSystem.NodeSystem_path(system_, mainFile_));
220
- buildScript_(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBuild(), resolvedDependencies_);
221
- buildScript_(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitExecutable(), resolvedDependencies_);
222
- ff_compiler_Main.bundleForPkg_(system_, resolvedDependencies_.mainPackagePair_, localMainFile_);
223
- ff_compiler_Main.importAndRun_(fireflyPath_, "build", resolvedDependencies_.mainPackagePair_, localMainFile_, ff_core_List.Empty())
224
- return
225
- }
226
- }
227
- {
228
- if(command_a.CheckCommand) {
229
- const filePath_ = command_a.filePath_;
230
- ff_compiler_Builder.check_(system_, fireflyPath_, ff_core_NodeSystem.NodeSystem_path(system_, filePath_), ff_core_Map.empty_(), ff_compiler_LspHook.disabled_(), true)
231
- return
232
- }
233
- }
234
- {
235
- if(command_a.BootstrapCommand) {
236
- const workingDirectory_ = ff_core_NodeSystem.NodeSystem_path(system_, ".");
237
- ff_compiler_Builder.build_(system_, ff_compiler_JsEmitter.EmitNode(), ff_compiler_Syntax.PackagePair("ff", "compiler"), "Main", ff_compiler_Dependencies.ResolvedDependencies(ff_compiler_Syntax.PackagePair("ff", "compiler"), ff_core_List.List_toMap(ff_core_List.Empty(), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "compiler"), ff_core_Path.Path_slash(workingDirectory_, "compiler")), ff_core_List.Link(ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), ff_core_Path.Path_slash(workingDirectory_, "core")), ff_core_List.Empty())), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet(ff_core_List.Empty(), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair)), ff_core_Option.None(), ff_core_Path.Path_slash(ff_core_Path.Path_slash(workingDirectory_, "output"), "temporary"), ff_core_Path.Path_slash(ff_core_Path.Path_slash(workingDirectory_, "output"), "js"), true)
238
- return
239
- }
240
- }
241
- }
242
- }
243
- ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch(ff_core_Core.try_((() => {
244
- const command_ = ff_compiler_Main.parseCommandLine_(ff_core_Array.Array_toList(ff_core_NodeSystem.NodeSystem_arguments(system_)));
245
- return runCommand_(command_)
246
- })), ((_1, _2) => {
247
- {
248
- const message_ = _1.problem_;
249
- const error_ = _2;
250
- ff_core_Log.debug_(message_)
251
- return
252
- }
253
- }), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError), ((_1, _2) => {
254
- {
255
- const at_ = _1.at_;
256
- const message_ = _1.message_;
257
- const error_ = _2;
258
- ff_core_Log.debug_(message_);
259
- ff_core_Log.debug_((((((" at " + ff_core_String.String_replace(at_.file_, "./", "")) + ":") + at_.line_) + ":") + at_.column_))
260
- return
261
- }
262
- }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError))
263
- }
264
-
265
- export function parseCommandLine_(arguments_) {
266
- {
267
- const arguments_a = arguments_;
268
- {
269
- if(arguments_a.Link) {
270
- const mainFile_ = arguments_a.head_;
271
- const mainArguments_ = arguments_a.tail_;
272
- const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
273
- if(_guard1.Some) {
274
- const mainName_ = _guard1.value_;
275
- return ff_compiler_Main.RunCommand(mainName_, mainArguments_)
276
- return
277
- }
278
- }
279
- }
280
- {
281
- if(arguments_a.Link) {
282
- if(arguments_a.head_ == "run") {
283
- const runArguments_ = arguments_a.tail_;
284
- {
285
- const _1 = runArguments_;
286
- {
287
- if(_1.Link) {
288
- const mainFile_ = _1.head_;
289
- const mainArguments_ = _1.tail_;
290
- const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
291
- if(_guard1.Some) {
292
- const mainName_ = _guard1.value_;
293
- return ff_compiler_Main.RunCommand(mainName_, mainArguments_)
294
- return
295
- }
296
- }
297
- }
298
- {
299
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as first argument to run." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
300
- return
301
- }
302
- }
303
- return
304
- }
305
- }
306
- }
307
- {
308
- if(arguments_a.Link) {
309
- if(arguments_a.head_ == "browser") {
310
- const browserArguments_ = arguments_a.tail_;
311
- {
312
- const _1 = browserArguments_;
313
- {
314
- if(_1.Link) {
315
- const mainFile_ = _1.head_;
316
- if(_1.tail_.Empty) {
317
- const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
318
- if(_guard1.Some) {
319
- const mainName_ = _guard1.value_;
320
- return ff_compiler_Main.BrowserCommand(mainName_)
321
- return
322
- }
323
- }
324
- }
325
- }
326
- {
327
- if(_1.Link) {
328
- if(_1.tail_.Link) {
329
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to browser." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
330
- return
331
- }
332
- }
333
- }
334
- {
335
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to browser." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
336
- return
337
- }
338
- }
339
- return
340
- }
341
- }
342
- }
343
- {
344
- if(arguments_a.Link) {
345
- if(arguments_a.head_ == "build") {
346
- const buildArguments_ = arguments_a.tail_;
347
- {
348
- const _1 = buildArguments_;
349
- {
350
- if(_1.Link) {
351
- const mainFile_ = _1.head_;
352
- if(_1.tail_.Empty) {
353
- const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
354
- if(_guard1.Some) {
355
- const mainName_ = _guard1.value_;
356
- return ff_compiler_Main.BuildCommand(mainName_)
357
- return
358
- }
359
- }
360
- }
361
- }
362
- {
363
- if(_1.Link) {
364
- if(_1.tail_.Link) {
365
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
366
- return
367
- }
368
- }
369
- }
370
- {
371
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
372
- return
373
- }
374
- }
375
- return
376
- }
377
- }
378
- }
379
- {
380
- if(arguments_a.Link) {
381
- if(arguments_a.head_ == "check") {
382
- const checkArguments_ = arguments_a.tail_;
383
- {
384
- const _1 = checkArguments_;
385
- {
386
- if(_1.Link) {
387
- const fileName_ = _1.head_;
388
- if(_1.tail_.Empty) {
389
- const _guard1 = ff_core_String.String_removeLast(fileName_, ".ff");
390
- if(_guard1.Some) {
391
- return ff_compiler_Main.CheckCommand(fileName_)
392
- return
393
- }
394
- }
395
- }
396
- }
397
- {
398
- if(_1.Link) {
399
- if(_1.tail_.Link) {
400
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to check." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
401
- return
402
- }
403
- }
404
- }
405
- {
406
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
407
- return
408
- }
409
- }
410
- return
411
- }
412
- }
413
- }
414
- {
415
- if(arguments_a.Link) {
416
- if(arguments_a.head_ == "bootstrap") {
417
- if(arguments_a.tail_.Link) {
418
- if(arguments_a.tail_.tail_.Empty) {
419
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("bootstrap takes no arguments" + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
420
- return
421
- }
422
- }
423
- }
424
- }
425
- }
426
- {
427
- if(arguments_a.Link) {
428
- if(arguments_a.head_ == "bootstrap") {
429
- if(arguments_a.tail_.Empty) {
430
- return ff_compiler_Main.BootstrapCommand()
431
- return
432
- }
433
- }
434
- }
435
- }
436
- {
437
- if(arguments_a.Empty) {
438
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a command or a main file to run." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
439
- return
440
- }
441
- }
442
- {
443
- if(arguments_a.Link) {
444
- const s_ = arguments_a.head_;
445
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(((("Unknown command '" + s_) + "'") + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
446
- return
447
- }
448
- }
449
- }
450
- }
451
-
452
- export function bundleForPkg_(system_, packagePair_, mainFile_) {
453
- const prefix_ = ".firefly/output/executable/";
454
- const mainJsFile_ = ((((prefix_ + ff_compiler_Syntax.PackagePair_groupName(packagePair_, "/")) + "/") + mainFile_) + ".mjs");
455
- const file_ = (prefix_ + "Main.bundle.js");
456
- ff_core_BuildSystem.internalNodeCallEsBuild_(system_, mainJsFile_, file_, false)
457
- }
458
-
459
- export function bundleForBrowser_(system_, packagePair_, mainFile_) {
460
- const prefix_ = ".firefly/output/browser/";
461
- const mainJsFile_ = ((((prefix_ + ff_compiler_Syntax.PackagePair_groupName(packagePair_, "/")) + "/") + mainFile_) + ".mjs");
462
- const file_ = (prefix_ + "Main.bundle.js");
463
- const browserCode_ = ff_core_BuildSystem.BrowserCode(packagePair_.group_, packagePair_.name_, ff_core_NodeSystem.NodeSystem_path(system_, mainFile_), ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair("/", (() => {
464
- return ff_core_Path.Path_readStream(ff_core_NodeSystem.NodeSystem_path(system_, "."))
465
- })), ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)));
466
- ff_core_BuildSystem.internalCallEsBuild_(browserCode_, mainJsFile_, file_, true, true)
467
- }
468
-
469
- export function importAndRun_(fireflyPath_, target_, packagePair_, mainFile_, arguments_) {
470
- throw new Error('Function importAndRun is missing on this target in sync context.');
471
- }
472
-
473
- export function prepareFireflyDirectory_(path_) {
474
- if((!ff_core_Path.Path_exists(ff_core_Path.Path_slash(ff_core_Path.Path_slash(path_, ".firefly"), "output"), false, false, false))) {
475
- if((!ff_core_Path.Path_exists(ff_core_Path.Path_slash(path_, ".firefly"), false, false, false))) {
476
- ff_core_Path.Path_createDirectory(ff_core_Path.Path_slash(path_, ".firefly"), false)
477
- };
478
- ff_core_Path.Path_createDirectory(ff_core_Path.Path_slash(ff_core_Path.Path_slash(path_, ".firefly"), "output"), false)
479
- }
480
- }
481
-
482
- export function detectFireflyPath_(system_) {
483
- throw new Error('Function detectFireflyPath is missing on this target in sync context.');
484
- }
485
-
486
- export async function main_$(system_, $task) {
487
- const fireflyPath_ = (await ff_compiler_Main.detectFireflyPath_$(system_, $task));
488
- async function buildScript_$(mainFile_, mainPackagePair_, emitTarget_, resolvedDependencies_, $task) {
489
- const fixedPackagePaths_ = (ff_core_Map.Map_contains(resolvedDependencies_.packagePaths_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair)
490
- ? resolvedDependencies_.packagePaths_
491
- : ff_core_Map.Map_add(resolvedDependencies_.packagePaths_, ff_compiler_Syntax.PackagePair("ff", "core"), (await ff_core_Path.Path_slash$(fireflyPath_, "core", $task)), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair));
492
- const compilerModulePath_ = ((ff_core_Equal.notEquals_(emitTarget_, ff_compiler_JsEmitter.EmitBrowser(), ff_compiler_JsEmitter.ff_core_Equal_Equal$ff_compiler_JsEmitter_EmitTarget) && ff_core_Equal.notEquals_(emitTarget_, ff_compiler_JsEmitter.EmitExecutable(), ff_compiler_JsEmitter.ff_core_Equal_Equal$ff_compiler_JsEmitter_EmitTarget))
493
- ? ff_core_Option.Some((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(fireflyPath_, "output", $task)), "js", $task)), "ff", $task)), "compiler/Builder.mjs", $task)))
494
- : ff_core_Option.None());
495
- const targetName_ = (((_1) => {
496
- {
497
- if(_1.EmitBuild) {
498
- return "build"
499
- return
500
- }
501
- }
502
- {
503
- if(_1.EmitNode) {
504
- return "node"
505
- return
506
- }
507
- }
508
- {
509
- if(_1.EmitBrowser) {
510
- return "browser"
511
- return
512
- }
513
- }
514
- {
515
- if(_1.EmitExecutable) {
516
- return "executable"
517
- return
518
- }
519
- }
520
- }))(emitTarget_);
521
- (await ff_compiler_Builder.build_$(system_, emitTarget_, mainPackagePair_, mainFile_, (((_c) => {
522
- return ff_compiler_Dependencies.ResolvedDependencies(_c.mainPackagePair_, _c.packages_, fixedPackagePaths_, _c.singleFilePackages_)
523
- }))(resolvedDependencies_), compilerModulePath_, (await ff_core_Path.Path_slash$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".firefly", $task)), "temporary", $task)), (await ff_core_Path.Path_path$((await ff_core_Path.Path_path$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".firefly", $task)), "output", $task)), targetName_, $task)), false, $task))
524
- }
525
- async function runCommand_$(command_, $task) {
526
- {
527
- const command_a = command_;
528
- {
529
- if(command_a.RunCommand) {
530
- const mainFile_ = command_a.mainPath_;
531
- const arguments_ = command_a.argument_;
532
- const resolvedDependencies_ = (await ff_compiler_Dependencies.process_$((await ff_core_NodeSystem.NodeSystem_httpClient$(system_, $task)), (await ff_core_NodeSystem.NodeSystem_path$(system_, (mainFile_ + ".ff"), $task)), $task));
533
- (await ff_compiler_Main.prepareFireflyDirectory_$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task));
534
- const localMainFile_ = (await ff_core_Path.Path_base$((await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), $task));
535
- (await buildScript_$(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitNode(), resolvedDependencies_, $task));
536
- (await ff_compiler_Main.importAndRun_$(fireflyPath_, "node", resolvedDependencies_.mainPackagePair_, localMainFile_, arguments_, $task))
537
- return
538
- }
539
- }
540
- {
541
- if(command_a.BrowserCommand) {
542
- const mainFile_ = command_a.mainPath_;
543
- const resolvedDependencies_ = (await ff_compiler_Dependencies.process_$((await ff_core_NodeSystem.NodeSystem_httpClient$(system_, $task)), (await ff_core_NodeSystem.NodeSystem_path$(system_, (mainFile_ + ".ff"), $task)), $task));
544
- (await ff_compiler_Main.prepareFireflyDirectory_$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task));
545
- const localMainFile_ = (await ff_core_Path.Path_base$((await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), $task));
546
- (await buildScript_$(mainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBrowser(), resolvedDependencies_, $task));
547
- (await ff_compiler_Main.bundleForBrowser_$(system_, resolvedDependencies_.mainPackagePair_, localMainFile_, $task))
548
- return
549
- }
550
- }
551
- {
552
- if(command_a.BuildCommand) {
553
- const mainFile_ = command_a.mainPath_;
554
- const resolvedDependencies_ = (await ff_compiler_Dependencies.process_$((await ff_core_NodeSystem.NodeSystem_httpClient$(system_, $task)), (await ff_core_NodeSystem.NodeSystem_path$(system_, (mainFile_ + ".ff"), $task)), $task));
555
- (await ff_compiler_Main.prepareFireflyDirectory_$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task));
556
- const localMainFile_ = (await ff_core_Path.Path_base$((await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), $task));
557
- (await buildScript_$(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBuild(), resolvedDependencies_, $task));
558
- (await buildScript_$(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitExecutable(), resolvedDependencies_, $task));
559
- (await ff_compiler_Main.bundleForPkg_$(system_, resolvedDependencies_.mainPackagePair_, localMainFile_, $task));
560
- (await ff_compiler_Main.importAndRun_$(fireflyPath_, "build", resolvedDependencies_.mainPackagePair_, localMainFile_, ff_core_List.Empty(), $task))
561
- return
562
- }
563
- }
564
- {
565
- if(command_a.CheckCommand) {
566
- const filePath_ = command_a.filePath_;
567
- (await ff_compiler_Builder.check_$(system_, fireflyPath_, (await ff_core_NodeSystem.NodeSystem_path$(system_, filePath_, $task)), ff_core_Map.empty_(), ff_compiler_LspHook.disabled_(), true, $task))
568
- return
569
- }
570
- }
571
- {
572
- if(command_a.BootstrapCommand) {
573
- const workingDirectory_ = (await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task));
574
- (await ff_compiler_Builder.build_$(system_, ff_compiler_JsEmitter.EmitNode(), ff_compiler_Syntax.PackagePair("ff", "compiler"), "Main", ff_compiler_Dependencies.ResolvedDependencies(ff_compiler_Syntax.PackagePair("ff", "compiler"), ff_core_List.List_toMap(ff_core_List.Empty(), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "compiler"), (await ff_core_Path.Path_slash$(workingDirectory_, "compiler", $task))), ff_core_List.Link(ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), (await ff_core_Path.Path_slash$(workingDirectory_, "core", $task))), ff_core_List.Empty())), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet(ff_core_List.Empty(), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair)), ff_core_Option.None(), (await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(workingDirectory_, "output", $task)), "temporary", $task)), (await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(workingDirectory_, "output", $task)), "js", $task)), true, $task))
575
- return
576
- }
577
- }
578
- }
579
- }
580
- ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch((await ff_core_Core.try_$((async ($task) => {
581
- const command_ = ff_compiler_Main.parseCommandLine_(ff_core_Array.Array_toList((await ff_core_NodeSystem.NodeSystem_arguments$(system_, $task))));
582
- return (await runCommand_$(command_, $task))
583
- }), $task)), ((_1, _2) => {
584
- {
585
- const message_ = _1.problem_;
586
- const error_ = _2;
587
- ff_core_Log.debug_(message_)
588
- return
589
- }
590
- }), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError), ((_1, _2) => {
591
- {
592
- const at_ = _1.at_;
593
- const message_ = _1.message_;
594
- const error_ = _2;
595
- ff_core_Log.debug_(message_);
596
- ff_core_Log.debug_((((((" at " + ff_core_String.String_replace(at_.file_, "./", "")) + ":") + at_.line_) + ":") + at_.column_))
597
- return
598
- }
599
- }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError))
600
- }
601
-
602
- export async function parseCommandLine_$(arguments_, $task) {
603
- {
604
- const arguments_a = arguments_;
605
- {
606
- if(arguments_a.Link) {
607
- const mainFile_ = arguments_a.head_;
608
- const mainArguments_ = arguments_a.tail_;
609
- const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
610
- if(_guard1.Some) {
611
- const mainName_ = _guard1.value_;
612
- return ff_compiler_Main.RunCommand(mainName_, mainArguments_)
613
- return
614
- }
615
- }
616
- }
617
- {
618
- if(arguments_a.Link) {
619
- if(arguments_a.head_ == "run") {
620
- const runArguments_ = arguments_a.tail_;
621
- {
622
- const _1 = runArguments_;
623
- {
624
- if(_1.Link) {
625
- const mainFile_ = _1.head_;
626
- const mainArguments_ = _1.tail_;
627
- const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
628
- if(_guard1.Some) {
629
- const mainName_ = _guard1.value_;
630
- return ff_compiler_Main.RunCommand(mainName_, mainArguments_)
631
- return
632
- }
633
- }
634
- }
635
- {
636
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as first argument to run." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
637
- return
638
- }
639
- }
640
- return
641
- }
642
- }
643
- }
644
- {
645
- if(arguments_a.Link) {
646
- if(arguments_a.head_ == "browser") {
647
- const browserArguments_ = arguments_a.tail_;
648
- {
649
- const _1 = browserArguments_;
650
- {
651
- if(_1.Link) {
652
- const mainFile_ = _1.head_;
653
- if(_1.tail_.Empty) {
654
- const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
655
- if(_guard1.Some) {
656
- const mainName_ = _guard1.value_;
657
- return ff_compiler_Main.BrowserCommand(mainName_)
658
- return
659
- }
660
- }
661
- }
662
- }
663
- {
664
- if(_1.Link) {
665
- if(_1.tail_.Link) {
666
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to browser." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
667
- return
668
- }
669
- }
670
- }
671
- {
672
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to browser." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
673
- return
674
- }
675
- }
676
- return
677
- }
678
- }
679
- }
680
- {
681
- if(arguments_a.Link) {
682
- if(arguments_a.head_ == "build") {
683
- const buildArguments_ = arguments_a.tail_;
684
- {
685
- const _1 = buildArguments_;
686
- {
687
- if(_1.Link) {
688
- const mainFile_ = _1.head_;
689
- if(_1.tail_.Empty) {
690
- const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
691
- if(_guard1.Some) {
692
- const mainName_ = _guard1.value_;
693
- return ff_compiler_Main.BuildCommand(mainName_)
694
- return
695
- }
696
- }
697
- }
698
- }
699
- {
700
- if(_1.Link) {
701
- if(_1.tail_.Link) {
702
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
703
- return
704
- }
705
- }
706
- }
707
- {
708
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
709
- return
710
- }
711
- }
712
- return
713
- }
714
- }
715
- }
716
- {
717
- if(arguments_a.Link) {
718
- if(arguments_a.head_ == "check") {
719
- const checkArguments_ = arguments_a.tail_;
720
- {
721
- const _1 = checkArguments_;
722
- {
723
- if(_1.Link) {
724
- const fileName_ = _1.head_;
725
- if(_1.tail_.Empty) {
726
- const _guard1 = ff_core_String.String_removeLast(fileName_, ".ff");
727
- if(_guard1.Some) {
728
- return ff_compiler_Main.CheckCommand(fileName_)
729
- return
730
- }
731
- }
732
- }
733
- }
734
- {
735
- if(_1.Link) {
736
- if(_1.tail_.Link) {
737
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to check." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
738
- return
739
- }
740
- }
741
- }
742
- {
743
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
744
- return
745
- }
746
- }
747
- return
748
- }
749
- }
750
- }
751
- {
752
- if(arguments_a.Link) {
753
- if(arguments_a.head_ == "bootstrap") {
754
- if(arguments_a.tail_.Link) {
755
- if(arguments_a.tail_.tail_.Empty) {
756
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("bootstrap takes no arguments" + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
757
- return
758
- }
759
- }
760
- }
761
- }
762
- }
763
- {
764
- if(arguments_a.Link) {
765
- if(arguments_a.head_ == "bootstrap") {
766
- if(arguments_a.tail_.Empty) {
767
- return ff_compiler_Main.BootstrapCommand()
768
- return
769
- }
770
- }
771
- }
772
- }
773
- {
774
- if(arguments_a.Empty) {
775
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a command or a main file to run." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
776
- return
777
- }
778
- }
779
- {
780
- if(arguments_a.Link) {
781
- const s_ = arguments_a.head_;
782
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(((("Unknown command '" + s_) + "'") + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
783
- return
784
- }
785
- }
786
- }
787
- }
788
-
789
- export async function bundleForPkg_$(system_, packagePair_, mainFile_, $task) {
790
- const prefix_ = ".firefly/output/executable/";
791
- const mainJsFile_ = ((((prefix_ + ff_compiler_Syntax.PackagePair_groupName(packagePair_, "/")) + "/") + mainFile_) + ".mjs");
792
- const file_ = (prefix_ + "Main.bundle.js");
793
- (await ff_core_BuildSystem.internalNodeCallEsBuild_$(system_, mainJsFile_, file_, false, $task))
794
- }
795
-
796
- export async function bundleForBrowser_$(system_, packagePair_, mainFile_, $task) {
797
- const prefix_ = ".firefly/output/browser/";
798
- const mainJsFile_ = ((((prefix_ + ff_compiler_Syntax.PackagePair_groupName(packagePair_, "/")) + "/") + mainFile_) + ".mjs");
799
- const file_ = (prefix_ + "Main.bundle.js");
800
- const browserCode_ = ff_core_BuildSystem.BrowserCode(packagePair_.group_, packagePair_.name_, (await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair("/", (async ($task) => {
801
- return (await ff_core_Path.Path_readStream$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task))
802
- })), ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)));
803
- (await ff_core_BuildSystem.internalCallEsBuild_$(browserCode_, mainJsFile_, file_, true, true, $task))
804
- }
805
-
806
- export async function importAndRun_$(fireflyPath_, target_, packagePair_, mainFile_, arguments_, $task) {
147
+ `;
148
+
149
+ export function main_(system_) {
150
+ const fireflyPath_ = ff_compiler_Main.detectFireflyPath_(system_);
151
+ function buildScript_(mainFile_, mainPackagePair_, emitTarget_, resolvedDependencies_) {
152
+ const fixedPackagePaths_ = (ff_core_Map.Map_contains(resolvedDependencies_.packagePaths_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair)
153
+ ? resolvedDependencies_.packagePaths_
154
+ : ff_core_Map.Map_add(resolvedDependencies_.packagePaths_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_core_Path.Path_slash(fireflyPath_, "core"), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair));
155
+ const compilerModulePath_ = ((ff_core_Equal.notEquals_(emitTarget_, ff_compiler_JsEmitter.EmitBrowser(), ff_compiler_JsEmitter.ff_core_Equal_Equal$ff_compiler_JsEmitter_EmitTarget) && ff_core_Equal.notEquals_(emitTarget_, ff_compiler_JsEmitter.EmitExecutable(), ff_compiler_JsEmitter.ff_core_Equal_Equal$ff_compiler_JsEmitter_EmitTarget))
156
+ ? ff_core_Option.Some(ff_core_Path.Path_slash(ff_core_Path.Path_slash(ff_core_Path.Path_slash(ff_core_Path.Path_slash(fireflyPath_, "output"), "js"), "ff"), "compiler/Builder.mjs"))
157
+ : ff_core_Option.None());
158
+ const targetName_ = (((_1) => {
159
+ {
160
+ if(_1.EmitBuild) {
161
+ return "build"
162
+ return
163
+ }
164
+ }
165
+ {
166
+ if(_1.EmitNode) {
167
+ return "node"
168
+ return
169
+ }
170
+ }
171
+ {
172
+ if(_1.EmitBrowser) {
173
+ return "browser"
174
+ return
175
+ }
176
+ }
177
+ {
178
+ if(_1.EmitExecutable) {
179
+ return "executable"
180
+ return
181
+ }
182
+ }
183
+ }))(emitTarget_);
184
+ ff_compiler_Builder.build_(system_, emitTarget_, mainPackagePair_, mainFile_, (((_c) => {
185
+ return ff_compiler_Dependencies.ResolvedDependencies(_c.mainPackagePair_, _c.packages_, fixedPackagePaths_, _c.singleFilePackages_)
186
+ }))(resolvedDependencies_), compilerModulePath_, ff_core_Path.Path_slash(ff_core_NodeSystem.NodeSystem_path(system_, ".firefly"), "temporary"), ff_core_Path.Path_path(ff_core_Path.Path_path(ff_core_NodeSystem.NodeSystem_path(system_, ".firefly"), "output"), targetName_), false)
187
+ }
188
+ function runCommand_(command_) {
189
+ {
190
+ const command_a = command_;
191
+ {
192
+ if(command_a.RunCommand) {
193
+ const mainFile_ = command_a.mainPath_;
194
+ const arguments_ = command_a.argument_;
195
+ const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
196
+ ff_compiler_Main.prepareFireflyDirectory_(ff_core_NodeSystem.NodeSystem_path(system_, "."));
197
+ const localMainFile_ = ff_core_Path.Path_base(ff_core_NodeSystem.NodeSystem_path(system_, mainFile_));
198
+ buildScript_(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitNode(), resolvedDependencies_);
199
+ ff_compiler_Main.importAndRun_(fireflyPath_, "node", resolvedDependencies_.mainPackagePair_, localMainFile_, arguments_)
200
+ return
201
+ }
202
+ }
203
+ {
204
+ if(command_a.BrowserCommand) {
205
+ const mainFile_ = command_a.mainPath_;
206
+ const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
207
+ ff_compiler_Main.prepareFireflyDirectory_(ff_core_NodeSystem.NodeSystem_path(system_, "."));
208
+ const localMainFile_ = ff_core_Path.Path_base(ff_core_NodeSystem.NodeSystem_path(system_, mainFile_));
209
+ buildScript_(mainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBrowser(), resolvedDependencies_);
210
+ ff_compiler_Main.bundleForBrowser_(system_, resolvedDependencies_.mainPackagePair_, localMainFile_)
211
+ return
212
+ }
213
+ }
214
+ {
215
+ if(command_a.BuildCommand) {
216
+ const mainFile_ = command_a.mainPath_;
217
+ const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
218
+ ff_compiler_Main.prepareFireflyDirectory_(ff_core_NodeSystem.NodeSystem_path(system_, "."));
219
+ const localMainFile_ = ff_core_Path.Path_base(ff_core_NodeSystem.NodeSystem_path(system_, mainFile_));
220
+ buildScript_(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBuild(), resolvedDependencies_);
221
+ buildScript_(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitExecutable(), resolvedDependencies_);
222
+ ff_compiler_Main.bundleForPkg_(system_, resolvedDependencies_.mainPackagePair_, localMainFile_);
223
+ ff_compiler_Main.importAndRun_(fireflyPath_, "build", resolvedDependencies_.mainPackagePair_, localMainFile_, ff_core_List.Empty())
224
+ return
225
+ }
226
+ }
227
+ {
228
+ if(command_a.CheckCommand) {
229
+ const filePath_ = command_a.filePath_;
230
+ ff_compiler_Builder.check_(system_, fireflyPath_, ff_core_NodeSystem.NodeSystem_path(system_, filePath_), ff_core_Map.empty_(), ff_compiler_LspHook.disabled_(), true)
231
+ return
232
+ }
233
+ }
234
+ {
235
+ if(command_a.BootstrapCommand) {
236
+ const workingDirectory_ = ff_core_NodeSystem.NodeSystem_path(system_, ".");
237
+ ff_compiler_Builder.build_(system_, ff_compiler_JsEmitter.EmitNode(), ff_compiler_Syntax.PackagePair("ff", "compiler"), "Main", ff_compiler_Dependencies.ResolvedDependencies(ff_compiler_Syntax.PackagePair("ff", "compiler"), ff_core_List.List_toMap(ff_core_List.Empty(), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "compiler"), ff_core_Path.Path_slash(workingDirectory_, "compiler")), ff_core_List.Link(ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), ff_core_Path.Path_slash(workingDirectory_, "core")), ff_core_List.Empty())), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet(ff_core_List.Empty(), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair)), ff_core_Option.None(), ff_core_Path.Path_slash(ff_core_Path.Path_slash(workingDirectory_, "output"), "temporary"), ff_core_Path.Path_slash(ff_core_Path.Path_slash(workingDirectory_, "output"), "js"), true)
238
+ return
239
+ }
240
+ }
241
+ }
242
+ }
243
+ ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch(ff_core_Core.try_((() => {
244
+ const command_ = ff_compiler_Main.parseCommandLine_(ff_core_Array.Array_toList(ff_core_NodeSystem.NodeSystem_arguments(system_)));
245
+ return runCommand_(command_)
246
+ })), ((_1, _2) => {
247
+ {
248
+ const message_ = _1.problem_;
249
+ const error_ = _2;
250
+ ff_core_Log.debug_(message_)
251
+ return
252
+ }
253
+ }), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError), ((_1, _2) => {
254
+ {
255
+ const at_ = _1.at_;
256
+ const message_ = _1.message_;
257
+ const error_ = _2;
258
+ ff_core_Log.debug_(message_);
259
+ ff_core_Log.debug_((((((" at " + ff_core_String.String_replace(at_.file_, "./", "")) + ":") + at_.line_) + ":") + at_.column_))
260
+ return
261
+ }
262
+ }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError))
263
+ }
264
+
265
+ export function parseCommandLine_(arguments_) {
266
+ {
267
+ const arguments_a = arguments_;
268
+ {
269
+ if(arguments_a.Link) {
270
+ const mainFile_ = arguments_a.head_;
271
+ const mainArguments_ = arguments_a.tail_;
272
+ const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
273
+ if(_guard1.Some) {
274
+ const mainName_ = _guard1.value_;
275
+ return ff_compiler_Main.RunCommand(mainName_, mainArguments_)
276
+ return
277
+ }
278
+ }
279
+ }
280
+ {
281
+ if(arguments_a.Link) {
282
+ if(arguments_a.head_ == "run") {
283
+ const runArguments_ = arguments_a.tail_;
284
+ {
285
+ const _1 = runArguments_;
286
+ {
287
+ if(_1.Link) {
288
+ const mainFile_ = _1.head_;
289
+ const mainArguments_ = _1.tail_;
290
+ const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
291
+ if(_guard1.Some) {
292
+ const mainName_ = _guard1.value_;
293
+ return ff_compiler_Main.RunCommand(mainName_, mainArguments_)
294
+ return
295
+ }
296
+ }
297
+ }
298
+ {
299
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as first argument to run." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
300
+ return
301
+ }
302
+ }
303
+ return
304
+ }
305
+ }
306
+ }
307
+ {
308
+ if(arguments_a.Link) {
309
+ if(arguments_a.head_ == "browser") {
310
+ const browserArguments_ = arguments_a.tail_;
311
+ {
312
+ const _1 = browserArguments_;
313
+ {
314
+ if(_1.Link) {
315
+ const mainFile_ = _1.head_;
316
+ if(_1.tail_.Empty) {
317
+ const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
318
+ if(_guard1.Some) {
319
+ const mainName_ = _guard1.value_;
320
+ return ff_compiler_Main.BrowserCommand(mainName_)
321
+ return
322
+ }
323
+ }
324
+ }
325
+ }
326
+ {
327
+ if(_1.Link) {
328
+ if(_1.tail_.Link) {
329
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to browser." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
330
+ return
331
+ }
332
+ }
333
+ }
334
+ {
335
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to browser." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
336
+ return
337
+ }
338
+ }
339
+ return
340
+ }
341
+ }
342
+ }
343
+ {
344
+ if(arguments_a.Link) {
345
+ if(arguments_a.head_ == "build") {
346
+ const buildArguments_ = arguments_a.tail_;
347
+ {
348
+ const _1 = buildArguments_;
349
+ {
350
+ if(_1.Link) {
351
+ const mainFile_ = _1.head_;
352
+ if(_1.tail_.Empty) {
353
+ const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
354
+ if(_guard1.Some) {
355
+ const mainName_ = _guard1.value_;
356
+ return ff_compiler_Main.BuildCommand(mainName_)
357
+ return
358
+ }
359
+ }
360
+ }
361
+ }
362
+ {
363
+ if(_1.Link) {
364
+ if(_1.tail_.Link) {
365
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
366
+ return
367
+ }
368
+ }
369
+ }
370
+ {
371
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
372
+ return
373
+ }
374
+ }
375
+ return
376
+ }
377
+ }
378
+ }
379
+ {
380
+ if(arguments_a.Link) {
381
+ if(arguments_a.head_ == "check") {
382
+ const checkArguments_ = arguments_a.tail_;
383
+ {
384
+ const _1 = checkArguments_;
385
+ {
386
+ if(_1.Link) {
387
+ const fileName_ = _1.head_;
388
+ if(_1.tail_.Empty) {
389
+ const _guard1 = ff_core_String.String_removeLast(fileName_, ".ff");
390
+ if(_guard1.Some) {
391
+ return ff_compiler_Main.CheckCommand(fileName_)
392
+ return
393
+ }
394
+ }
395
+ }
396
+ }
397
+ {
398
+ if(_1.Link) {
399
+ if(_1.tail_.Link) {
400
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to check." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
401
+ return
402
+ }
403
+ }
404
+ }
405
+ {
406
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
407
+ return
408
+ }
409
+ }
410
+ return
411
+ }
412
+ }
413
+ }
414
+ {
415
+ if(arguments_a.Link) {
416
+ if(arguments_a.head_ == "bootstrap") {
417
+ if(arguments_a.tail_.Link) {
418
+ if(arguments_a.tail_.tail_.Empty) {
419
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("bootstrap takes no arguments" + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
420
+ return
421
+ }
422
+ }
423
+ }
424
+ }
425
+ }
426
+ {
427
+ if(arguments_a.Link) {
428
+ if(arguments_a.head_ == "bootstrap") {
429
+ if(arguments_a.tail_.Empty) {
430
+ return ff_compiler_Main.BootstrapCommand()
431
+ return
432
+ }
433
+ }
434
+ }
435
+ }
436
+ {
437
+ if(arguments_a.Empty) {
438
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a command or a main file to run." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
439
+ return
440
+ }
441
+ }
442
+ {
443
+ if(arguments_a.Link) {
444
+ const s_ = arguments_a.head_;
445
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(((("Unknown command '" + s_) + "'") + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
446
+ return
447
+ }
448
+ }
449
+ }
450
+ }
451
+
452
+ export function bundleForPkg_(system_, packagePair_, mainFile_) {
453
+ const prefix_ = ".firefly/output/executable/";
454
+ const mainJsFile_ = ((((prefix_ + ff_compiler_Syntax.PackagePair_groupName(packagePair_, "/")) + "/") + mainFile_) + ".mjs");
455
+ const file_ = (prefix_ + "Main.bundle.js");
456
+ ff_core_BuildSystem.internalNodeCallEsBuild_(system_, mainJsFile_, file_, false)
457
+ }
458
+
459
+ export function bundleForBrowser_(system_, packagePair_, mainFile_) {
460
+ const prefix_ = ".firefly/output/browser/";
461
+ const mainJsFile_ = ((((prefix_ + ff_compiler_Syntax.PackagePair_groupName(packagePair_, "/")) + "/") + mainFile_) + ".mjs");
462
+ const file_ = (prefix_ + "Main.bundle.js");
463
+ const browserCode_ = ff_core_BuildSystem.BrowserCode(packagePair_.group_, packagePair_.name_, ff_core_NodeSystem.NodeSystem_path(system_, mainFile_), ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair("/", (() => {
464
+ return ff_core_Path.Path_readStream(ff_core_NodeSystem.NodeSystem_path(system_, "."))
465
+ })), ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)));
466
+ ff_core_BuildSystem.internalCallEsBuild_(browserCode_, mainJsFile_, file_, true, true)
467
+ }
468
+
469
+ export function importAndRun_(fireflyPath_, target_, packagePair_, mainFile_, arguments_) {
470
+ throw new Error('Function importAndRun is missing on this target in sync context.');
471
+ }
472
+
473
+ export function prepareFireflyDirectory_(path_) {
474
+ if((!ff_core_Path.Path_exists(ff_core_Path.Path_slash(ff_core_Path.Path_slash(path_, ".firefly"), "output"), false, false, false))) {
475
+ if((!ff_core_Path.Path_exists(ff_core_Path.Path_slash(path_, ".firefly"), false, false, false))) {
476
+ ff_core_Path.Path_createDirectory(ff_core_Path.Path_slash(path_, ".firefly"), false)
477
+ };
478
+ ff_core_Path.Path_createDirectory(ff_core_Path.Path_slash(ff_core_Path.Path_slash(path_, ".firefly"), "output"), false)
479
+ }
480
+ }
481
+
482
+ export function detectFireflyPath_(system_) {
483
+ throw new Error('Function detectFireflyPath is missing on this target in sync context.');
484
+ }
485
+
486
+ export async function main_$(system_, $task) {
487
+ const fireflyPath_ = (await ff_compiler_Main.detectFireflyPath_$(system_, $task));
488
+ async function buildScript_$(mainFile_, mainPackagePair_, emitTarget_, resolvedDependencies_, $task) {
489
+ const fixedPackagePaths_ = (ff_core_Map.Map_contains(resolvedDependencies_.packagePaths_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair)
490
+ ? resolvedDependencies_.packagePaths_
491
+ : ff_core_Map.Map_add(resolvedDependencies_.packagePaths_, ff_compiler_Syntax.PackagePair("ff", "core"), (await ff_core_Path.Path_slash$(fireflyPath_, "core", $task)), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair));
492
+ const compilerModulePath_ = ((ff_core_Equal.notEquals_(emitTarget_, ff_compiler_JsEmitter.EmitBrowser(), ff_compiler_JsEmitter.ff_core_Equal_Equal$ff_compiler_JsEmitter_EmitTarget) && ff_core_Equal.notEquals_(emitTarget_, ff_compiler_JsEmitter.EmitExecutable(), ff_compiler_JsEmitter.ff_core_Equal_Equal$ff_compiler_JsEmitter_EmitTarget))
493
+ ? ff_core_Option.Some((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(fireflyPath_, "output", $task)), "js", $task)), "ff", $task)), "compiler/Builder.mjs", $task)))
494
+ : ff_core_Option.None());
495
+ const targetName_ = (((_1) => {
496
+ {
497
+ if(_1.EmitBuild) {
498
+ return "build"
499
+ return
500
+ }
501
+ }
502
+ {
503
+ if(_1.EmitNode) {
504
+ return "node"
505
+ return
506
+ }
507
+ }
508
+ {
509
+ if(_1.EmitBrowser) {
510
+ return "browser"
511
+ return
512
+ }
513
+ }
514
+ {
515
+ if(_1.EmitExecutable) {
516
+ return "executable"
517
+ return
518
+ }
519
+ }
520
+ }))(emitTarget_);
521
+ (await ff_compiler_Builder.build_$(system_, emitTarget_, mainPackagePair_, mainFile_, (((_c) => {
522
+ return ff_compiler_Dependencies.ResolvedDependencies(_c.mainPackagePair_, _c.packages_, fixedPackagePaths_, _c.singleFilePackages_)
523
+ }))(resolvedDependencies_), compilerModulePath_, (await ff_core_Path.Path_slash$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".firefly", $task)), "temporary", $task)), (await ff_core_Path.Path_path$((await ff_core_Path.Path_path$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".firefly", $task)), "output", $task)), targetName_, $task)), false, $task))
524
+ }
525
+ async function runCommand_$(command_, $task) {
526
+ {
527
+ const command_a = command_;
528
+ {
529
+ if(command_a.RunCommand) {
530
+ const mainFile_ = command_a.mainPath_;
531
+ const arguments_ = command_a.argument_;
532
+ const resolvedDependencies_ = (await ff_compiler_Dependencies.process_$((await ff_core_NodeSystem.NodeSystem_httpClient$(system_, $task)), (await ff_core_NodeSystem.NodeSystem_path$(system_, (mainFile_ + ".ff"), $task)), $task));
533
+ (await ff_compiler_Main.prepareFireflyDirectory_$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task));
534
+ const localMainFile_ = (await ff_core_Path.Path_base$((await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), $task));
535
+ (await buildScript_$(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitNode(), resolvedDependencies_, $task));
536
+ (await ff_compiler_Main.importAndRun_$(fireflyPath_, "node", resolvedDependencies_.mainPackagePair_, localMainFile_, arguments_, $task))
537
+ return
538
+ }
539
+ }
540
+ {
541
+ if(command_a.BrowserCommand) {
542
+ const mainFile_ = command_a.mainPath_;
543
+ const resolvedDependencies_ = (await ff_compiler_Dependencies.process_$((await ff_core_NodeSystem.NodeSystem_httpClient$(system_, $task)), (await ff_core_NodeSystem.NodeSystem_path$(system_, (mainFile_ + ".ff"), $task)), $task));
544
+ (await ff_compiler_Main.prepareFireflyDirectory_$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task));
545
+ const localMainFile_ = (await ff_core_Path.Path_base$((await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), $task));
546
+ (await buildScript_$(mainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBrowser(), resolvedDependencies_, $task));
547
+ (await ff_compiler_Main.bundleForBrowser_$(system_, resolvedDependencies_.mainPackagePair_, localMainFile_, $task))
548
+ return
549
+ }
550
+ }
551
+ {
552
+ if(command_a.BuildCommand) {
553
+ const mainFile_ = command_a.mainPath_;
554
+ const resolvedDependencies_ = (await ff_compiler_Dependencies.process_$((await ff_core_NodeSystem.NodeSystem_httpClient$(system_, $task)), (await ff_core_NodeSystem.NodeSystem_path$(system_, (mainFile_ + ".ff"), $task)), $task));
555
+ (await ff_compiler_Main.prepareFireflyDirectory_$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task));
556
+ const localMainFile_ = (await ff_core_Path.Path_base$((await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), $task));
557
+ (await buildScript_$(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBuild(), resolvedDependencies_, $task));
558
+ (await buildScript_$(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitExecutable(), resolvedDependencies_, $task));
559
+ (await ff_compiler_Main.bundleForPkg_$(system_, resolvedDependencies_.mainPackagePair_, localMainFile_, $task));
560
+ (await ff_compiler_Main.importAndRun_$(fireflyPath_, "build", resolvedDependencies_.mainPackagePair_, localMainFile_, ff_core_List.Empty(), $task))
561
+ return
562
+ }
563
+ }
564
+ {
565
+ if(command_a.CheckCommand) {
566
+ const filePath_ = command_a.filePath_;
567
+ (await ff_compiler_Builder.check_$(system_, fireflyPath_, (await ff_core_NodeSystem.NodeSystem_path$(system_, filePath_, $task)), ff_core_Map.empty_(), ff_compiler_LspHook.disabled_(), true, $task))
568
+ return
569
+ }
570
+ }
571
+ {
572
+ if(command_a.BootstrapCommand) {
573
+ const workingDirectory_ = (await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task));
574
+ (await ff_compiler_Builder.build_$(system_, ff_compiler_JsEmitter.EmitNode(), ff_compiler_Syntax.PackagePair("ff", "compiler"), "Main", ff_compiler_Dependencies.ResolvedDependencies(ff_compiler_Syntax.PackagePair("ff", "compiler"), ff_core_List.List_toMap(ff_core_List.Empty(), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "compiler"), (await ff_core_Path.Path_slash$(workingDirectory_, "compiler", $task))), ff_core_List.Link(ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), (await ff_core_Path.Path_slash$(workingDirectory_, "core", $task))), ff_core_List.Empty())), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet(ff_core_List.Empty(), ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair)), ff_core_Option.None(), (await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(workingDirectory_, "output", $task)), "temporary", $task)), (await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(workingDirectory_, "output", $task)), "js", $task)), true, $task))
575
+ return
576
+ }
577
+ }
578
+ }
579
+ }
580
+ ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch((await ff_core_Core.try_$((async ($task) => {
581
+ const command_ = ff_compiler_Main.parseCommandLine_(ff_core_Array.Array_toList((await ff_core_NodeSystem.NodeSystem_arguments$(system_, $task))));
582
+ return (await runCommand_$(command_, $task))
583
+ }), $task)), ((_1, _2) => {
584
+ {
585
+ const message_ = _1.problem_;
586
+ const error_ = _2;
587
+ ff_core_Log.debug_(message_)
588
+ return
589
+ }
590
+ }), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError), ((_1, _2) => {
591
+ {
592
+ const at_ = _1.at_;
593
+ const message_ = _1.message_;
594
+ const error_ = _2;
595
+ ff_core_Log.debug_(message_);
596
+ ff_core_Log.debug_((((((" at " + ff_core_String.String_replace(at_.file_, "./", "")) + ":") + at_.line_) + ":") + at_.column_))
597
+ return
598
+ }
599
+ }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError))
600
+ }
601
+
602
+ export async function parseCommandLine_$(arguments_, $task) {
603
+ {
604
+ const arguments_a = arguments_;
605
+ {
606
+ if(arguments_a.Link) {
607
+ const mainFile_ = arguments_a.head_;
608
+ const mainArguments_ = arguments_a.tail_;
609
+ const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
610
+ if(_guard1.Some) {
611
+ const mainName_ = _guard1.value_;
612
+ return ff_compiler_Main.RunCommand(mainName_, mainArguments_)
613
+ return
614
+ }
615
+ }
616
+ }
617
+ {
618
+ if(arguments_a.Link) {
619
+ if(arguments_a.head_ == "run") {
620
+ const runArguments_ = arguments_a.tail_;
621
+ {
622
+ const _1 = runArguments_;
623
+ {
624
+ if(_1.Link) {
625
+ const mainFile_ = _1.head_;
626
+ const mainArguments_ = _1.tail_;
627
+ const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
628
+ if(_guard1.Some) {
629
+ const mainName_ = _guard1.value_;
630
+ return ff_compiler_Main.RunCommand(mainName_, mainArguments_)
631
+ return
632
+ }
633
+ }
634
+ }
635
+ {
636
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as first argument to run." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
637
+ return
638
+ }
639
+ }
640
+ return
641
+ }
642
+ }
643
+ }
644
+ {
645
+ if(arguments_a.Link) {
646
+ if(arguments_a.head_ == "browser") {
647
+ const browserArguments_ = arguments_a.tail_;
648
+ {
649
+ const _1 = browserArguments_;
650
+ {
651
+ if(_1.Link) {
652
+ const mainFile_ = _1.head_;
653
+ if(_1.tail_.Empty) {
654
+ const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
655
+ if(_guard1.Some) {
656
+ const mainName_ = _guard1.value_;
657
+ return ff_compiler_Main.BrowserCommand(mainName_)
658
+ return
659
+ }
660
+ }
661
+ }
662
+ }
663
+ {
664
+ if(_1.Link) {
665
+ if(_1.tail_.Link) {
666
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to browser." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
667
+ return
668
+ }
669
+ }
670
+ }
671
+ {
672
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to browser." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
673
+ return
674
+ }
675
+ }
676
+ return
677
+ }
678
+ }
679
+ }
680
+ {
681
+ if(arguments_a.Link) {
682
+ if(arguments_a.head_ == "build") {
683
+ const buildArguments_ = arguments_a.tail_;
684
+ {
685
+ const _1 = buildArguments_;
686
+ {
687
+ if(_1.Link) {
688
+ const mainFile_ = _1.head_;
689
+ if(_1.tail_.Empty) {
690
+ const _guard1 = ff_core_String.String_removeLast(mainFile_, ".ff");
691
+ if(_guard1.Some) {
692
+ const mainName_ = _guard1.value_;
693
+ return ff_compiler_Main.BuildCommand(mainName_)
694
+ return
695
+ }
696
+ }
697
+ }
698
+ }
699
+ {
700
+ if(_1.Link) {
701
+ if(_1.tail_.Link) {
702
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
703
+ return
704
+ }
705
+ }
706
+ }
707
+ {
708
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
709
+ return
710
+ }
711
+ }
712
+ return
713
+ }
714
+ }
715
+ }
716
+ {
717
+ if(arguments_a.Link) {
718
+ if(arguments_a.head_ == "check") {
719
+ const checkArguments_ = arguments_a.tail_;
720
+ {
721
+ const _1 = checkArguments_;
722
+ {
723
+ if(_1.Link) {
724
+ const fileName_ = _1.head_;
725
+ if(_1.tail_.Empty) {
726
+ const _guard1 = ff_core_String.String_removeLast(fileName_, ".ff");
727
+ if(_guard1.Some) {
728
+ return ff_compiler_Main.CheckCommand(fileName_)
729
+ return
730
+ }
731
+ }
732
+ }
733
+ }
734
+ {
735
+ if(_1.Link) {
736
+ if(_1.tail_.Link) {
737
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must only specify a single argument to check." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
738
+ return
739
+ }
740
+ }
741
+ }
742
+ {
743
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a Firefly file (.ff) as the argument to build." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
744
+ return
745
+ }
746
+ }
747
+ return
748
+ }
749
+ }
750
+ }
751
+ {
752
+ if(arguments_a.Link) {
753
+ if(arguments_a.head_ == "bootstrap") {
754
+ if(arguments_a.tail_.Link) {
755
+ if(arguments_a.tail_.tail_.Empty) {
756
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("bootstrap takes no arguments" + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
757
+ return
758
+ }
759
+ }
760
+ }
761
+ }
762
+ }
763
+ {
764
+ if(arguments_a.Link) {
765
+ if(arguments_a.head_ == "bootstrap") {
766
+ if(arguments_a.tail_.Empty) {
767
+ return ff_compiler_Main.BootstrapCommand()
768
+ return
769
+ }
770
+ }
771
+ }
772
+ }
773
+ {
774
+ if(arguments_a.Empty) {
775
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(("You must specify a command or a main file to run." + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
776
+ return
777
+ }
778
+ }
779
+ {
780
+ if(arguments_a.Link) {
781
+ const s_ = arguments_a.head_;
782
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Main.CommandLineError(((("Unknown command '" + s_) + "'") + ff_compiler_Main.usageString_)), ff_compiler_Main.ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError)})
783
+ return
784
+ }
785
+ }
786
+ }
787
+ }
788
+
789
+ export async function bundleForPkg_$(system_, packagePair_, mainFile_, $task) {
790
+ const prefix_ = ".firefly/output/executable/";
791
+ const mainJsFile_ = ((((prefix_ + ff_compiler_Syntax.PackagePair_groupName(packagePair_, "/")) + "/") + mainFile_) + ".mjs");
792
+ const file_ = (prefix_ + "Main.bundle.js");
793
+ (await ff_core_BuildSystem.internalNodeCallEsBuild_$(system_, mainJsFile_, file_, false, $task))
794
+ }
795
+
796
+ export async function bundleForBrowser_$(system_, packagePair_, mainFile_, $task) {
797
+ const prefix_ = ".firefly/output/browser/";
798
+ const mainJsFile_ = ((((prefix_ + ff_compiler_Syntax.PackagePair_groupName(packagePair_, "/")) + "/") + mainFile_) + ".mjs");
799
+ const file_ = (prefix_ + "Main.bundle.js");
800
+ const browserCode_ = ff_core_BuildSystem.BrowserCode(packagePair_.group_, packagePair_.name_, (await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair("/", (async ($task) => {
801
+ return (await ff_core_Path.Path_readStream$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task))
802
+ })), ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)));
803
+ (await ff_core_BuildSystem.internalCallEsBuild_$(browserCode_, mainJsFile_, file_, true, true, $task))
804
+ }
805
+
806
+ export async function importAndRun_$(fireflyPath_, target_, packagePair_, mainFile_, arguments_, $task) {
807
807
 
808
808
  const process = await import('process');
809
809
  const cwd = process.cwd();
@@ -811,19 +811,19 @@ export async function importAndRun_$(fireflyPath_, target_, packagePair_, mainFi
811
811
  const packagePath = packagePair_.group_ + "/" + packagePair_.name_
812
812
  const main = await import(workingDirectory + "/.firefly/output/" + target_ + "/" + packagePath + "/" + mainFile_ + ".mjs");
813
813
  await main.$run$(fireflyPath_, ff_core_List.List_toArray(arguments_))
814
-
815
- }
816
-
817
- export async function prepareFireflyDirectory_$(path_, $task) {
818
- if((!(await ff_core_Path.Path_exists$((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(path_, ".firefly", $task)), "output", $task)), false, false, false, $task)))) {
819
- if((!(await ff_core_Path.Path_exists$((await ff_core_Path.Path_slash$(path_, ".firefly", $task)), false, false, false, $task)))) {
820
- (await ff_core_Path.Path_createDirectory$((await ff_core_Path.Path_slash$(path_, ".firefly", $task)), false, $task))
821
- };
822
- (await ff_core_Path.Path_createDirectory$((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(path_, ".firefly", $task)), "output", $task)), false, $task))
823
- }
824
- }
825
-
826
- export async function detectFireflyPath_$(system_, $task) {
814
+
815
+ }
816
+
817
+ export async function prepareFireflyDirectory_$(path_, $task) {
818
+ if((!(await ff_core_Path.Path_exists$((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(path_, ".firefly", $task)), "output", $task)), false, false, false, $task)))) {
819
+ if((!(await ff_core_Path.Path_exists$((await ff_core_Path.Path_slash$(path_, ".firefly", $task)), false, false, false, $task)))) {
820
+ (await ff_core_Path.Path_createDirectory$((await ff_core_Path.Path_slash$(path_, ".firefly", $task)), false, $task))
821
+ };
822
+ (await ff_core_Path.Path_createDirectory$((await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(path_, ".firefly", $task)), "output", $task)), false, $task))
823
+ }
824
+ }
825
+
826
+ export async function detectFireflyPath_$(system_, $task) {
827
827
 
828
828
  const url = import$0
829
829
  const suffix = '/output/js/ff/compiler/Main.mjs'
@@ -832,868 +832,868 @@ export async function detectFireflyPath_$(system_, $task) {
832
832
  throw 'Expected module path to end with: ' + suffix + ", but got: " + moduleUrl;
833
833
  }
834
834
  return url.fileURLToPath(new URL(moduleUrl.slice(0, -suffix.length)))
835
-
836
- }
837
-
838
-
839
-
840
- export const ff_core_Any_HasAnyTag$ff_compiler_Main_MainCommand = {
841
- anyTag_() {
842
- return ff_core_Any.internalAnyTag_((("ff:compiler/Main.MainCommand" + "[") + "]"))
843
- },
844
- async anyTag_$($task) {
845
- return ff_core_Any.internalAnyTag_((("ff:compiler/Main.MainCommand" + "[") + "]"))
846
- }
847
- };
848
-
849
- export const ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError = {
850
- anyTag_() {
851
- return ff_core_Any.internalAnyTag_((("ff:compiler/Main.CommandLineError" + "[") + "]"))
852
- },
853
- async anyTag_$($task) {
854
- return ff_core_Any.internalAnyTag_((("ff:compiler/Main.CommandLineError" + "[") + "]"))
855
- }
856
- };
857
-
858
- export const ff_core_Show_Show$ff_compiler_Main_MainCommand = {
859
- show_(value_) {
860
- {
861
- const value_a = value_;
862
- {
863
- if(value_a.BootstrapCommand) {
864
- const z_ = value_a;
865
- return "BootstrapCommand"
866
- return
867
- }
868
- }
869
- {
870
- if(value_a.RunCommand) {
871
- const z_ = value_a;
872
- return ((((("RunCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.argument_)) + ")")
873
- return
874
- }
875
- }
876
- {
877
- if(value_a.BrowserCommand) {
878
- const z_ = value_a;
879
- return ((("BrowserCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ")")
880
- return
881
- }
882
- }
883
- {
884
- if(value_a.BuildCommand) {
885
- const z_ = value_a;
886
- return ((("BuildCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ")")
887
- return
888
- }
889
- }
890
- {
891
- if(value_a.CheckCommand) {
892
- const z_ = value_a;
893
- return ((("CheckCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.filePath_)) + ")")
894
- return
895
- }
896
- }
897
- }
898
- },
899
- async show_$(value_, $task) {
900
- {
901
- const value_a = value_;
902
- {
903
- if(value_a.BootstrapCommand) {
904
- const z_ = value_a;
905
- return "BootstrapCommand"
906
- return
907
- }
908
- }
909
- {
910
- if(value_a.RunCommand) {
911
- const z_ = value_a;
912
- return ((((("RunCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.argument_)) + ")")
913
- return
914
- }
915
- }
916
- {
917
- if(value_a.BrowserCommand) {
918
- const z_ = value_a;
919
- return ((("BrowserCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ")")
920
- return
921
- }
922
- }
923
- {
924
- if(value_a.BuildCommand) {
925
- const z_ = value_a;
926
- return ((("BuildCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ")")
927
- return
928
- }
929
- }
930
- {
931
- if(value_a.CheckCommand) {
932
- const z_ = value_a;
933
- return ((("CheckCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.filePath_)) + ")")
934
- return
935
- }
936
- }
937
- }
938
- }
939
- };
940
-
941
- export const ff_core_Show_Show$ff_compiler_Main_CommandLineError = {
942
- show_(value_) {
943
- {
944
- const value_a = value_;
945
- {
946
- const z_ = value_a;
947
- return ((("CommandLineError" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.problem_)) + ")")
948
- return
949
- }
950
- }
951
- },
952
- async show_$(value_, $task) {
953
- {
954
- const value_a = value_;
955
- {
956
- const z_ = value_a;
957
- return ((("CommandLineError" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.problem_)) + ")")
958
- return
959
- }
960
- }
961
- }
962
- };
963
-
964
- export const ff_core_Equal_Equal$ff_compiler_Main_MainCommand = {
965
- equals_(x_, y_) {
966
- {
967
- const x_a = x_;
968
- const y_a = y_;
969
- {
970
- const _guard1 = (x_ === y_);
971
- if(_guard1) {
972
- return true
973
- return
974
- }
975
- }
976
- {
977
- if(x_a.RunCommand) {
978
- const x_ = x_a;
979
- if(y_a.RunCommand) {
980
- const y_ = y_a;
981
- return ((x_.mainPath_ === y_.mainPath_) && ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.argument_, y_.argument_))
982
- return
983
- }
984
- }
985
- }
986
- {
987
- if(x_a.BrowserCommand) {
988
- const x_ = x_a;
989
- if(y_a.BrowserCommand) {
990
- const y_ = y_a;
991
- return (x_.mainPath_ === y_.mainPath_)
992
- return
993
- }
994
- }
995
- }
996
- {
997
- if(x_a.BuildCommand) {
998
- const x_ = x_a;
999
- if(y_a.BuildCommand) {
1000
- const y_ = y_a;
1001
- return (x_.mainPath_ === y_.mainPath_)
1002
- return
1003
- }
1004
- }
1005
- }
1006
- {
1007
- if(x_a.CheckCommand) {
1008
- const x_ = x_a;
1009
- if(y_a.CheckCommand) {
1010
- const y_ = y_a;
1011
- return (x_.filePath_ === y_.filePath_)
1012
- return
1013
- }
1014
- }
1015
- }
1016
- {
1017
- return false
1018
- return
1019
- }
1020
- }
1021
- },
1022
- async equals_$(x_, y_, $task) {
1023
- {
1024
- const x_a = x_;
1025
- const y_a = y_;
1026
- {
1027
- const _guard1 = (x_ === y_);
1028
- if(_guard1) {
1029
- return true
1030
- return
1031
- }
1032
- }
1033
- {
1034
- if(x_a.RunCommand) {
1035
- const x_ = x_a;
1036
- if(y_a.RunCommand) {
1037
- const y_ = y_a;
1038
- return ((x_.mainPath_ === y_.mainPath_) && ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.argument_, y_.argument_))
1039
- return
1040
- }
1041
- }
1042
- }
1043
- {
1044
- if(x_a.BrowserCommand) {
1045
- const x_ = x_a;
1046
- if(y_a.BrowserCommand) {
1047
- const y_ = y_a;
1048
- return (x_.mainPath_ === y_.mainPath_)
1049
- return
1050
- }
1051
- }
1052
- }
1053
- {
1054
- if(x_a.BuildCommand) {
1055
- const x_ = x_a;
1056
- if(y_a.BuildCommand) {
1057
- const y_ = y_a;
1058
- return (x_.mainPath_ === y_.mainPath_)
1059
- return
1060
- }
1061
- }
1062
- }
1063
- {
1064
- if(x_a.CheckCommand) {
1065
- const x_ = x_a;
1066
- if(y_a.CheckCommand) {
1067
- const y_ = y_a;
1068
- return (x_.filePath_ === y_.filePath_)
1069
- return
1070
- }
1071
- }
1072
- }
1073
- {
1074
- return false
1075
- return
1076
- }
1077
- }
1078
- }
1079
- };
1080
-
1081
- export const ff_core_Equal_Equal$ff_compiler_Main_CommandLineError = {
1082
- equals_(x_, y_) {
1083
- {
1084
- const x_a = x_;
1085
- const y_a = y_;
1086
- {
1087
- const _guard1 = (x_ === y_);
1088
- if(_guard1) {
1089
- return true
1090
- return
1091
- }
1092
- }
1093
- {
1094
- return (x_.problem_ === y_.problem_)
1095
- return
1096
- }
1097
- }
1098
- },
1099
- async equals_$(x_, y_, $task) {
1100
- {
1101
- const x_a = x_;
1102
- const y_a = y_;
1103
- {
1104
- const _guard1 = (x_ === y_);
1105
- if(_guard1) {
1106
- return true
1107
- return
1108
- }
1109
- }
1110
- {
1111
- return (x_.problem_ === y_.problem_)
1112
- return
1113
- }
1114
- }
1115
- }
1116
- };
1117
-
1118
- export const ff_core_Ordering_Order$ff_compiler_Main_MainCommand = {
1119
- compare_(x_, y_) {
1120
- {
1121
- const x_a = x_;
1122
- const y_a = y_;
1123
- {
1124
- const _guard1 = (x_ === y_);
1125
- if(_guard1) {
1126
- return ff_core_Ordering.OrderingSame()
1127
- return
1128
- }
1129
- }
1130
- {
1131
- if(x_a.RunCommand) {
1132
- const x_ = x_a;
1133
- if(y_a.RunCommand) {
1134
- const y_ = y_a;
1135
- const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1136
- if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1137
- return mainPathOrdering_
1138
- } else {
1139
- const argumentOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.argument_, y_.argument_);
1140
- if((argumentOrdering_ !== ff_core_Ordering.OrderingSame())) {
1141
- return argumentOrdering_
1142
- } else {
1143
- return ff_core_Ordering.OrderingSame()
1144
- }
1145
- }
1146
- return
1147
- }
1148
- }
1149
- }
1150
- {
1151
- if(x_a.BrowserCommand) {
1152
- const x_ = x_a;
1153
- if(y_a.BrowserCommand) {
1154
- const y_ = y_a;
1155
- const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1156
- if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1157
- return mainPathOrdering_
1158
- } else {
1159
- return ff_core_Ordering.OrderingSame()
1160
- }
1161
- return
1162
- }
1163
- }
1164
- }
1165
- {
1166
- if(x_a.BuildCommand) {
1167
- const x_ = x_a;
1168
- if(y_a.BuildCommand) {
1169
- const y_ = y_a;
1170
- const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1171
- if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1172
- return mainPathOrdering_
1173
- } else {
1174
- return ff_core_Ordering.OrderingSame()
1175
- }
1176
- return
1177
- }
1178
- }
1179
- }
1180
- {
1181
- if(x_a.CheckCommand) {
1182
- const x_ = x_a;
1183
- if(y_a.CheckCommand) {
1184
- const y_ = y_a;
1185
- const filePathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.filePath_, y_.filePath_);
1186
- if((filePathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1187
- return filePathOrdering_
1188
- } else {
1189
- return ff_core_Ordering.OrderingSame()
1190
- }
1191
- return
1192
- }
1193
- }
1194
- }
1195
- {
1196
- function number_(z_) {
1197
- {
1198
- const z_a = z_;
1199
- {
1200
- if(z_a.BootstrapCommand) {
1201
- return 0
1202
- return
1203
- }
1204
- }
1205
- {
1206
- if(z_a.RunCommand) {
1207
- return 1
1208
- return
1209
- }
1210
- }
1211
- {
1212
- if(z_a.BrowserCommand) {
1213
- return 2
1214
- return
1215
- }
1216
- }
1217
- {
1218
- if(z_a.BuildCommand) {
1219
- return 3
1220
- return
1221
- }
1222
- }
1223
- {
1224
- if(z_a.CheckCommand) {
1225
- return 4
1226
- return
1227
- }
1228
- }
1229
- }
1230
- }
1231
- return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
1232
- return
1233
- }
1234
- }
1235
- },
1236
- async compare_$(x_, y_, $task) {
1237
- {
1238
- const x_a = x_;
1239
- const y_a = y_;
1240
- {
1241
- const _guard1 = (x_ === y_);
1242
- if(_guard1) {
1243
- return ff_core_Ordering.OrderingSame()
1244
- return
1245
- }
1246
- }
1247
- {
1248
- if(x_a.RunCommand) {
1249
- const x_ = x_a;
1250
- if(y_a.RunCommand) {
1251
- const y_ = y_a;
1252
- const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1253
- if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1254
- return mainPathOrdering_
1255
- } else {
1256
- const argumentOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.argument_, y_.argument_);
1257
- if((argumentOrdering_ !== ff_core_Ordering.OrderingSame())) {
1258
- return argumentOrdering_
1259
- } else {
1260
- return ff_core_Ordering.OrderingSame()
1261
- }
1262
- }
1263
- return
1264
- }
1265
- }
1266
- }
1267
- {
1268
- if(x_a.BrowserCommand) {
1269
- const x_ = x_a;
1270
- if(y_a.BrowserCommand) {
1271
- const y_ = y_a;
1272
- const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1273
- if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1274
- return mainPathOrdering_
1275
- } else {
1276
- return ff_core_Ordering.OrderingSame()
1277
- }
1278
- return
1279
- }
1280
- }
1281
- }
1282
- {
1283
- if(x_a.BuildCommand) {
1284
- const x_ = x_a;
1285
- if(y_a.BuildCommand) {
1286
- const y_ = y_a;
1287
- const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1288
- if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1289
- return mainPathOrdering_
1290
- } else {
1291
- return ff_core_Ordering.OrderingSame()
1292
- }
1293
- return
1294
- }
1295
- }
1296
- }
1297
- {
1298
- if(x_a.CheckCommand) {
1299
- const x_ = x_a;
1300
- if(y_a.CheckCommand) {
1301
- const y_ = y_a;
1302
- const filePathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.filePath_, y_.filePath_);
1303
- if((filePathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1304
- return filePathOrdering_
1305
- } else {
1306
- return ff_core_Ordering.OrderingSame()
1307
- }
1308
- return
1309
- }
1310
- }
1311
- }
1312
- {
1313
- function number_(z_) {
1314
- {
1315
- const z_a = z_;
1316
- {
1317
- if(z_a.BootstrapCommand) {
1318
- return 0
1319
- return
1320
- }
1321
- }
1322
- {
1323
- if(z_a.RunCommand) {
1324
- return 1
1325
- return
1326
- }
1327
- }
1328
- {
1329
- if(z_a.BrowserCommand) {
1330
- return 2
1331
- return
1332
- }
1333
- }
1334
- {
1335
- if(z_a.BuildCommand) {
1336
- return 3
1337
- return
1338
- }
1339
- }
1340
- {
1341
- if(z_a.CheckCommand) {
1342
- return 4
1343
- return
1344
- }
1345
- }
1346
- }
1347
- }
1348
- return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
1349
- return
1350
- }
1351
- }
1352
- }
1353
- };
1354
-
1355
- export const ff_core_Ordering_Order$ff_compiler_Main_CommandLineError = {
1356
- compare_(x_, y_) {
1357
- {
1358
- const x_a = x_;
1359
- const y_a = y_;
1360
- {
1361
- const _guard1 = (x_ === y_);
1362
- if(_guard1) {
1363
- return ff_core_Ordering.OrderingSame()
1364
- return
1365
- }
1366
- }
1367
- {
1368
- const problemOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.problem_, y_.problem_);
1369
- if((problemOrdering_ !== ff_core_Ordering.OrderingSame())) {
1370
- return problemOrdering_
1371
- } else {
1372
- return ff_core_Ordering.OrderingSame()
1373
- }
1374
- return
1375
- }
1376
- }
1377
- },
1378
- async compare_$(x_, y_, $task) {
1379
- {
1380
- const x_a = x_;
1381
- const y_a = y_;
1382
- {
1383
- const _guard1 = (x_ === y_);
1384
- if(_guard1) {
1385
- return ff_core_Ordering.OrderingSame()
1386
- return
1387
- }
1388
- }
1389
- {
1390
- const problemOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.problem_, y_.problem_);
1391
- if((problemOrdering_ !== ff_core_Ordering.OrderingSame())) {
1392
- return problemOrdering_
1393
- } else {
1394
- return ff_core_Ordering.OrderingSame()
1395
- }
1396
- return
1397
- }
1398
- }
1399
- }
1400
- };
1401
-
1402
- export const ff_core_Serializable_Serializable$ff_compiler_Main_MainCommand = {
1403
- serializeUsing_(serialization_, value_) {
1404
- {
1405
- const serialization_a = serialization_;
1406
- const value_a = value_;
1407
- {
1408
- if(value_a.BootstrapCommand) {
1409
- const v_ = value_a;
1410
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1411
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
1412
- serialization_.offset_ += 1
1413
- return
1414
- }
1415
- }
1416
- {
1417
- if(value_a.RunCommand) {
1418
- const v_ = value_a;
1419
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1420
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 1);
1421
- serialization_.offset_ += 1;
1422
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_);
1423
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.argument_)
1424
- return
1425
- }
1426
- }
1427
- {
1428
- if(value_a.BrowserCommand) {
1429
- const v_ = value_a;
1430
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
1431
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 2);
1432
- serialization_.offset_ += 1;
1433
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_)
1434
- return
1435
- }
1436
- }
1437
- {
1438
- if(value_a.BuildCommand) {
1439
- const v_ = value_a;
1440
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1441
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 3);
1442
- serialization_.offset_ += 1;
1443
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_)
1444
- return
1445
- }
1446
- }
1447
- {
1448
- if(value_a.CheckCommand) {
1449
- const v_ = value_a;
1450
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1451
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 4);
1452
- serialization_.offset_ += 1;
1453
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.filePath_)
1454
- return
1455
- }
1456
- }
1457
- }
1458
- },
1459
- deserializeUsing_(serialization_) {
1460
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1461
- serialization_.offset_ += 1;
1462
- {
1463
- const _1 = variantIndex_;
1464
- {
1465
- if(_1 == 0) {
1466
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1467
- return ff_compiler_Main.BootstrapCommand()
1468
- return
1469
- }
1470
- }
1471
- {
1472
- if(_1 == 1) {
1473
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1474
- return ff_compiler_Main.RunCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
1475
- return
1476
- }
1477
- }
1478
- {
1479
- if(_1 == 2) {
1480
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
1481
- return ff_compiler_Main.BrowserCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1482
- return
1483
- }
1484
- }
1485
- {
1486
- if(_1 == 3) {
1487
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1488
- return ff_compiler_Main.BuildCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1489
- return
1490
- }
1491
- }
1492
- {
1493
- if(_1 == 4) {
1494
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1495
- return ff_compiler_Main.CheckCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1496
- return
1497
- }
1498
- }
1499
- {
1500
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1501
- return
1502
- }
1503
- }
1504
- },
1505
- async serializeUsing_$(serialization_, value_, $task) {
1506
- {
1507
- const serialization_a = serialization_;
1508
- const value_a = value_;
1509
- {
1510
- if(value_a.BootstrapCommand) {
1511
- const v_ = value_a;
1512
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1513
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
1514
- serialization_.offset_ += 1
1515
- return
1516
- }
1517
- }
1518
- {
1519
- if(value_a.RunCommand) {
1520
- const v_ = value_a;
1521
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1522
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 1);
1523
- serialization_.offset_ += 1;
1524
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_);
1525
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.argument_)
1526
- return
1527
- }
1528
- }
1529
- {
1530
- if(value_a.BrowserCommand) {
1531
- const v_ = value_a;
1532
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
1533
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 2);
1534
- serialization_.offset_ += 1;
1535
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_)
1536
- return
1537
- }
1538
- }
1539
- {
1540
- if(value_a.BuildCommand) {
1541
- const v_ = value_a;
1542
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1543
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 3);
1544
- serialization_.offset_ += 1;
1545
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_)
1546
- return
1547
- }
1548
- }
1549
- {
1550
- if(value_a.CheckCommand) {
1551
- const v_ = value_a;
1552
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1553
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 4);
1554
- serialization_.offset_ += 1;
1555
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.filePath_)
1556
- return
1557
- }
1558
- }
1559
- }
1560
- },
1561
- async deserializeUsing_$(serialization_, $task) {
1562
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1563
- serialization_.offset_ += 1;
1564
- {
1565
- const _1 = variantIndex_;
1566
- {
1567
- if(_1 == 0) {
1568
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1569
- return ff_compiler_Main.BootstrapCommand()
1570
- return
1571
- }
1572
- }
1573
- {
1574
- if(_1 == 1) {
1575
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1576
- return ff_compiler_Main.RunCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
1577
- return
1578
- }
1579
- }
1580
- {
1581
- if(_1 == 2) {
1582
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
1583
- return ff_compiler_Main.BrowserCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1584
- return
1585
- }
1586
- }
1587
- {
1588
- if(_1 == 3) {
1589
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1590
- return ff_compiler_Main.BuildCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1591
- return
1592
- }
1593
- }
1594
- {
1595
- if(_1 == 4) {
1596
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1597
- return ff_compiler_Main.CheckCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1598
- return
1599
- }
1600
- }
1601
- {
1602
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1603
- return
1604
- }
1605
- }
1606
- }
1607
- };
1608
-
1609
- export const ff_core_Serializable_Serializable$ff_compiler_Main_CommandLineError = {
1610
- serializeUsing_(serialization_, value_) {
1611
- {
1612
- const serialization_a = serialization_;
1613
- const value_a = value_;
1614
- {
1615
- const v_ = value_a;
1616
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1617
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
1618
- serialization_.offset_ += 1;
1619
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.problem_)
1620
- return
1621
- }
1622
- }
1623
- },
1624
- deserializeUsing_(serialization_) {
1625
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1626
- serialization_.offset_ += 1;
1627
- {
1628
- const _1 = variantIndex_;
1629
- {
1630
- if(_1 == 0) {
1631
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1632
- return ff_compiler_Main.CommandLineError(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1633
- return
1634
- }
1635
- }
1636
- {
1637
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1638
- return
1639
- }
1640
- }
1641
- },
1642
- async serializeUsing_$(serialization_, value_, $task) {
1643
- {
1644
- const serialization_a = serialization_;
1645
- const value_a = value_;
1646
- {
1647
- const v_ = value_a;
1648
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1649
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
1650
- serialization_.offset_ += 1;
1651
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.problem_)
1652
- return
1653
- }
1654
- }
1655
- },
1656
- async deserializeUsing_$(serialization_, $task) {
1657
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1658
- serialization_.offset_ += 1;
1659
- {
1660
- const _1 = variantIndex_;
1661
- {
1662
- if(_1 == 0) {
1663
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1664
- return ff_compiler_Main.CommandLineError(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1665
- return
1666
- }
1667
- }
1668
- {
1669
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1670
- return
1671
- }
1672
- }
1673
- }
1674
- };
1675
-
1676
- export async function $run$(fireflyPath_, arguments_) {
1677
- Error.stackTraceLimit = 50
1678
- const $task = {controller: new AbortController(), subtasks: new Set(), promise: new Promise(() => {}), started: performance.now() * 0.001}
1679
- let interval = setInterval(() => {}, 24 * 60 * 60 * 1000)
1680
- let system = {
1681
- task_: $task,
1682
- array_: arguments_,
1683
- fireflyPath_: fireflyPath_,
1684
- mainPackagePair_: {group_: "ff", name_: "compiler"},
1685
- executableMode_: false,
1686
- buildMode_: false
1687
- }
1688
- try {
1689
- await main_$(system, $task)
1690
- } finally {
1691
- ff_core_Task.Task_abort$($task)
1692
- clearInterval(interval)
1693
- }
1694
- }
1695
- import * as path from 'node:path'
1696
- queueMicrotask(async () => {
1697
- let fireflyPath_ = path.dirname(path.dirname(path.dirname(path.dirname(path.dirname(process.argv[1])))))
1698
- await $run$(fireflyPath_, process.argv.slice(2))
1699
- })
835
+
836
+ }
837
+
838
+
839
+
840
+ export const ff_core_Any_HasAnyTag$ff_compiler_Main_MainCommand = {
841
+ anyTag_() {
842
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Main.MainCommand" + "[") + "]"))
843
+ },
844
+ async anyTag_$($task) {
845
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Main.MainCommand" + "[") + "]"))
846
+ }
847
+ };
848
+
849
+ export const ff_core_Any_HasAnyTag$ff_compiler_Main_CommandLineError = {
850
+ anyTag_() {
851
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Main.CommandLineError" + "[") + "]"))
852
+ },
853
+ async anyTag_$($task) {
854
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Main.CommandLineError" + "[") + "]"))
855
+ }
856
+ };
857
+
858
+ export const ff_core_Show_Show$ff_compiler_Main_MainCommand = {
859
+ show_(value_) {
860
+ {
861
+ const value_a = value_;
862
+ {
863
+ if(value_a.BootstrapCommand) {
864
+ const z_ = value_a;
865
+ return "BootstrapCommand"
866
+ return
867
+ }
868
+ }
869
+ {
870
+ if(value_a.RunCommand) {
871
+ const z_ = value_a;
872
+ return ((((("RunCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.argument_)) + ")")
873
+ return
874
+ }
875
+ }
876
+ {
877
+ if(value_a.BrowserCommand) {
878
+ const z_ = value_a;
879
+ return ((("BrowserCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ")")
880
+ return
881
+ }
882
+ }
883
+ {
884
+ if(value_a.BuildCommand) {
885
+ const z_ = value_a;
886
+ return ((("BuildCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ")")
887
+ return
888
+ }
889
+ }
890
+ {
891
+ if(value_a.CheckCommand) {
892
+ const z_ = value_a;
893
+ return ((("CheckCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.filePath_)) + ")")
894
+ return
895
+ }
896
+ }
897
+ }
898
+ },
899
+ async show_$(value_, $task) {
900
+ {
901
+ const value_a = value_;
902
+ {
903
+ if(value_a.BootstrapCommand) {
904
+ const z_ = value_a;
905
+ return "BootstrapCommand"
906
+ return
907
+ }
908
+ }
909
+ {
910
+ if(value_a.RunCommand) {
911
+ const z_ = value_a;
912
+ return ((((("RunCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.argument_)) + ")")
913
+ return
914
+ }
915
+ }
916
+ {
917
+ if(value_a.BrowserCommand) {
918
+ const z_ = value_a;
919
+ return ((("BrowserCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ")")
920
+ return
921
+ }
922
+ }
923
+ {
924
+ if(value_a.BuildCommand) {
925
+ const z_ = value_a;
926
+ return ((("BuildCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.mainPath_)) + ")")
927
+ return
928
+ }
929
+ }
930
+ {
931
+ if(value_a.CheckCommand) {
932
+ const z_ = value_a;
933
+ return ((("CheckCommand" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.filePath_)) + ")")
934
+ return
935
+ }
936
+ }
937
+ }
938
+ }
939
+ };
940
+
941
+ export const ff_core_Show_Show$ff_compiler_Main_CommandLineError = {
942
+ show_(value_) {
943
+ {
944
+ const value_a = value_;
945
+ {
946
+ const z_ = value_a;
947
+ return ((("CommandLineError" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.problem_)) + ")")
948
+ return
949
+ }
950
+ }
951
+ },
952
+ async show_$(value_, $task) {
953
+ {
954
+ const value_a = value_;
955
+ {
956
+ const z_ = value_a;
957
+ return ((("CommandLineError" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.problem_)) + ")")
958
+ return
959
+ }
960
+ }
961
+ }
962
+ };
963
+
964
+ export const ff_core_Equal_Equal$ff_compiler_Main_MainCommand = {
965
+ equals_(x_, y_) {
966
+ {
967
+ const x_a = x_;
968
+ const y_a = y_;
969
+ {
970
+ const _guard1 = (x_ === y_);
971
+ if(_guard1) {
972
+ return true
973
+ return
974
+ }
975
+ }
976
+ {
977
+ if(x_a.RunCommand) {
978
+ const x_ = x_a;
979
+ if(y_a.RunCommand) {
980
+ const y_ = y_a;
981
+ return ((x_.mainPath_ === y_.mainPath_) && ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.argument_, y_.argument_))
982
+ return
983
+ }
984
+ }
985
+ }
986
+ {
987
+ if(x_a.BrowserCommand) {
988
+ const x_ = x_a;
989
+ if(y_a.BrowserCommand) {
990
+ const y_ = y_a;
991
+ return (x_.mainPath_ === y_.mainPath_)
992
+ return
993
+ }
994
+ }
995
+ }
996
+ {
997
+ if(x_a.BuildCommand) {
998
+ const x_ = x_a;
999
+ if(y_a.BuildCommand) {
1000
+ const y_ = y_a;
1001
+ return (x_.mainPath_ === y_.mainPath_)
1002
+ return
1003
+ }
1004
+ }
1005
+ }
1006
+ {
1007
+ if(x_a.CheckCommand) {
1008
+ const x_ = x_a;
1009
+ if(y_a.CheckCommand) {
1010
+ const y_ = y_a;
1011
+ return (x_.filePath_ === y_.filePath_)
1012
+ return
1013
+ }
1014
+ }
1015
+ }
1016
+ {
1017
+ return false
1018
+ return
1019
+ }
1020
+ }
1021
+ },
1022
+ async equals_$(x_, y_, $task) {
1023
+ {
1024
+ const x_a = x_;
1025
+ const y_a = y_;
1026
+ {
1027
+ const _guard1 = (x_ === y_);
1028
+ if(_guard1) {
1029
+ return true
1030
+ return
1031
+ }
1032
+ }
1033
+ {
1034
+ if(x_a.RunCommand) {
1035
+ const x_ = x_a;
1036
+ if(y_a.RunCommand) {
1037
+ const y_ = y_a;
1038
+ return ((x_.mainPath_ === y_.mainPath_) && ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.argument_, y_.argument_))
1039
+ return
1040
+ }
1041
+ }
1042
+ }
1043
+ {
1044
+ if(x_a.BrowserCommand) {
1045
+ const x_ = x_a;
1046
+ if(y_a.BrowserCommand) {
1047
+ const y_ = y_a;
1048
+ return (x_.mainPath_ === y_.mainPath_)
1049
+ return
1050
+ }
1051
+ }
1052
+ }
1053
+ {
1054
+ if(x_a.BuildCommand) {
1055
+ const x_ = x_a;
1056
+ if(y_a.BuildCommand) {
1057
+ const y_ = y_a;
1058
+ return (x_.mainPath_ === y_.mainPath_)
1059
+ return
1060
+ }
1061
+ }
1062
+ }
1063
+ {
1064
+ if(x_a.CheckCommand) {
1065
+ const x_ = x_a;
1066
+ if(y_a.CheckCommand) {
1067
+ const y_ = y_a;
1068
+ return (x_.filePath_ === y_.filePath_)
1069
+ return
1070
+ }
1071
+ }
1072
+ }
1073
+ {
1074
+ return false
1075
+ return
1076
+ }
1077
+ }
1078
+ }
1079
+ };
1080
+
1081
+ export const ff_core_Equal_Equal$ff_compiler_Main_CommandLineError = {
1082
+ equals_(x_, y_) {
1083
+ {
1084
+ const x_a = x_;
1085
+ const y_a = y_;
1086
+ {
1087
+ const _guard1 = (x_ === y_);
1088
+ if(_guard1) {
1089
+ return true
1090
+ return
1091
+ }
1092
+ }
1093
+ {
1094
+ return (x_.problem_ === y_.problem_)
1095
+ return
1096
+ }
1097
+ }
1098
+ },
1099
+ async equals_$(x_, y_, $task) {
1100
+ {
1101
+ const x_a = x_;
1102
+ const y_a = y_;
1103
+ {
1104
+ const _guard1 = (x_ === y_);
1105
+ if(_guard1) {
1106
+ return true
1107
+ return
1108
+ }
1109
+ }
1110
+ {
1111
+ return (x_.problem_ === y_.problem_)
1112
+ return
1113
+ }
1114
+ }
1115
+ }
1116
+ };
1117
+
1118
+ export const ff_core_Ordering_Order$ff_compiler_Main_MainCommand = {
1119
+ compare_(x_, y_) {
1120
+ {
1121
+ const x_a = x_;
1122
+ const y_a = y_;
1123
+ {
1124
+ const _guard1 = (x_ === y_);
1125
+ if(_guard1) {
1126
+ return ff_core_Ordering.OrderingSame()
1127
+ return
1128
+ }
1129
+ }
1130
+ {
1131
+ if(x_a.RunCommand) {
1132
+ const x_ = x_a;
1133
+ if(y_a.RunCommand) {
1134
+ const y_ = y_a;
1135
+ const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1136
+ if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1137
+ return mainPathOrdering_
1138
+ } else {
1139
+ const argumentOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.argument_, y_.argument_);
1140
+ if((argumentOrdering_ !== ff_core_Ordering.OrderingSame())) {
1141
+ return argumentOrdering_
1142
+ } else {
1143
+ return ff_core_Ordering.OrderingSame()
1144
+ }
1145
+ }
1146
+ return
1147
+ }
1148
+ }
1149
+ }
1150
+ {
1151
+ if(x_a.BrowserCommand) {
1152
+ const x_ = x_a;
1153
+ if(y_a.BrowserCommand) {
1154
+ const y_ = y_a;
1155
+ const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1156
+ if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1157
+ return mainPathOrdering_
1158
+ } else {
1159
+ return ff_core_Ordering.OrderingSame()
1160
+ }
1161
+ return
1162
+ }
1163
+ }
1164
+ }
1165
+ {
1166
+ if(x_a.BuildCommand) {
1167
+ const x_ = x_a;
1168
+ if(y_a.BuildCommand) {
1169
+ const y_ = y_a;
1170
+ const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1171
+ if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1172
+ return mainPathOrdering_
1173
+ } else {
1174
+ return ff_core_Ordering.OrderingSame()
1175
+ }
1176
+ return
1177
+ }
1178
+ }
1179
+ }
1180
+ {
1181
+ if(x_a.CheckCommand) {
1182
+ const x_ = x_a;
1183
+ if(y_a.CheckCommand) {
1184
+ const y_ = y_a;
1185
+ const filePathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.filePath_, y_.filePath_);
1186
+ if((filePathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1187
+ return filePathOrdering_
1188
+ } else {
1189
+ return ff_core_Ordering.OrderingSame()
1190
+ }
1191
+ return
1192
+ }
1193
+ }
1194
+ }
1195
+ {
1196
+ function number_(z_) {
1197
+ {
1198
+ const z_a = z_;
1199
+ {
1200
+ if(z_a.BootstrapCommand) {
1201
+ return 0
1202
+ return
1203
+ }
1204
+ }
1205
+ {
1206
+ if(z_a.RunCommand) {
1207
+ return 1
1208
+ return
1209
+ }
1210
+ }
1211
+ {
1212
+ if(z_a.BrowserCommand) {
1213
+ return 2
1214
+ return
1215
+ }
1216
+ }
1217
+ {
1218
+ if(z_a.BuildCommand) {
1219
+ return 3
1220
+ return
1221
+ }
1222
+ }
1223
+ {
1224
+ if(z_a.CheckCommand) {
1225
+ return 4
1226
+ return
1227
+ }
1228
+ }
1229
+ }
1230
+ }
1231
+ return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
1232
+ return
1233
+ }
1234
+ }
1235
+ },
1236
+ async compare_$(x_, y_, $task) {
1237
+ {
1238
+ const x_a = x_;
1239
+ const y_a = y_;
1240
+ {
1241
+ const _guard1 = (x_ === y_);
1242
+ if(_guard1) {
1243
+ return ff_core_Ordering.OrderingSame()
1244
+ return
1245
+ }
1246
+ }
1247
+ {
1248
+ if(x_a.RunCommand) {
1249
+ const x_ = x_a;
1250
+ if(y_a.RunCommand) {
1251
+ const y_ = y_a;
1252
+ const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1253
+ if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1254
+ return mainPathOrdering_
1255
+ } else {
1256
+ const argumentOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.argument_, y_.argument_);
1257
+ if((argumentOrdering_ !== ff_core_Ordering.OrderingSame())) {
1258
+ return argumentOrdering_
1259
+ } else {
1260
+ return ff_core_Ordering.OrderingSame()
1261
+ }
1262
+ }
1263
+ return
1264
+ }
1265
+ }
1266
+ }
1267
+ {
1268
+ if(x_a.BrowserCommand) {
1269
+ const x_ = x_a;
1270
+ if(y_a.BrowserCommand) {
1271
+ const y_ = y_a;
1272
+ const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1273
+ if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1274
+ return mainPathOrdering_
1275
+ } else {
1276
+ return ff_core_Ordering.OrderingSame()
1277
+ }
1278
+ return
1279
+ }
1280
+ }
1281
+ }
1282
+ {
1283
+ if(x_a.BuildCommand) {
1284
+ const x_ = x_a;
1285
+ if(y_a.BuildCommand) {
1286
+ const y_ = y_a;
1287
+ const mainPathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.mainPath_, y_.mainPath_);
1288
+ if((mainPathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1289
+ return mainPathOrdering_
1290
+ } else {
1291
+ return ff_core_Ordering.OrderingSame()
1292
+ }
1293
+ return
1294
+ }
1295
+ }
1296
+ }
1297
+ {
1298
+ if(x_a.CheckCommand) {
1299
+ const x_ = x_a;
1300
+ if(y_a.CheckCommand) {
1301
+ const y_ = y_a;
1302
+ const filePathOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.filePath_, y_.filePath_);
1303
+ if((filePathOrdering_ !== ff_core_Ordering.OrderingSame())) {
1304
+ return filePathOrdering_
1305
+ } else {
1306
+ return ff_core_Ordering.OrderingSame()
1307
+ }
1308
+ return
1309
+ }
1310
+ }
1311
+ }
1312
+ {
1313
+ function number_(z_) {
1314
+ {
1315
+ const z_a = z_;
1316
+ {
1317
+ if(z_a.BootstrapCommand) {
1318
+ return 0
1319
+ return
1320
+ }
1321
+ }
1322
+ {
1323
+ if(z_a.RunCommand) {
1324
+ return 1
1325
+ return
1326
+ }
1327
+ }
1328
+ {
1329
+ if(z_a.BrowserCommand) {
1330
+ return 2
1331
+ return
1332
+ }
1333
+ }
1334
+ {
1335
+ if(z_a.BuildCommand) {
1336
+ return 3
1337
+ return
1338
+ }
1339
+ }
1340
+ {
1341
+ if(z_a.CheckCommand) {
1342
+ return 4
1343
+ return
1344
+ }
1345
+ }
1346
+ }
1347
+ }
1348
+ return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
1349
+ return
1350
+ }
1351
+ }
1352
+ }
1353
+ };
1354
+
1355
+ export const ff_core_Ordering_Order$ff_compiler_Main_CommandLineError = {
1356
+ compare_(x_, y_) {
1357
+ {
1358
+ const x_a = x_;
1359
+ const y_a = y_;
1360
+ {
1361
+ const _guard1 = (x_ === y_);
1362
+ if(_guard1) {
1363
+ return ff_core_Ordering.OrderingSame()
1364
+ return
1365
+ }
1366
+ }
1367
+ {
1368
+ const problemOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.problem_, y_.problem_);
1369
+ if((problemOrdering_ !== ff_core_Ordering.OrderingSame())) {
1370
+ return problemOrdering_
1371
+ } else {
1372
+ return ff_core_Ordering.OrderingSame()
1373
+ }
1374
+ return
1375
+ }
1376
+ }
1377
+ },
1378
+ async compare_$(x_, y_, $task) {
1379
+ {
1380
+ const x_a = x_;
1381
+ const y_a = y_;
1382
+ {
1383
+ const _guard1 = (x_ === y_);
1384
+ if(_guard1) {
1385
+ return ff_core_Ordering.OrderingSame()
1386
+ return
1387
+ }
1388
+ }
1389
+ {
1390
+ const problemOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.problem_, y_.problem_);
1391
+ if((problemOrdering_ !== ff_core_Ordering.OrderingSame())) {
1392
+ return problemOrdering_
1393
+ } else {
1394
+ return ff_core_Ordering.OrderingSame()
1395
+ }
1396
+ return
1397
+ }
1398
+ }
1399
+ }
1400
+ };
1401
+
1402
+ export const ff_core_Serializable_Serializable$ff_compiler_Main_MainCommand = {
1403
+ serializeUsing_(serialization_, value_) {
1404
+ {
1405
+ const serialization_a = serialization_;
1406
+ const value_a = value_;
1407
+ {
1408
+ if(value_a.BootstrapCommand) {
1409
+ const v_ = value_a;
1410
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1411
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
1412
+ serialization_.offset_ += 1
1413
+ return
1414
+ }
1415
+ }
1416
+ {
1417
+ if(value_a.RunCommand) {
1418
+ const v_ = value_a;
1419
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1420
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 1);
1421
+ serialization_.offset_ += 1;
1422
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_);
1423
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.argument_)
1424
+ return
1425
+ }
1426
+ }
1427
+ {
1428
+ if(value_a.BrowserCommand) {
1429
+ const v_ = value_a;
1430
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
1431
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 2);
1432
+ serialization_.offset_ += 1;
1433
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_)
1434
+ return
1435
+ }
1436
+ }
1437
+ {
1438
+ if(value_a.BuildCommand) {
1439
+ const v_ = value_a;
1440
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1441
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 3);
1442
+ serialization_.offset_ += 1;
1443
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_)
1444
+ return
1445
+ }
1446
+ }
1447
+ {
1448
+ if(value_a.CheckCommand) {
1449
+ const v_ = value_a;
1450
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1451
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 4);
1452
+ serialization_.offset_ += 1;
1453
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.filePath_)
1454
+ return
1455
+ }
1456
+ }
1457
+ }
1458
+ },
1459
+ deserializeUsing_(serialization_) {
1460
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1461
+ serialization_.offset_ += 1;
1462
+ {
1463
+ const _1 = variantIndex_;
1464
+ {
1465
+ if(_1 == 0) {
1466
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1467
+ return ff_compiler_Main.BootstrapCommand()
1468
+ return
1469
+ }
1470
+ }
1471
+ {
1472
+ if(_1 == 1) {
1473
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1474
+ return ff_compiler_Main.RunCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
1475
+ return
1476
+ }
1477
+ }
1478
+ {
1479
+ if(_1 == 2) {
1480
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
1481
+ return ff_compiler_Main.BrowserCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1482
+ return
1483
+ }
1484
+ }
1485
+ {
1486
+ if(_1 == 3) {
1487
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1488
+ return ff_compiler_Main.BuildCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1489
+ return
1490
+ }
1491
+ }
1492
+ {
1493
+ if(_1 == 4) {
1494
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1495
+ return ff_compiler_Main.CheckCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1496
+ return
1497
+ }
1498
+ }
1499
+ {
1500
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1501
+ return
1502
+ }
1503
+ }
1504
+ },
1505
+ async serializeUsing_$(serialization_, value_, $task) {
1506
+ {
1507
+ const serialization_a = serialization_;
1508
+ const value_a = value_;
1509
+ {
1510
+ if(value_a.BootstrapCommand) {
1511
+ const v_ = value_a;
1512
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1513
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
1514
+ serialization_.offset_ += 1
1515
+ return
1516
+ }
1517
+ }
1518
+ {
1519
+ if(value_a.RunCommand) {
1520
+ const v_ = value_a;
1521
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1522
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 1);
1523
+ serialization_.offset_ += 1;
1524
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_);
1525
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.argument_)
1526
+ return
1527
+ }
1528
+ }
1529
+ {
1530
+ if(value_a.BrowserCommand) {
1531
+ const v_ = value_a;
1532
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
1533
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 2);
1534
+ serialization_.offset_ += 1;
1535
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_)
1536
+ return
1537
+ }
1538
+ }
1539
+ {
1540
+ if(value_a.BuildCommand) {
1541
+ const v_ = value_a;
1542
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1543
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 3);
1544
+ serialization_.offset_ += 1;
1545
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.mainPath_)
1546
+ return
1547
+ }
1548
+ }
1549
+ {
1550
+ if(value_a.CheckCommand) {
1551
+ const v_ = value_a;
1552
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1553
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 4);
1554
+ serialization_.offset_ += 1;
1555
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.filePath_)
1556
+ return
1557
+ }
1558
+ }
1559
+ }
1560
+ },
1561
+ async deserializeUsing_$(serialization_, $task) {
1562
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1563
+ serialization_.offset_ += 1;
1564
+ {
1565
+ const _1 = variantIndex_;
1566
+ {
1567
+ if(_1 == 0) {
1568
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1569
+ return ff_compiler_Main.BootstrapCommand()
1570
+ return
1571
+ }
1572
+ }
1573
+ {
1574
+ if(_1 == 1) {
1575
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1576
+ return ff_compiler_Main.RunCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
1577
+ return
1578
+ }
1579
+ }
1580
+ {
1581
+ if(_1 == 2) {
1582
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
1583
+ return ff_compiler_Main.BrowserCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1584
+ return
1585
+ }
1586
+ }
1587
+ {
1588
+ if(_1 == 3) {
1589
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1590
+ return ff_compiler_Main.BuildCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1591
+ return
1592
+ }
1593
+ }
1594
+ {
1595
+ if(_1 == 4) {
1596
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 29), 0);
1597
+ return ff_compiler_Main.CheckCommand(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1598
+ return
1599
+ }
1600
+ }
1601
+ {
1602
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1603
+ return
1604
+ }
1605
+ }
1606
+ }
1607
+ };
1608
+
1609
+ export const ff_core_Serializable_Serializable$ff_compiler_Main_CommandLineError = {
1610
+ serializeUsing_(serialization_, value_) {
1611
+ {
1612
+ const serialization_a = serialization_;
1613
+ const value_a = value_;
1614
+ {
1615
+ const v_ = value_a;
1616
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1617
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
1618
+ serialization_.offset_ += 1;
1619
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.problem_)
1620
+ return
1621
+ }
1622
+ }
1623
+ },
1624
+ deserializeUsing_(serialization_) {
1625
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1626
+ serialization_.offset_ += 1;
1627
+ {
1628
+ const _1 = variantIndex_;
1629
+ {
1630
+ if(_1 == 0) {
1631
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1632
+ return ff_compiler_Main.CommandLineError(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1633
+ return
1634
+ }
1635
+ }
1636
+ {
1637
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1638
+ return
1639
+ }
1640
+ }
1641
+ },
1642
+ async serializeUsing_$(serialization_, value_, $task) {
1643
+ {
1644
+ const serialization_a = serialization_;
1645
+ const value_a = value_;
1646
+ {
1647
+ const v_ = value_a;
1648
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1649
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
1650
+ serialization_.offset_ += 1;
1651
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.problem_)
1652
+ return
1653
+ }
1654
+ }
1655
+ },
1656
+ async deserializeUsing_$(serialization_, $task) {
1657
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1658
+ serialization_.offset_ += 1;
1659
+ {
1660
+ const _1 = variantIndex_;
1661
+ {
1662
+ if(_1 == 0) {
1663
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
1664
+ return ff_compiler_Main.CommandLineError(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1665
+ return
1666
+ }
1667
+ }
1668
+ {
1669
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1670
+ return
1671
+ }
1672
+ }
1673
+ }
1674
+ };
1675
+
1676
+ export async function $run$(fireflyPath_, arguments_) {
1677
+ Error.stackTraceLimit = 50
1678
+ const $task = {controller: new AbortController(), subtasks: new Set(), promise: new Promise(() => {}), started: performance.now() * 0.001}
1679
+ let interval = setInterval(() => {}, 24 * 60 * 60 * 1000)
1680
+ let system = {
1681
+ task_: $task,
1682
+ array_: arguments_,
1683
+ fireflyPath_: fireflyPath_,
1684
+ mainPackagePair_: {group_: "ff", name_: "compiler"},
1685
+ executableMode_: false,
1686
+ buildMode_: false
1687
+ }
1688
+ try {
1689
+ await main_$(system, $task)
1690
+ } finally {
1691
+ ff_core_Task.Task_abort$($task)
1692
+ clearInterval(interval)
1693
+ }
1694
+ }
1695
+ import * as path from 'node:path'
1696
+ queueMicrotask(async () => {
1697
+ let fireflyPath_ = path.dirname(path.dirname(path.dirname(path.dirname(path.dirname(process.argv[1])))))
1698
+ await $run$(fireflyPath_, process.argv.slice(2))
1699
+ })