firefly-compiler 0.4.30 → 0.4.32
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 -8
- 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 +38 -8
- 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 -3
- package/compiler/Unification.ff +3 -4
- 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 +85 -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/experimental/random/Units.ff +36 -0
- package/lsp/CompletionHandler.ff +3 -6
- package/lsp/Handler.ff +45 -25
- package/lsp/LanguageServer.ff +13 -3
- package/lsp/SymbolHandler.ff +2 -2
- package/lsp/TestReferences.ff +3 -3
- package/lux/Lux.ff +6 -7
- 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 +256 -14
- 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 +16 -14
- package/output/js/ff/compiler/ModuleCache.mjs +6 -6
- package/output/js/ff/compiler/Parser.mjs +72 -72
- package/output/js/ff/compiler/Patterns.mjs +2 -2
- 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 +119 -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/output/js/ff/core/Task.mjs +4 -4
- 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
|
@@ -115,7 +115,7 @@ return {js_, jsSync_, jsAsync_, browser_, browserSync_, browserAsync_, node_, no
|
|
|
115
115
|
|
|
116
116
|
export const binaryOperators_ = [["||"], ["&&"], ["!=", "=="], ["<=", ">=", "<", ">"], ["+", "-"], ["*", "/", "%"], ["^"]];
|
|
117
117
|
|
|
118
|
-
export function
|
|
118
|
+
export function new_(packagePair_, file_, tokens_, targetIsNode_, lspHook_) {
|
|
119
119
|
return ff_compiler_Parser.Parser(packagePair_, file_, tokens_, ff_core_List.List_grabLast(tokens_), targetIsNode_, lspHook_, false, 0, 1)
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -171,7 +171,7 @@ return foreignTarget_
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
export async function
|
|
174
|
+
export async function new_$(packagePair_, file_, tokens_, targetIsNode_, lspHook_, $task) {
|
|
175
175
|
return ff_compiler_Parser.Parser(packagePair_, file_, tokens_, ff_core_List.List_grabLast(tokens_), targetIsNode_, lspHook_, false, 0, 1)
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -348,14 +348,14 @@ return p_
|
|
|
348
348
|
if((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "package"))) {
|
|
349
349
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Duplicate package definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
350
350
|
};
|
|
351
|
-
const dependencies_ = ff_core_Array.
|
|
351
|
+
const dependencies_ = ff_core_Array.new_();
|
|
352
352
|
while((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "dependency"))) {
|
|
353
353
|
ff_core_Array.Array_push(dependencies_, ff_compiler_Parser.Parser_parseDependencyDefinition(self_, package_.targets_));
|
|
354
354
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
355
355
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
356
356
|
}
|
|
357
357
|
};
|
|
358
|
-
const includes_ = ff_core_Array.
|
|
358
|
+
const includes_ = ff_core_Array.new_();
|
|
359
359
|
while((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "include"))) {
|
|
360
360
|
ff_core_Array.Array_push(includes_, ff_compiler_Parser.Parser_parseIncludeDefinition(self_));
|
|
361
361
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
@@ -366,13 +366,13 @@ return ff_compiler_Syntax.PackageInfo(package_, ff_core_Array.Array_toList(depen
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
export function Parser_parseModule(self_) {
|
|
369
|
-
const imports_ = ff_core_Array.
|
|
370
|
-
const types_ = ff_core_Array.
|
|
371
|
-
const traits_ = ff_core_Array.
|
|
372
|
-
const instances_ = ff_core_Array.
|
|
373
|
-
const extends_ = ff_core_Array.
|
|
374
|
-
const lets_ = ff_core_Array.
|
|
375
|
-
const functions_ = ff_core_Array.
|
|
369
|
+
const imports_ = ff_core_Array.new_();
|
|
370
|
+
const types_ = ff_core_Array.new_();
|
|
371
|
+
const traits_ = ff_core_Array.new_();
|
|
372
|
+
const instances_ = ff_core_Array.new_();
|
|
373
|
+
const extends_ = ff_core_Array.new_();
|
|
374
|
+
const lets_ = ff_core_Array.new_();
|
|
375
|
+
const functions_ = ff_core_Array.new_();
|
|
376
376
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
377
377
|
if((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower()) && (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LAssign()) || ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LColon())))) {
|
|
378
378
|
ff_core_Array.Array_push(lets_, ff_compiler_Parser.Parser_parseLetDefinition(self_))
|
|
@@ -590,7 +590,7 @@ const poly_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(s
|
|
|
590
590
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
591
591
|
const type_ = ff_compiler_Parser.Parser_parseType(self_);
|
|
592
592
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
593
|
-
const methods_ = ff_core_Array.
|
|
593
|
+
const methods_ = ff_core_Array.new_();
|
|
594
594
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
595
595
|
ff_core_Array.Array_push(methods_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, true));
|
|
596
596
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -627,7 +627,7 @@ const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUppe
|
|
|
627
627
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
628
628
|
? ff_compiler_Parser.Poly([], [])
|
|
629
629
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
630
|
-
const constraints_ = ff_core_Array.
|
|
630
|
+
const constraints_ = ff_core_Array.new_();
|
|
631
631
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())) {
|
|
632
632
|
ff_compiler_Parser.Parser_fail(self_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Trait constraints is not yet implemented");
|
|
633
633
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
@@ -639,12 +639,12 @@ return ff_compiler_Syntax.Constraint(_c.at_, _c.name_, [ff_compiler_Syntax.TCons
|
|
|
639
639
|
const generatorParameters_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "("))
|
|
640
640
|
? []
|
|
641
641
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, false));
|
|
642
|
-
const methodGenerators_ = ff_core_Array.
|
|
643
|
-
const methodDefaults_ = ff_core_Array.
|
|
642
|
+
const methodGenerators_ = ff_core_Array.new_();
|
|
643
|
+
const methodDefaults_ = ff_core_Array.new_();
|
|
644
644
|
const methodSignatures_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{"))
|
|
645
645
|
? []
|
|
646
646
|
: (function() {
|
|
647
|
-
const signatures_ = ff_core_Array.
|
|
647
|
+
const signatures_ = ff_core_Array.new_();
|
|
648
648
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
649
649
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
650
650
|
if(self_.lspHook_.trackSymbols_) {
|
|
@@ -687,7 +687,7 @@ const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper())
|
|
|
687
687
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
688
688
|
? ff_compiler_Parser.Poly([], [])
|
|
689
689
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
690
|
-
const typeArguments_ = ff_core_Array.
|
|
690
|
+
const typeArguments_ = ff_core_Array.new_();
|
|
691
691
|
ff_core_Array.Array_push(typeArguments_, ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_), ff_core_List.List_map(poly_.generics_, ((_w1) => {
|
|
692
692
|
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), _w1, [])
|
|
693
693
|
}))));
|
|
@@ -707,7 +707,7 @@ const generatorArguments_ = ff_compiler_Parser.Parser_parseFunctionArguments(sel
|
|
|
707
707
|
const methods_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{"))
|
|
708
708
|
? []
|
|
709
709
|
: (function() {
|
|
710
|
-
const definitions_ = ff_core_Array.
|
|
710
|
+
const definitions_ = ff_core_Array.new_();
|
|
711
711
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
712
712
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
713
713
|
ff_core_Array.Array_push(definitions_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, false));
|
|
@@ -755,7 +755,7 @@ const variants_ = ((newtype_ || (!ff_compiler_Token.Token_rawIs(ff_compiler_Pars
|
|
|
755
755
|
? [ff_compiler_Syntax.Variant(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), [])]
|
|
756
756
|
: (function() {
|
|
757
757
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
758
|
-
const variantsBuilder_ = ff_core_Array.
|
|
758
|
+
const variantsBuilder_ = ff_core_Array.new_();
|
|
759
759
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
760
760
|
if(self_.lspHook_.trackSymbols_) {
|
|
761
761
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolBegin())
|
|
@@ -803,7 +803,7 @@ return result_
|
|
|
803
803
|
|
|
804
804
|
export function Parser_parseImportDefinition(self_, currentPackagePair_) {
|
|
805
805
|
const importToken_ = ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "import");
|
|
806
|
-
const path_ = ff_core_Array.
|
|
806
|
+
const path_ = ff_core_Array.new_();
|
|
807
807
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower())) {
|
|
808
808
|
ff_core_Array.Array_push(path_, ff_compiler_Parser.Parser_parseDashedName(self_));
|
|
809
809
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot())
|
|
@@ -952,8 +952,8 @@ return part_
|
|
|
952
952
|
|
|
953
953
|
export function Parser_parseTypeParameters(self_) {
|
|
954
954
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "[");
|
|
955
|
-
const parameters_ = ff_core_Array.
|
|
956
|
-
const constraints_ = ff_core_Array.
|
|
955
|
+
const parameters_ = ff_core_Array.new_();
|
|
956
|
+
const constraints_ = ff_core_Array.new_();
|
|
957
957
|
while(((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight())) && (!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LSemicolon())))) {
|
|
958
958
|
if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LBracketLeft())) {
|
|
959
959
|
ff_core_Array.Array_push(constraints_, ff_compiler_Parser.Parser_parseConstraint(self_))
|
|
@@ -980,7 +980,7 @@ export function Parser_parseTypeArguments(self_, parenthesis_ = false) {
|
|
|
980
980
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), (parenthesis_
|
|
981
981
|
? "("
|
|
982
982
|
: "["));
|
|
983
|
-
const types_ = ff_core_Array.
|
|
983
|
+
const types_ = ff_core_Array.new_();
|
|
984
984
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
985
985
|
ff_core_Array.Array_push(types_, ff_compiler_Parser.Parser_parseType(self_));
|
|
986
986
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -994,7 +994,7 @@ return ff_core_Array.Array_toList(types_, 0, 9007199254740991)
|
|
|
994
994
|
}
|
|
995
995
|
|
|
996
996
|
export function Parser_parseFunctionParameters(self_, allowMutable_ = false) {
|
|
997
|
-
const parameters_ = ff_core_Array.
|
|
997
|
+
const parameters_ = ff_core_Array.new_();
|
|
998
998
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
999
999
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1000
1000
|
const lspTrackSymbols_ = (self_.lspHook_.trackSymbols_ && allowMutable_);
|
|
@@ -1036,7 +1036,7 @@ return ff_core_Array.Array_toList(parameters_, 0, 9007199254740991)
|
|
|
1036
1036
|
}
|
|
1037
1037
|
|
|
1038
1038
|
export function Parser_parseFunctionArguments(self_, callAt_, trailing_) {
|
|
1039
|
-
const arguments_ = ff_core_Array.
|
|
1039
|
+
const arguments_ = ff_core_Array.new_();
|
|
1040
1040
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
1041
1041
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
1042
1042
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -1113,7 +1113,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword())
|
|
|
1113
1113
|
};
|
|
1114
1114
|
const result_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe())
|
|
1115
1115
|
? (function() {
|
|
1116
|
-
const cases_ = ff_core_Array.
|
|
1116
|
+
const cases_ = ff_core_Array.new_();
|
|
1117
1117
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe())) {
|
|
1118
1118
|
ff_core_Array.Array_push(cases_, ff_compiler_Parser.Parser_parseCase(self_))
|
|
1119
1119
|
};
|
|
@@ -1121,7 +1121,7 @@ return ff_core_Array.Array_toList(cases_, 0, 9007199254740991)
|
|
|
1121
1121
|
})()
|
|
1122
1122
|
: (ff_compiler_Token.Token_is2(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower(), ff_compiler_Token.LWildcard()) && ff_compiler_Token.Token_is2(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LComma(), ff_compiler_Token.LArrowThick()))
|
|
1123
1123
|
? (function() {
|
|
1124
|
-
const parameters_ = ff_core_Array.
|
|
1124
|
+
const parameters_ = ff_core_Array.new_();
|
|
1125
1125
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick()))) {
|
|
1126
1126
|
const isVariable_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower());
|
|
1127
1127
|
const parameterToken_ = (isVariable_
|
|
@@ -1140,7 +1140,7 @@ return [ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_), ff_core
|
|
|
1140
1140
|
})()
|
|
1141
1141
|
: (function() {
|
|
1142
1142
|
const term_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
1143
|
-
const wildcards_ = ff_compiler_Wildcards.
|
|
1143
|
+
const wildcards_ = ff_compiler_Wildcards.new_();
|
|
1144
1144
|
const e_ = ff_compiler_Wildcards.Wildcards_fixWildcards(wildcards_, term_);
|
|
1145
1145
|
const arguments_ = ((wildcards_.seenWildcards_ !== 0)
|
|
1146
1146
|
? ff_core_List.List_map(ff_core_List.range_(wildcards_.seenWildcards_), ((i_) => {
|
|
@@ -1160,14 +1160,14 @@ return ff_compiler_Syntax.Lambda(ff_compiler_Token.Token_at(token_), temporaryEf
|
|
|
1160
1160
|
|
|
1161
1161
|
export function Parser_parseCase(self_) {
|
|
1162
1162
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LPipe());
|
|
1163
|
-
const patterns_ = ff_core_Array.
|
|
1163
|
+
const patterns_ = ff_core_Array.new_();
|
|
1164
1164
|
while(((!ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick(), ff_compiler_Token.LPipe(), ff_compiler_Token.LBracketRight())) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))) {
|
|
1165
1165
|
ff_core_Array.Array_push(patterns_, ff_compiler_Parser.Parser_parsePattern(self_));
|
|
1166
1166
|
if(((!ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick(), ff_compiler_Token.LPipe(), ff_compiler_Token.LBracketRight())) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))) {
|
|
1167
1167
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
|
-
const guards_ = ff_core_Array.
|
|
1170
|
+
const guards_ = ff_core_Array.new_();
|
|
1171
1171
|
while(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")) {
|
|
1172
1172
|
ff_core_Array.Array_push(guards_, ff_compiler_Parser.Parser_parseCaseGuard(self_))
|
|
1173
1173
|
};
|
|
@@ -1228,7 +1228,7 @@ return ff_compiler_Syntax.PChar(ff_compiler_Token.Token_at(token_), ff_compiler_
|
|
|
1228
1228
|
: (function() {
|
|
1229
1229
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
1230
1230
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
1231
|
-
const patterns_ = ff_core_Array.
|
|
1231
|
+
const patterns_ = ff_core_Array.new_();
|
|
1232
1232
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
1233
1233
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1234
1234
|
const pattern_ = ff_compiler_Parser.Parser_parsePattern(self_);
|
|
@@ -1409,7 +1409,7 @@ return ff_compiler_Syntax.ELet(ff_compiler_Token.Token_at(nameToken_), mutable_,
|
|
|
1409
1409
|
|
|
1410
1410
|
export function Parser_parseFunctions(self_) {
|
|
1411
1411
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
1412
|
-
const functions_ = ff_core_Array.
|
|
1412
|
+
const functions_ = ff_core_Array.new_();
|
|
1413
1413
|
while(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "function")) {
|
|
1414
1414
|
if(self_.lspHook_.trackSymbols_) {
|
|
1415
1415
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolBegin())
|
|
@@ -1630,7 +1630,7 @@ return ff_compiler_Syntax.ECopy(ff_compiler_Token.Token_at(token_), name_, recor
|
|
|
1630
1630
|
}
|
|
1631
1631
|
|
|
1632
1632
|
export function Parser_parseRecord(self_, copyAt_) {
|
|
1633
|
-
const fields_ = ff_core_Array.
|
|
1633
|
+
const fields_ = ff_core_Array.new_();
|
|
1634
1634
|
const startBracketAt_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "("));
|
|
1635
1635
|
const startAt_ = ff_core_Option.Option_else(copyAt_, (() => {
|
|
1636
1636
|
return startBracketAt_
|
|
@@ -1667,7 +1667,7 @@ return ff_core_Array.Array_toList(fields_, 0, 9007199254740991)
|
|
|
1667
1667
|
}
|
|
1668
1668
|
|
|
1669
1669
|
export function Parser_parseRecordType(self_) {
|
|
1670
|
-
const fields_ = ff_core_Array.
|
|
1670
|
+
const fields_ = ff_core_Array.new_();
|
|
1671
1671
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
1672
1672
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1673
1673
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
@@ -1684,7 +1684,7 @@ return _w1.first_
|
|
|
1684
1684
|
}
|
|
1685
1685
|
|
|
1686
1686
|
export function Parser_parseRecordPattern(self_) {
|
|
1687
|
-
const fields_ = ff_core_Array.
|
|
1687
|
+
const fields_ = ff_core_Array.new_();
|
|
1688
1688
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
1689
1689
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1690
1690
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
@@ -1721,7 +1721,7 @@ const p_ = items_a[0].first_;
|
|
|
1721
1721
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(p_.at_, "Invalid pattern: ... is only allowed for the last element in a list"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
1722
1722
|
}
|
|
1723
1723
|
}
|
|
1724
|
-
const items_ = ff_core_Array.
|
|
1724
|
+
const items_ = ff_core_Array.new_();
|
|
1725
1725
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "["));
|
|
1726
1726
|
while((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
1727
1727
|
const spread_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDotDotDot());
|
|
@@ -1741,7 +1741,7 @@ return convertListPattern_(at_, ff_core_Array.Array_toList(items_, 0, 9007199254
|
|
|
1741
1741
|
}
|
|
1742
1742
|
|
|
1743
1743
|
export function Parser_parseList(self_) {
|
|
1744
|
-
const items_ = ff_core_Array.
|
|
1744
|
+
const items_ = ff_core_Array.new_();
|
|
1745
1745
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "["));
|
|
1746
1746
|
while((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
1747
1747
|
const spread_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDotDotDot());
|
|
@@ -1878,14 +1878,14 @@ return p_
|
|
|
1878
1878
|
if((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "package"))) {
|
|
1879
1879
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Duplicate package definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
1880
1880
|
};
|
|
1881
|
-
const dependencies_ = ff_core_Array.
|
|
1881
|
+
const dependencies_ = ff_core_Array.new_();
|
|
1882
1882
|
while((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "dependency"))) {
|
|
1883
1883
|
ff_core_Array.Array_push(dependencies_, ff_compiler_Parser.Parser_parseDependencyDefinition(self_, package_.targets_));
|
|
1884
1884
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
1885
1885
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
1886
1886
|
}
|
|
1887
1887
|
};
|
|
1888
|
-
const includes_ = ff_core_Array.
|
|
1888
|
+
const includes_ = ff_core_Array.new_();
|
|
1889
1889
|
while((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "include"))) {
|
|
1890
1890
|
ff_core_Array.Array_push(includes_, ff_compiler_Parser.Parser_parseIncludeDefinition(self_));
|
|
1891
1891
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
@@ -1896,13 +1896,13 @@ return ff_compiler_Syntax.PackageInfo(package_, ff_core_Array.Array_toList(depen
|
|
|
1896
1896
|
}
|
|
1897
1897
|
|
|
1898
1898
|
export async function Parser_parseModule$(self_, $task) {
|
|
1899
|
-
const imports_ = ff_core_Array.
|
|
1900
|
-
const types_ = ff_core_Array.
|
|
1901
|
-
const traits_ = ff_core_Array.
|
|
1902
|
-
const instances_ = ff_core_Array.
|
|
1903
|
-
const extends_ = ff_core_Array.
|
|
1904
|
-
const lets_ = ff_core_Array.
|
|
1905
|
-
const functions_ = ff_core_Array.
|
|
1899
|
+
const imports_ = ff_core_Array.new_();
|
|
1900
|
+
const types_ = ff_core_Array.new_();
|
|
1901
|
+
const traits_ = ff_core_Array.new_();
|
|
1902
|
+
const instances_ = ff_core_Array.new_();
|
|
1903
|
+
const extends_ = ff_core_Array.new_();
|
|
1904
|
+
const lets_ = ff_core_Array.new_();
|
|
1905
|
+
const functions_ = ff_core_Array.new_();
|
|
1906
1906
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
1907
1907
|
if((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower()) && (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LAssign()) || ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LColon())))) {
|
|
1908
1908
|
ff_core_Array.Array_push(lets_, ff_compiler_Parser.Parser_parseLetDefinition(self_))
|
|
@@ -2120,7 +2120,7 @@ const poly_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(s
|
|
|
2120
2120
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
2121
2121
|
const type_ = ff_compiler_Parser.Parser_parseType(self_);
|
|
2122
2122
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
2123
|
-
const methods_ = ff_core_Array.
|
|
2123
|
+
const methods_ = ff_core_Array.new_();
|
|
2124
2124
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2125
2125
|
ff_core_Array.Array_push(methods_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, true));
|
|
2126
2126
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -2157,7 +2157,7 @@ const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUppe
|
|
|
2157
2157
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
2158
2158
|
? ff_compiler_Parser.Poly([], [])
|
|
2159
2159
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
2160
|
-
const constraints_ = ff_core_Array.
|
|
2160
|
+
const constraints_ = ff_core_Array.new_();
|
|
2161
2161
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())) {
|
|
2162
2162
|
ff_compiler_Parser.Parser_fail(self_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Trait constraints is not yet implemented");
|
|
2163
2163
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
@@ -2169,12 +2169,12 @@ return ff_compiler_Syntax.Constraint(_c.at_, _c.name_, [ff_compiler_Syntax.TCons
|
|
|
2169
2169
|
const generatorParameters_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "("))
|
|
2170
2170
|
? []
|
|
2171
2171
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, false));
|
|
2172
|
-
const methodGenerators_ = ff_core_Array.
|
|
2173
|
-
const methodDefaults_ = ff_core_Array.
|
|
2172
|
+
const methodGenerators_ = ff_core_Array.new_();
|
|
2173
|
+
const methodDefaults_ = ff_core_Array.new_();
|
|
2174
2174
|
const methodSignatures_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{"))
|
|
2175
2175
|
? []
|
|
2176
2176
|
: (await (async function() {
|
|
2177
|
-
const signatures_ = ff_core_Array.
|
|
2177
|
+
const signatures_ = ff_core_Array.new_();
|
|
2178
2178
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
2179
2179
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2180
2180
|
if(self_.lspHook_.trackSymbols_) {
|
|
@@ -2217,7 +2217,7 @@ const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper())
|
|
|
2217
2217
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
2218
2218
|
? ff_compiler_Parser.Poly([], [])
|
|
2219
2219
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
2220
|
-
const typeArguments_ = ff_core_Array.
|
|
2220
|
+
const typeArguments_ = ff_core_Array.new_();
|
|
2221
2221
|
ff_core_Array.Array_push(typeArguments_, ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_), ff_core_List.List_map(poly_.generics_, ((_w1) => {
|
|
2222
2222
|
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), _w1, [])
|
|
2223
2223
|
}))));
|
|
@@ -2237,7 +2237,7 @@ const generatorArguments_ = ff_compiler_Parser.Parser_parseFunctionArguments(sel
|
|
|
2237
2237
|
const methods_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{"))
|
|
2238
2238
|
? []
|
|
2239
2239
|
: (await (async function() {
|
|
2240
|
-
const definitions_ = ff_core_Array.
|
|
2240
|
+
const definitions_ = ff_core_Array.new_();
|
|
2241
2241
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
2242
2242
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2243
2243
|
ff_core_Array.Array_push(definitions_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, false));
|
|
@@ -2285,7 +2285,7 @@ const variants_ = ((newtype_ || (!ff_compiler_Token.Token_rawIs(ff_compiler_Pars
|
|
|
2285
2285
|
? [ff_compiler_Syntax.Variant(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), [])]
|
|
2286
2286
|
: (await (async function() {
|
|
2287
2287
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
2288
|
-
const variantsBuilder_ = ff_core_Array.
|
|
2288
|
+
const variantsBuilder_ = ff_core_Array.new_();
|
|
2289
2289
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2290
2290
|
if(self_.lspHook_.trackSymbols_) {
|
|
2291
2291
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolBegin())
|
|
@@ -2333,7 +2333,7 @@ return result_
|
|
|
2333
2333
|
|
|
2334
2334
|
export async function Parser_parseImportDefinition$(self_, currentPackagePair_, $task) {
|
|
2335
2335
|
const importToken_ = ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "import");
|
|
2336
|
-
const path_ = ff_core_Array.
|
|
2336
|
+
const path_ = ff_core_Array.new_();
|
|
2337
2337
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower())) {
|
|
2338
2338
|
ff_core_Array.Array_push(path_, ff_compiler_Parser.Parser_parseDashedName(self_));
|
|
2339
2339
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot())
|
|
@@ -2482,8 +2482,8 @@ return part_
|
|
|
2482
2482
|
|
|
2483
2483
|
export async function Parser_parseTypeParameters$(self_, $task) {
|
|
2484
2484
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "[");
|
|
2485
|
-
const parameters_ = ff_core_Array.
|
|
2486
|
-
const constraints_ = ff_core_Array.
|
|
2485
|
+
const parameters_ = ff_core_Array.new_();
|
|
2486
|
+
const constraints_ = ff_core_Array.new_();
|
|
2487
2487
|
while(((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight())) && (!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LSemicolon())))) {
|
|
2488
2488
|
if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LBracketLeft())) {
|
|
2489
2489
|
ff_core_Array.Array_push(constraints_, ff_compiler_Parser.Parser_parseConstraint(self_))
|
|
@@ -2510,7 +2510,7 @@ export async function Parser_parseTypeArguments$(self_, parenthesis_ = false, $t
|
|
|
2510
2510
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), (parenthesis_
|
|
2511
2511
|
? "("
|
|
2512
2512
|
: "["));
|
|
2513
|
-
const types_ = ff_core_Array.
|
|
2513
|
+
const types_ = ff_core_Array.new_();
|
|
2514
2514
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2515
2515
|
ff_core_Array.Array_push(types_, ff_compiler_Parser.Parser_parseType(self_));
|
|
2516
2516
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -2524,7 +2524,7 @@ return ff_core_Array.Array_toList(types_, 0, 9007199254740991)
|
|
|
2524
2524
|
}
|
|
2525
2525
|
|
|
2526
2526
|
export async function Parser_parseFunctionParameters$(self_, allowMutable_ = false, $task) {
|
|
2527
|
-
const parameters_ = ff_core_Array.
|
|
2527
|
+
const parameters_ = ff_core_Array.new_();
|
|
2528
2528
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
2529
2529
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2530
2530
|
const lspTrackSymbols_ = (self_.lspHook_.trackSymbols_ && allowMutable_);
|
|
@@ -2566,7 +2566,7 @@ return ff_core_Array.Array_toList(parameters_, 0, 9007199254740991)
|
|
|
2566
2566
|
}
|
|
2567
2567
|
|
|
2568
2568
|
export async function Parser_parseFunctionArguments$(self_, callAt_, trailing_, $task) {
|
|
2569
|
-
const arguments_ = ff_core_Array.
|
|
2569
|
+
const arguments_ = ff_core_Array.new_();
|
|
2570
2570
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
2571
2571
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
2572
2572
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -2643,7 +2643,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword())
|
|
|
2643
2643
|
};
|
|
2644
2644
|
const result_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe())
|
|
2645
2645
|
? (await (async function() {
|
|
2646
|
-
const cases_ = ff_core_Array.
|
|
2646
|
+
const cases_ = ff_core_Array.new_();
|
|
2647
2647
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe())) {
|
|
2648
2648
|
ff_core_Array.Array_push(cases_, ff_compiler_Parser.Parser_parseCase(self_))
|
|
2649
2649
|
};
|
|
@@ -2651,7 +2651,7 @@ return ff_core_Array.Array_toList(cases_, 0, 9007199254740991)
|
|
|
2651
2651
|
})())
|
|
2652
2652
|
: (ff_compiler_Token.Token_is2(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower(), ff_compiler_Token.LWildcard()) && ff_compiler_Token.Token_is2(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LComma(), ff_compiler_Token.LArrowThick()))
|
|
2653
2653
|
? (await (async function() {
|
|
2654
|
-
const parameters_ = ff_core_Array.
|
|
2654
|
+
const parameters_ = ff_core_Array.new_();
|
|
2655
2655
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick()))) {
|
|
2656
2656
|
const isVariable_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower());
|
|
2657
2657
|
const parameterToken_ = (isVariable_
|
|
@@ -2670,7 +2670,7 @@ return [ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_), ff_core
|
|
|
2670
2670
|
})())
|
|
2671
2671
|
: (await (async function() {
|
|
2672
2672
|
const term_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
2673
|
-
const wildcards_ = ff_compiler_Wildcards.
|
|
2673
|
+
const wildcards_ = ff_compiler_Wildcards.new_();
|
|
2674
2674
|
const e_ = ff_compiler_Wildcards.Wildcards_fixWildcards(wildcards_, term_);
|
|
2675
2675
|
const arguments_ = ((wildcards_.seenWildcards_ !== 0)
|
|
2676
2676
|
? ff_core_List.List_map(ff_core_List.range_(wildcards_.seenWildcards_), ((i_) => {
|
|
@@ -2690,14 +2690,14 @@ return ff_compiler_Syntax.Lambda(ff_compiler_Token.Token_at(token_), temporaryEf
|
|
|
2690
2690
|
|
|
2691
2691
|
export async function Parser_parseCase$(self_, $task) {
|
|
2692
2692
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LPipe());
|
|
2693
|
-
const patterns_ = ff_core_Array.
|
|
2693
|
+
const patterns_ = ff_core_Array.new_();
|
|
2694
2694
|
while(((!ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick(), ff_compiler_Token.LPipe(), ff_compiler_Token.LBracketRight())) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))) {
|
|
2695
2695
|
ff_core_Array.Array_push(patterns_, ff_compiler_Parser.Parser_parsePattern(self_));
|
|
2696
2696
|
if(((!ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick(), ff_compiler_Token.LPipe(), ff_compiler_Token.LBracketRight())) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))) {
|
|
2697
2697
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
2698
2698
|
}
|
|
2699
2699
|
};
|
|
2700
|
-
const guards_ = ff_core_Array.
|
|
2700
|
+
const guards_ = ff_core_Array.new_();
|
|
2701
2701
|
while(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")) {
|
|
2702
2702
|
ff_core_Array.Array_push(guards_, ff_compiler_Parser.Parser_parseCaseGuard(self_))
|
|
2703
2703
|
};
|
|
@@ -2758,7 +2758,7 @@ return ff_compiler_Syntax.PChar(ff_compiler_Token.Token_at(token_), ff_compiler_
|
|
|
2758
2758
|
: (await (async function() {
|
|
2759
2759
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
2760
2760
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
2761
|
-
const patterns_ = ff_core_Array.
|
|
2761
|
+
const patterns_ = ff_core_Array.new_();
|
|
2762
2762
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
2763
2763
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2764
2764
|
const pattern_ = ff_compiler_Parser.Parser_parsePattern(self_);
|
|
@@ -2939,7 +2939,7 @@ return ff_compiler_Syntax.ELet(ff_compiler_Token.Token_at(nameToken_), mutable_,
|
|
|
2939
2939
|
|
|
2940
2940
|
export async function Parser_parseFunctions$(self_, $task) {
|
|
2941
2941
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
2942
|
-
const functions_ = ff_core_Array.
|
|
2942
|
+
const functions_ = ff_core_Array.new_();
|
|
2943
2943
|
while(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "function")) {
|
|
2944
2944
|
if(self_.lspHook_.trackSymbols_) {
|
|
2945
2945
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolBegin())
|
|
@@ -3160,7 +3160,7 @@ return ff_compiler_Syntax.ECopy(ff_compiler_Token.Token_at(token_), name_, recor
|
|
|
3160
3160
|
}
|
|
3161
3161
|
|
|
3162
3162
|
export async function Parser_parseRecord$(self_, copyAt_, $task) {
|
|
3163
|
-
const fields_ = ff_core_Array.
|
|
3163
|
+
const fields_ = ff_core_Array.new_();
|
|
3164
3164
|
const startBracketAt_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "("));
|
|
3165
3165
|
const startAt_ = ff_core_Option.Option_else(copyAt_, (() => {
|
|
3166
3166
|
return startBracketAt_
|
|
@@ -3197,7 +3197,7 @@ return ff_core_Array.Array_toList(fields_, 0, 9007199254740991)
|
|
|
3197
3197
|
}
|
|
3198
3198
|
|
|
3199
3199
|
export async function Parser_parseRecordType$(self_, $task) {
|
|
3200
|
-
const fields_ = ff_core_Array.
|
|
3200
|
+
const fields_ = ff_core_Array.new_();
|
|
3201
3201
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
3202
3202
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
3203
3203
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
@@ -3214,7 +3214,7 @@ return _w1.first_
|
|
|
3214
3214
|
}
|
|
3215
3215
|
|
|
3216
3216
|
export async function Parser_parseRecordPattern$(self_, $task) {
|
|
3217
|
-
const fields_ = ff_core_Array.
|
|
3217
|
+
const fields_ = ff_core_Array.new_();
|
|
3218
3218
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
3219
3219
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
3220
3220
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
@@ -3251,7 +3251,7 @@ const p_ = items_a[0].first_;
|
|
|
3251
3251
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(p_.at_, "Invalid pattern: ... is only allowed for the last element in a list"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
3252
3252
|
}
|
|
3253
3253
|
}
|
|
3254
|
-
const items_ = ff_core_Array.
|
|
3254
|
+
const items_ = ff_core_Array.new_();
|
|
3255
3255
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "["));
|
|
3256
3256
|
while((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
3257
3257
|
const spread_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDotDotDot());
|
|
@@ -3271,7 +3271,7 @@ return convertListPattern_(at_, ff_core_Array.Array_toList(items_, 0, 9007199254
|
|
|
3271
3271
|
}
|
|
3272
3272
|
|
|
3273
3273
|
export async function Parser_parseList$(self_, $task) {
|
|
3274
|
-
const items_ = ff_core_Array.
|
|
3274
|
+
const items_ = ff_core_Array.new_();
|
|
3275
3275
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "["));
|
|
3276
3276
|
while((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
3277
3277
|
const spread_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDotDotDot());
|
|
@@ -264,7 +264,7 @@ return ff_compiler_Patterns.PatternCaseInfo(fields_, (!exhaustiveGuards_))
|
|
|
264
264
|
export function convertAndCheck_(modules_, cases_) {
|
|
265
265
|
const converted_ = ff_compiler_Patterns.convert_(modules_, cases_);
|
|
266
266
|
ff_core_Try.Try_else(ff_core_Core.try_((() => {
|
|
267
|
-
|
|
267
|
+
ff_compiler_Patterns.check_(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], converted_, false, false)
|
|
268
268
|
})), (() => {
|
|
269
269
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_core_List.List_grab(cases_, 0).at_, "Unexhaustive match"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
270
270
|
}))
|
|
@@ -434,7 +434,7 @@ return ff_compiler_Patterns.PatternCaseInfo(fields_, (!exhaustiveGuards_))
|
|
|
434
434
|
export async function convertAndCheck_$(modules_, cases_, $task) {
|
|
435
435
|
const converted_ = ff_compiler_Patterns.convert_(modules_, cases_);
|
|
436
436
|
ff_core_Try.Try_else(ff_core_Core.try_((() => {
|
|
437
|
-
|
|
437
|
+
ff_compiler_Patterns.check_(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], converted_, false, false)
|
|
438
438
|
})), (() => {
|
|
439
439
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_core_List.List_grab(cases_, 0).at_, "Unexhaustive match"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
440
440
|
}))
|
|
@@ -111,11 +111,11 @@ return {at_, name_, asBound_};
|
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
export function
|
|
114
|
+
export function new_(packagePair_, moduleName_, lspHook_) {
|
|
115
115
|
return ff_compiler_Resolver.Resolver(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Resolver.ResolverState(2), lspHook_)
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
export async function
|
|
118
|
+
export async function new_$(packagePair_, moduleName_, lspHook_, $task) {
|
|
119
119
|
return ff_compiler_Resolver.Resolver(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Resolver.ResolverState(2), lspHook_)
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -912,13 +912,13 @@ export function Resolver_resolveCase(self_, case_, topLevel_) {
|
|
|
912
912
|
function findVariables_(pattern_) {
|
|
913
913
|
const pattern_a = pattern_;
|
|
914
914
|
if(pattern_a.PString) {
|
|
915
|
-
return ff_core_Map.
|
|
915
|
+
return ff_core_Map.new_()
|
|
916
916
|
}
|
|
917
917
|
if(pattern_a.PInt) {
|
|
918
|
-
return ff_core_Map.
|
|
918
|
+
return ff_core_Map.new_()
|
|
919
919
|
}
|
|
920
920
|
if(pattern_a.PChar) {
|
|
921
|
-
return ff_core_Map.
|
|
921
|
+
return ff_core_Map.new_()
|
|
922
922
|
}
|
|
923
923
|
if(pattern_a.PVariable && pattern_a.name_.Some) {
|
|
924
924
|
const at_ = pattern_a.at_;
|
|
@@ -926,13 +926,13 @@ const name_ = pattern_a.name_.value_;
|
|
|
926
926
|
return ff_core_List.List_toMap([ff_core_Pair.Pair(name_, ff_compiler_Resolver.CaseVariable(at_, name_, ff_core_Option.None()))], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
927
927
|
}
|
|
928
928
|
if(pattern_a.PVariable && pattern_a.name_.None) {
|
|
929
|
-
return ff_core_Map.
|
|
929
|
+
return ff_core_Map.new_()
|
|
930
930
|
}
|
|
931
931
|
if(pattern_a.PVariant) {
|
|
932
932
|
const patterns_ = pattern_a.patterns_;
|
|
933
933
|
return ff_core_List.List_foldLeft(ff_core_List.List_map(patterns_, ((pattern_) => {
|
|
934
934
|
return findVariables_(pattern_)
|
|
935
|
-
})), ff_core_Map.
|
|
935
|
+
})), ff_core_Map.new_(), ((_w1, _w2) => {
|
|
936
936
|
return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
937
937
|
}))
|
|
938
938
|
return
|
|
@@ -956,7 +956,7 @@ return ff_core_Map.Map_addAll(ff_core_List.List_toMap([ff_core_Pair.Pair(variabl
|
|
|
956
956
|
}
|
|
957
957
|
const variableMap_ = ff_core_List.List_foldLeft(ff_core_List.List_map(case_.patterns_, ((pattern_) => {
|
|
958
958
|
return findVariables_(pattern_)
|
|
959
|
-
})), ff_core_Map.
|
|
959
|
+
})), ff_core_Map.new_(), ((_w1, _w2) => {
|
|
960
960
|
return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
961
961
|
}));
|
|
962
962
|
let guards_ = [];
|
|
@@ -1850,13 +1850,13 @@ export async function Resolver_resolveCase$(self_, case_, topLevel_, $task) {
|
|
|
1850
1850
|
function findVariables_(pattern_) {
|
|
1851
1851
|
const pattern_a = pattern_;
|
|
1852
1852
|
if(pattern_a.PString) {
|
|
1853
|
-
return ff_core_Map.
|
|
1853
|
+
return ff_core_Map.new_()
|
|
1854
1854
|
}
|
|
1855
1855
|
if(pattern_a.PInt) {
|
|
1856
|
-
return ff_core_Map.
|
|
1856
|
+
return ff_core_Map.new_()
|
|
1857
1857
|
}
|
|
1858
1858
|
if(pattern_a.PChar) {
|
|
1859
|
-
return ff_core_Map.
|
|
1859
|
+
return ff_core_Map.new_()
|
|
1860
1860
|
}
|
|
1861
1861
|
if(pattern_a.PVariable && pattern_a.name_.Some) {
|
|
1862
1862
|
const at_ = pattern_a.at_;
|
|
@@ -1864,13 +1864,13 @@ const name_ = pattern_a.name_.value_;
|
|
|
1864
1864
|
return ff_core_List.List_toMap([ff_core_Pair.Pair(name_, ff_compiler_Resolver.CaseVariable(at_, name_, ff_core_Option.None()))], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
1865
1865
|
}
|
|
1866
1866
|
if(pattern_a.PVariable && pattern_a.name_.None) {
|
|
1867
|
-
return ff_core_Map.
|
|
1867
|
+
return ff_core_Map.new_()
|
|
1868
1868
|
}
|
|
1869
1869
|
if(pattern_a.PVariant) {
|
|
1870
1870
|
const patterns_ = pattern_a.patterns_;
|
|
1871
1871
|
return ff_core_List.List_foldLeft(ff_core_List.List_map(patterns_, ((pattern_) => {
|
|
1872
1872
|
return findVariables_(pattern_)
|
|
1873
|
-
})), ff_core_Map.
|
|
1873
|
+
})), ff_core_Map.new_(), ((_w1, _w2) => {
|
|
1874
1874
|
return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
1875
1875
|
}))
|
|
1876
1876
|
return
|
|
@@ -1894,7 +1894,7 @@ return ff_core_Map.Map_addAll(ff_core_List.List_toMap([ff_core_Pair.Pair(variabl
|
|
|
1894
1894
|
}
|
|
1895
1895
|
const variableMap_ = ff_core_List.List_foldLeft(ff_core_List.List_map(case_.patterns_, ((pattern_) => {
|
|
1896
1896
|
return findVariables_(pattern_)
|
|
1897
|
-
})), ff_core_Map.
|
|
1897
|
+
})), ff_core_Map.new_(), ((_w1, _w2) => {
|
|
1898
1898
|
return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
1899
1899
|
}));
|
|
1900
1900
|
let guards_ = [];
|