firefly-compiler 0.4.31 → 0.4.33
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/bin/Release.ff +6 -0
- package/compiler/Builder.ff +15 -7
- package/compiler/Compiler.ff +13 -8
- package/compiler/Dependencies.ff +24 -17
- package/compiler/DependencyLock.ff +17 -0
- package/compiler/Deriver.ff +2 -1
- package/compiler/Dictionaries.ff +4 -4
- package/compiler/Environment.ff +3 -3
- package/compiler/Inference.ff +7 -7
- package/compiler/JsEmitter.ff +2 -2
- package/compiler/JsImporter.ff +2 -2
- package/compiler/LspHook.ff +2 -2
- package/compiler/Main.ff +22 -8
- package/compiler/ModuleCache.ff +6 -6
- package/compiler/Parser.ff +36 -36
- package/compiler/Resolver.ff +7 -7
- package/compiler/Syntax.ff +1 -1
- package/compiler/Tokenizer.ff +2 -2
- package/compiler/Unification.ff +3 -3
- package/compiler/Wildcards.ff +1 -1
- package/core/.firefly/include/package-lock.json +96 -96
- package/core/.firefly/include/package.json +1 -1
- package/core/Array.ff +2 -2
- package/core/Atomic.ff +1 -1
- package/core/Buffer.ff +1 -1
- package/core/Int.ff +2 -2
- package/core/IntMap.ff +4 -4
- package/core/Json.ff +5 -5
- package/core/List.ff +15 -15
- package/core/Map.ff +1 -1
- package/core/NodeSystem.ff +89 -0
- package/core/Option.ff +10 -3
- package/core/Random.ff +1 -1
- package/core/RbMap.ff +1 -1
- package/core/Serializable.ff +2 -2
- package/core/Set.ff +2 -2
- package/core/Stream.ff +4 -4
- package/core/StringMap.ff +4 -4
- package/experimental/random/Index.ff +53 -0
- package/experimental/random/MapTest.ff +2 -2
- package/experimental/random/Process.ff +120 -0
- package/experimental/random/RunLength.ff +2 -2
- package/experimental/random/Symbols.ff +2 -2
- package/lsp/CompletionHandler.ff +3 -6
- package/lsp/Handler.ff +45 -24
- package/lsp/LanguageServer.ff +13 -3
- package/lsp/SymbolHandler.ff +2 -2
- package/lsp/TestReferences.ff +2 -2
- package/lux/Lux.ff +6 -6
- package/output/js/ff/compiler/Builder.mjs +40 -28
- package/output/js/ff/compiler/Compiler.mjs +38 -14
- package/output/js/ff/compiler/Dependencies.mjs +30 -16
- package/output/js/ff/compiler/DependencyLock.mjs +128 -0
- package/output/js/ff/compiler/Deriver.mjs +4 -4
- package/output/js/ff/compiler/Dictionaries.mjs +8 -8
- package/output/js/ff/compiler/Environment.mjs +6 -6
- package/output/js/ff/compiler/Inference.mjs +12 -12
- package/output/js/ff/compiler/JsEmitter.mjs +4 -4
- package/output/js/ff/compiler/JsImporter.mjs +4 -4
- package/output/js/ff/compiler/LspHook.mjs +4 -4
- package/output/js/ff/compiler/Main.mjs +14 -12
- package/output/js/ff/compiler/ModuleCache.mjs +4 -4
- package/output/js/ff/compiler/Parser.mjs +72 -72
- package/output/js/ff/compiler/Resolver.mjs +14 -14
- package/output/js/ff/compiler/Syntax.mjs +2 -2
- package/output/js/ff/compiler/Tokenizer.mjs +4 -4
- package/output/js/ff/compiler/Unification.mjs +4 -4
- package/output/js/ff/compiler/Wildcards.mjs +2 -2
- package/output/js/ff/core/Array.mjs +5 -5
- package/output/js/ff/core/Atomic.mjs +3 -3
- package/output/js/ff/core/Buffer.mjs +3 -3
- package/output/js/ff/core/Int.mjs +4 -4
- package/output/js/ff/core/IntMap.mjs +9 -9
- package/output/js/ff/core/Json.mjs +10 -10
- package/output/js/ff/core/List.mjs +31 -31
- package/output/js/ff/core/Map.mjs +2 -2
- package/output/js/ff/core/NodeSystem.mjs +115 -0
- package/output/js/ff/core/Option.mjs +28 -2
- package/output/js/ff/core/Random.mjs +2 -2
- package/output/js/ff/core/RbMap.mjs +2 -2
- package/output/js/ff/core/Serializable.mjs +4 -4
- package/output/js/ff/core/Set.mjs +4 -4
- package/output/js/ff/core/Stream.mjs +8 -8
- package/output/js/ff/core/StringMap.mjs +9 -9
- package/package.json +1 -1
- package/postgresql/Pg.ff +2 -2
- package/rpc/Rpc.ff +3 -3
- package/vscode/package.json +1 -1
- package/webserver/WebServer.ff +2 -2
- package/httpserver/.firefly/package.ff +0 -1
- package/httpserver/HttpServer.ff +0 -184
|
@@ -107,8 +107,8 @@ return {unification_, missing_, lspHook_};
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
export function
|
|
111
|
-
return ff_compiler_Inference.Inference(ff_compiler_Unification.
|
|
110
|
+
export function new_(modules_, lspHook_) {
|
|
111
|
+
return ff_compiler_Inference.Inference(ff_compiler_Unification.new_(modules_, ff_compiler_LspHook.LspHook_isEnabled(lspHook_)), ff_core_StringMap.new_(), lspHook_)
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export function fail_(at_, message_) {
|
|
@@ -136,8 +136,8 @@ return ff_core_Pair.Pair(ff_compiler_Unification.InstanceKey(c_.name_, typeName_
|
|
|
136
136
|
})), ff_compiler_Unification.ff_core_Ordering_Order$ff_compiler_Unification_InstanceKey)
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
export async function
|
|
140
|
-
return ff_compiler_Inference.Inference(ff_compiler_Unification.
|
|
139
|
+
export async function new_$(modules_, lspHook_, $task) {
|
|
140
|
+
return ff_compiler_Inference.Inference(ff_compiler_Unification.new_(modules_, ff_compiler_LspHook.LspHook_isEnabled(lspHook_)), ff_core_StringMap.new_(), lspHook_)
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
export async function fail_$(at_, message_, $task) {
|
|
@@ -166,7 +166,7 @@ return ff_core_Pair.Pair(ff_compiler_Unification.InstanceKey(c_.name_, typeName_
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
export function Inference_inferModule(self_, module_, otherModules_) {
|
|
169
|
-
const environment_ = ff_compiler_Environment.
|
|
169
|
+
const environment_ = ff_compiler_Environment.new_(module_, otherModules_, false);
|
|
170
170
|
const traits_ = ff_core_List.List_map(module_.traits_, ((_w1) => {
|
|
171
171
|
return ff_compiler_Inference.Inference_inferTraitDefinition(self_, environment_, _w1)
|
|
172
172
|
}));
|
|
@@ -496,7 +496,7 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.InferPatter
|
|
|
496
496
|
};
|
|
497
497
|
function literal_(coreTypeName_) {
|
|
498
498
|
ff_compiler_Unification.Unification_unify(self_.unification_, pattern_.at_, expected_, ff_compiler_Syntax.TConstructor(pattern_.at_, ff_compiler_Inference.core_(coreTypeName_), []));
|
|
499
|
-
return ff_core_Map.
|
|
499
|
+
return ff_core_Map.new_()
|
|
500
500
|
}
|
|
501
501
|
{
|
|
502
502
|
const _1 = pattern_;
|
|
@@ -511,7 +511,7 @@ return literal_("Char")
|
|
|
511
511
|
}
|
|
512
512
|
if(_1.PVariable && _1.name_.None) {
|
|
513
513
|
const at_ = _1.at_;
|
|
514
|
-
return ff_core_Map.
|
|
514
|
+
return ff_core_Map.new_()
|
|
515
515
|
}
|
|
516
516
|
if(_1.PVariable && _1.name_.Some) {
|
|
517
517
|
const at_ = _1.at_;
|
|
@@ -609,7 +609,7 @@ const pattern_ = _1.first_;
|
|
|
609
609
|
const parameter_ = _1.second_;
|
|
610
610
|
return ff_compiler_Inference.Inference_inferPattern(self_, environment_, parameter_.valueType_, pattern_)
|
|
611
611
|
}
|
|
612
|
-
})), ff_core_Map.
|
|
612
|
+
})), ff_core_Map.new_(), ((_w1, _w2) => {
|
|
613
613
|
return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
614
614
|
}))
|
|
615
615
|
return
|
|
@@ -1964,7 +1964,7 @@ return instantiated_
|
|
|
1964
1964
|
}
|
|
1965
1965
|
|
|
1966
1966
|
export async function Inference_inferModule$(self_, module_, otherModules_, $task) {
|
|
1967
|
-
const environment_ = ff_compiler_Environment.
|
|
1967
|
+
const environment_ = ff_compiler_Environment.new_(module_, otherModules_, false);
|
|
1968
1968
|
const traits_ = ff_core_List.List_map(module_.traits_, ((_w1) => {
|
|
1969
1969
|
return ff_compiler_Inference.Inference_inferTraitDefinition(self_, environment_, _w1)
|
|
1970
1970
|
}));
|
|
@@ -2294,7 +2294,7 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.InferPatter
|
|
|
2294
2294
|
};
|
|
2295
2295
|
function literal_(coreTypeName_) {
|
|
2296
2296
|
ff_compiler_Unification.Unification_unify(self_.unification_, pattern_.at_, expected_, ff_compiler_Syntax.TConstructor(pattern_.at_, ff_compiler_Inference.core_(coreTypeName_), []));
|
|
2297
|
-
return ff_core_Map.
|
|
2297
|
+
return ff_core_Map.new_()
|
|
2298
2298
|
}
|
|
2299
2299
|
{
|
|
2300
2300
|
const _1 = pattern_;
|
|
@@ -2309,7 +2309,7 @@ return literal_("Char")
|
|
|
2309
2309
|
}
|
|
2310
2310
|
if(_1.PVariable && _1.name_.None) {
|
|
2311
2311
|
const at_ = _1.at_;
|
|
2312
|
-
return ff_core_Map.
|
|
2312
|
+
return ff_core_Map.new_()
|
|
2313
2313
|
}
|
|
2314
2314
|
if(_1.PVariable && _1.name_.Some) {
|
|
2315
2315
|
const at_ = _1.at_;
|
|
@@ -2407,7 +2407,7 @@ const pattern_ = _1.first_;
|
|
|
2407
2407
|
const parameter_ = _1.second_;
|
|
2408
2408
|
return ff_compiler_Inference.Inference_inferPattern(self_, environment_, parameter_.valueType_, pattern_)
|
|
2409
2409
|
}
|
|
2410
|
-
})), ff_core_Map.
|
|
2410
|
+
})), ff_core_Map.new_(), ((_w1, _w2) => {
|
|
2411
2411
|
return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
2412
2412
|
}))
|
|
2413
2413
|
return
|
|
@@ -126,11 +126,11 @@ return {variantName_, newtype_, loneVariant_, arguments_};
|
|
|
126
126
|
|
|
127
127
|
export const primitiveTypes_ = ff_core_List.List_toSet(["ff:core/Bool.Bool", "ff:core/Char.Char", "ff:core/Int.Int", "ff:core/Float.Float", "ff:core/String.String"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
128
128
|
|
|
129
|
-
export function
|
|
129
|
+
export function new_(otherModules_, emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_) {
|
|
130
130
|
return ff_compiler_JsEmitter.JsEmitter(ff_core_List.List_toMap(ff_core_List.List_map(otherModules_, ((m_) => {
|
|
131
131
|
const moduleName_ = ((ff_compiler_Syntax.PackagePair_groupName(m_.packagePair_, ":") + "/") + ff_core_String.String_dropLast(m_.file_, 3));
|
|
132
132
|
return ff_core_Pair.Pair(moduleName_, m_)
|
|
133
|
-
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_JsImporter.
|
|
133
|
+
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_JsImporter.new_(), emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, false, false)
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
export function fail_(at_, message_) {
|
|
@@ -270,11 +270,11 @@ return false
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
export async function
|
|
273
|
+
export async function new_$(otherModules_, emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, $task) {
|
|
274
274
|
return ff_compiler_JsEmitter.JsEmitter(ff_core_List.List_toMap(ff_core_List.List_map(otherModules_, ((m_) => {
|
|
275
275
|
const moduleName_ = ((ff_compiler_Syntax.PackagePair_groupName(m_.packagePair_, ":") + "/") + ff_core_String.String_dropLast(m_.file_, 3));
|
|
276
276
|
return ff_core_Pair.Pair(moduleName_, m_)
|
|
277
|
-
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_JsImporter.
|
|
277
|
+
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_JsImporter.new_(), emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, false, false)
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
export async function fail_$(at_, message_, $task) {
|
|
@@ -99,16 +99,16 @@ return {imports_};
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
export function
|
|
103
|
-
return ff_compiler_JsImporter.JsImporter(ff_core_Map.
|
|
102
|
+
export function new_() {
|
|
103
|
+
return ff_compiler_JsImporter.JsImporter(ff_core_Map.new_())
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
export function fail_(at_, message_) {
|
|
107
107
|
return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
export async function
|
|
111
|
-
return ff_compiler_JsImporter.JsImporter(ff_core_Map.
|
|
110
|
+
export async function new_$($task) {
|
|
111
|
+
return ff_compiler_JsImporter.JsImporter(ff_core_Map.new_())
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export async function fail_$(at_, message_, $task) {
|
|
@@ -204,10 +204,10 @@ return {InferRecordFieldHook: true, usageAt_, unification_, environment_, expect
|
|
|
204
204
|
|
|
205
205
|
|
|
206
206
|
export function disabled_() {
|
|
207
|
-
return ff_compiler_LspHook.
|
|
207
|
+
return ff_compiler_LspHook.new_(ff_core_Option.None(), ff_core_Option.None(), false, false)
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
export function
|
|
210
|
+
export function new_(at_, definedAt_, insertIdentifier_, trackSymbols_) {
|
|
211
211
|
return ff_compiler_LspHook.LspHook(ff_core_Option.Option_else(at_, (() => {
|
|
212
212
|
return ff_compiler_Syntax.Location("^lsp", (-7), (-7))
|
|
213
213
|
})), ff_core_Option.Option_else(definedAt_, (() => {
|
|
@@ -340,10 +340,10 @@ return "ResolveVariantFieldHook(...)"
|
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
export async function disabled_$($task) {
|
|
343
|
-
return ff_compiler_LspHook.
|
|
343
|
+
return ff_compiler_LspHook.new_(ff_core_Option.None(), ff_core_Option.None(), false, false)
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
export async function
|
|
346
|
+
export async function new_$(at_, definedAt_, insertIdentifier_, trackSymbols_, $task) {
|
|
347
347
|
return ff_compiler_LspHook.LspHook(ff_core_Option.Option_else(at_, (() => {
|
|
348
348
|
return ff_compiler_Syntax.Location("^lsp", (-7), (-7))
|
|
349
349
|
})), ff_core_Option.Option_else(definedAt_, (() => {
|
|
@@ -8,6 +8,8 @@ import * as ff_compiler_Compiler from "../../ff/compiler/Compiler.mjs"
|
|
|
8
8
|
|
|
9
9
|
import * as ff_compiler_Dependencies from "../../ff/compiler/Dependencies.mjs"
|
|
10
10
|
|
|
11
|
+
import * as ff_compiler_DependencyLock from "../../ff/compiler/DependencyLock.mjs"
|
|
12
|
+
|
|
11
13
|
import * as ff_compiler_Inference from "../../ff/compiler/Inference.mjs"
|
|
12
14
|
|
|
13
15
|
import * as ff_compiler_JsEmitter from "../../ff/compiler/JsEmitter.mjs"
|
|
@@ -173,14 +175,14 @@ return "executable"
|
|
|
173
175
|
}))(emitTarget_);
|
|
174
176
|
ff_compiler_Builder.build_(system_, emitTarget_, mainPackagePair_, mainFile_, (((_c) => {
|
|
175
177
|
return ff_compiler_Dependencies.ResolvedDependencies(_c.mainPackagePair_, _c.packages_, fixedPackagePaths_, _c.singleFilePackages_)
|
|
176
|
-
}))(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, ff_compiler_ModuleCache.
|
|
178
|
+
}))(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, ff_compiler_ModuleCache.new_(0))
|
|
177
179
|
}
|
|
178
180
|
function runCommand_(command_) {
|
|
179
181
|
const command_a = command_;
|
|
180
182
|
if(command_a.RunCommand) {
|
|
181
183
|
const mainFile_ = command_a.mainPath_;
|
|
182
184
|
const arguments_ = command_a.argument_;
|
|
183
|
-
const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
|
|
185
|
+
const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_compiler_DependencyLock.new_(ff_core_NodeSystem.NodeSystem_mainTask(system_)), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
|
|
184
186
|
ff_compiler_Main.prepareFireflyDirectory_(ff_core_NodeSystem.NodeSystem_path(system_, "."));
|
|
185
187
|
const localMainFile_ = ff_core_Path.Path_base(ff_core_NodeSystem.NodeSystem_path(system_, mainFile_));
|
|
186
188
|
buildScript_(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitNode(), resolvedDependencies_);
|
|
@@ -192,7 +194,7 @@ return
|
|
|
192
194
|
}
|
|
193
195
|
if(command_a.BrowserCommand) {
|
|
194
196
|
const mainFile_ = command_a.mainPath_;
|
|
195
|
-
const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
|
|
197
|
+
const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_compiler_DependencyLock.new_(ff_core_NodeSystem.NodeSystem_mainTask(system_)), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
|
|
196
198
|
ff_compiler_Main.prepareFireflyDirectory_(ff_core_NodeSystem.NodeSystem_path(system_, "."));
|
|
197
199
|
const localMainFile_ = ff_core_Path.Path_base(ff_core_NodeSystem.NodeSystem_path(system_, mainFile_));
|
|
198
200
|
buildScript_(mainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBrowser(), resolvedDependencies_);
|
|
@@ -201,7 +203,7 @@ return
|
|
|
201
203
|
}
|
|
202
204
|
if(command_a.BuildCommand) {
|
|
203
205
|
const mainFile_ = command_a.mainPath_;
|
|
204
|
-
const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
|
|
206
|
+
const resolvedDependencies_ = ff_compiler_Dependencies.process_(ff_core_NodeSystem.NodeSystem_httpClient(system_), ff_compiler_DependencyLock.new_(ff_core_NodeSystem.NodeSystem_mainTask(system_)), ff_core_NodeSystem.NodeSystem_path(system_, (mainFile_ + ".ff")));
|
|
205
207
|
ff_compiler_Main.prepareFireflyDirectory_(ff_core_NodeSystem.NodeSystem_path(system_, "."));
|
|
206
208
|
const localMainFile_ = ff_core_Path.Path_base(ff_core_NodeSystem.NodeSystem_path(system_, mainFile_));
|
|
207
209
|
buildScript_(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBuild(), resolvedDependencies_);
|
|
@@ -212,7 +214,7 @@ return
|
|
|
212
214
|
}
|
|
213
215
|
if(command_a.CheckCommand) {
|
|
214
216
|
const filePath_ = command_a.filePath_;
|
|
215
|
-
const errors_ = ff_compiler_Builder.check_(system_, fireflyPath_, ff_core_NodeSystem.NodeSystem_path(system_, filePath_), ff_core_Option.None(), ff_core_Set.
|
|
217
|
+
const errors_ = ff_compiler_Builder.check_(system_, fireflyPath_, ff_core_NodeSystem.NodeSystem_path(system_, filePath_), ff_core_Option.None(), ff_core_Set.new_(), ff_core_Map.new_(), ff_compiler_ModuleCache.new_(1), ff_compiler_DependencyLock.new_(ff_core_NodeSystem.NodeSystem_mainTask(system_)), 0, ff_compiler_LspHook.disabled_(), true, false);
|
|
216
218
|
if((!ff_core_List.List_isEmpty(errors_))) {
|
|
217
219
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileErrors(ff_core_List.List_distinct(errors_, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_CompileError)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors)})
|
|
218
220
|
}
|
|
@@ -221,7 +223,7 @@ return
|
|
|
221
223
|
if(command_a.BootstrapCommand) {
|
|
222
224
|
const workingDirectory_ = ff_core_NodeSystem.NodeSystem_path(system_, ".");
|
|
223
225
|
const fakeLocation_ = ff_compiler_Syntax.Location("<core>", 0, 0);
|
|
224
|
-
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_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.PackageInfo(ff_compiler_Syntax.DPackage(fakeLocation_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.Version(fakeLocation_, 0, 0, 0), ff_compiler_Syntax.TargetNames(true, false)), [], [ff_compiler_Syntax.DInclude(fakeLocation_, "node_modules")]))], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap([ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "compiler"), ff_core_Path.Path_slash(workingDirectory_, "compiler")), ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), ff_core_Path.Path_slash(workingDirectory_, "core"))], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet([], 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, ff_compiler_ModuleCache.
|
|
226
|
+
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_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.PackageInfo(ff_compiler_Syntax.DPackage(fakeLocation_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.Version(fakeLocation_, 0, 0, 0), ff_compiler_Syntax.TargetNames(true, false)), [], [ff_compiler_Syntax.DInclude(fakeLocation_, "node_modules")]))], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap([ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "compiler"), ff_core_Path.Path_slash(workingDirectory_, "compiler")), ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), ff_core_Path.Path_slash(workingDirectory_, "core"))], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet([], 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, ff_compiler_ModuleCache.new_(0))
|
|
225
227
|
return
|
|
226
228
|
}
|
|
227
229
|
}
|
|
@@ -421,14 +423,14 @@ return "executable"
|
|
|
421
423
|
}))(emitTarget_);
|
|
422
424
|
(await ff_compiler_Builder.build_$(system_, emitTarget_, mainPackagePair_, mainFile_, (((_c) => {
|
|
423
425
|
return ff_compiler_Dependencies.ResolvedDependencies(_c.mainPackagePair_, _c.packages_, fixedPackagePaths_, _c.singleFilePackages_)
|
|
424
|
-
}))(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, ff_compiler_ModuleCache.
|
|
426
|
+
}))(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, ff_compiler_ModuleCache.new_(0), $task))
|
|
425
427
|
}
|
|
426
428
|
async function runCommand_$(command_, $task) {
|
|
427
429
|
const command_a = command_;
|
|
428
430
|
if(command_a.RunCommand) {
|
|
429
431
|
const mainFile_ = command_a.mainPath_;
|
|
430
432
|
const arguments_ = command_a.argument_;
|
|
431
|
-
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));
|
|
433
|
+
const resolvedDependencies_ = (await ff_compiler_Dependencies.process_$((await ff_core_NodeSystem.NodeSystem_httpClient$(system_, $task)), (await ff_compiler_DependencyLock.new_$((await ff_core_NodeSystem.NodeSystem_mainTask$(system_, $task)), $task)), (await ff_core_NodeSystem.NodeSystem_path$(system_, (mainFile_ + ".ff"), $task)), $task));
|
|
432
434
|
(await ff_compiler_Main.prepareFireflyDirectory_$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task));
|
|
433
435
|
const localMainFile_ = (await ff_core_Path.Path_base$((await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), $task));
|
|
434
436
|
(await buildScript_$(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitNode(), resolvedDependencies_, $task));
|
|
@@ -440,7 +442,7 @@ return
|
|
|
440
442
|
}
|
|
441
443
|
if(command_a.BrowserCommand) {
|
|
442
444
|
const mainFile_ = command_a.mainPath_;
|
|
443
|
-
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));
|
|
445
|
+
const resolvedDependencies_ = (await ff_compiler_Dependencies.process_$((await ff_core_NodeSystem.NodeSystem_httpClient$(system_, $task)), (await ff_compiler_DependencyLock.new_$((await ff_core_NodeSystem.NodeSystem_mainTask$(system_, $task)), $task)), (await ff_core_NodeSystem.NodeSystem_path$(system_, (mainFile_ + ".ff"), $task)), $task));
|
|
444
446
|
(await ff_compiler_Main.prepareFireflyDirectory_$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task));
|
|
445
447
|
const localMainFile_ = (await ff_core_Path.Path_base$((await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), $task));
|
|
446
448
|
(await buildScript_$(mainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBrowser(), resolvedDependencies_, $task));
|
|
@@ -449,7 +451,7 @@ return
|
|
|
449
451
|
}
|
|
450
452
|
if(command_a.BuildCommand) {
|
|
451
453
|
const mainFile_ = command_a.mainPath_;
|
|
452
|
-
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));
|
|
454
|
+
const resolvedDependencies_ = (await ff_compiler_Dependencies.process_$((await ff_core_NodeSystem.NodeSystem_httpClient$(system_, $task)), (await ff_compiler_DependencyLock.new_$((await ff_core_NodeSystem.NodeSystem_mainTask$(system_, $task)), $task)), (await ff_core_NodeSystem.NodeSystem_path$(system_, (mainFile_ + ".ff"), $task)), $task));
|
|
453
455
|
(await ff_compiler_Main.prepareFireflyDirectory_$((await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task)), $task));
|
|
454
456
|
const localMainFile_ = (await ff_core_Path.Path_base$((await ff_core_NodeSystem.NodeSystem_path$(system_, mainFile_, $task)), $task));
|
|
455
457
|
(await buildScript_$(localMainFile_, resolvedDependencies_.mainPackagePair_, ff_compiler_JsEmitter.EmitBuild(), resolvedDependencies_, $task));
|
|
@@ -460,7 +462,7 @@ return
|
|
|
460
462
|
}
|
|
461
463
|
if(command_a.CheckCommand) {
|
|
462
464
|
const filePath_ = command_a.filePath_;
|
|
463
|
-
const errors_ = (await ff_compiler_Builder.check_$(system_, fireflyPath_, (await ff_core_NodeSystem.NodeSystem_path$(system_, filePath_, $task)), ff_core_Option.None(), ff_core_Set.
|
|
465
|
+
const errors_ = (await ff_compiler_Builder.check_$(system_, fireflyPath_, (await ff_core_NodeSystem.NodeSystem_path$(system_, filePath_, $task)), ff_core_Option.None(), ff_core_Set.new_(), ff_core_Map.new_(), ff_compiler_ModuleCache.new_(1), (await ff_compiler_DependencyLock.new_$((await ff_core_NodeSystem.NodeSystem_mainTask$(system_, $task)), $task)), 0, ff_compiler_LspHook.disabled_(), true, false, $task));
|
|
464
466
|
if((!ff_core_List.List_isEmpty(errors_))) {
|
|
465
467
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileErrors(ff_core_List.List_distinct(errors_, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_CompileError)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors)})
|
|
466
468
|
}
|
|
@@ -469,7 +471,7 @@ return
|
|
|
469
471
|
if(command_a.BootstrapCommand) {
|
|
470
472
|
const workingDirectory_ = (await ff_core_NodeSystem.NodeSystem_path$(system_, ".", $task));
|
|
471
473
|
const fakeLocation_ = ff_compiler_Syntax.Location("<core>", 0, 0);
|
|
472
|
-
(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_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.PackageInfo(ff_compiler_Syntax.DPackage(fakeLocation_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.Version(fakeLocation_, 0, 0, 0), ff_compiler_Syntax.TargetNames(true, false)), [], [ff_compiler_Syntax.DInclude(fakeLocation_, "node_modules")]))], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap([ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "compiler"), (await ff_core_Path.Path_slash$(workingDirectory_, "compiler", $task))), ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), (await ff_core_Path.Path_slash$(workingDirectory_, "core", $task)))], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet([], 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, ff_compiler_ModuleCache.
|
|
474
|
+
(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_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.PackageInfo(ff_compiler_Syntax.DPackage(fakeLocation_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_compiler_Syntax.Version(fakeLocation_, 0, 0, 0), ff_compiler_Syntax.TargetNames(true, false)), [], [ff_compiler_Syntax.DInclude(fakeLocation_, "node_modules")]))], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap([ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "compiler"), (await ff_core_Path.Path_slash$(workingDirectory_, "compiler", $task))), ff_core_Pair.Pair(ff_compiler_Syntax.PackagePair("ff", "core"), (await ff_core_Path.Path_slash$(workingDirectory_, "core", $task)))], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet([], 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, ff_compiler_ModuleCache.new_(0), $task))
|
|
473
475
|
return
|
|
474
476
|
}
|
|
475
477
|
}
|
|
@@ -99,8 +99,8 @@ return {version_, parsedModules_, resolvedModules_, derivedModules_, inferredMod
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
export function
|
|
103
|
-
return ff_compiler_ModuleCache.ModuleCache(version_, ff_core_Map.
|
|
102
|
+
export function new_(version_) {
|
|
103
|
+
return ff_compiler_ModuleCache.ModuleCache(version_, ff_core_Map.new_(), ff_core_Map.new_(), ff_core_Map.new_(), ff_core_Map.new_(), ff_core_Map.new_())
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
export function mergeVersionedMap_(oldMap_, newMap_, getVersion_) {
|
|
@@ -123,8 +123,8 @@ const file_ = (moduleName_ + ".ff");
|
|
|
123
123
|
return ff_core_Path.Path_slash(packagePath_, file_)
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
export async function
|
|
127
|
-
return ff_compiler_ModuleCache.ModuleCache(version_, ff_core_Map.
|
|
126
|
+
export async function new_$(version_, $task) {
|
|
127
|
+
return ff_compiler_ModuleCache.ModuleCache(version_, ff_core_Map.new_(), ff_core_Map.new_(), ff_core_Map.new_(), ff_core_Map.new_(), ff_core_Map.new_())
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
export async function mergeVersionedMap_$(oldMap_, newMap_, getVersion_, $task) {
|