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