firefly-compiler 0.4.18 → 0.4.19
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/compiler/Builder.ff +1 -1
- package/compiler/Compiler.ff +6 -5
- package/compiler/Inference.ff +31 -19
- package/compiler/JsEmitter.ff +98 -71
- package/compiler/JsImporter.ff +1 -1
- package/compiler/LspHook.ff +4 -4
- package/compiler/Main.ff +6 -6
- package/compiler/Parser.ff +39 -39
- package/compiler/Patterns.ff +2 -0
- package/compiler/Syntax.ff +1 -1
- package/compiler/Tokenizer.ff +2 -2
- package/compiler/Workspace.ff +2 -2
- package/core/Array.ff +135 -294
- package/core/Buffer.ff +3 -3
- package/core/BuildSystem.ff +1 -1
- package/core/Equal.ff +36 -52
- package/core/HttpClient.ff +1 -1
- package/core/IntMap.ff +14 -18
- package/core/JsSystem.ff +1 -1
- package/core/JsValue.ff +6 -12
- package/core/Json.ff +19 -28
- package/core/List.ff +281 -312
- package/core/Map.ff +4 -8
- package/core/NodeSystem.ff +2 -2
- package/core/Option.ff +0 -4
- package/core/Ordering.ff +10 -6
- package/core/Pair.ff +0 -4
- package/core/Random.ff +12 -26
- package/core/RbMap.ff +216 -216
- package/core/Serializable.ff +9 -18
- package/core/Set.ff +0 -1
- package/core/SourceLocation.ff +1 -1
- package/core/Stack.ff +32 -45
- package/core/Stream.ff +10 -14
- package/core/String.ff +24 -6
- package/core/StringMap.ff +15 -19
- package/guide/Main.ff +20 -2
- package/lsp/CompletionHandler.ff +4 -4
- package/lsp/Handler.ff +44 -33
- package/lsp/HoverHandler.ff +2 -2
- package/lsp/LanguageServer.ff +2 -2
- package/lsp/SignatureHelpHandler.ff +1 -1
- package/lsp/SymbolHandler.ff +1 -1
- package/lux/Lux.ff +3 -3
- package/output/js/ff/compiler/Builder.mjs +19 -21
- package/output/js/ff/compiler/Compiler.mjs +18 -20
- package/output/js/ff/compiler/Dependencies.mjs +8 -10
- package/output/js/ff/compiler/Deriver.mjs +234 -236
- package/output/js/ff/compiler/Dictionaries.mjs +6 -8
- package/output/js/ff/compiler/Environment.mjs +42 -44
- package/output/js/ff/compiler/Inference.mjs +346 -304
- package/output/js/ff/compiler/JsEmitter.mjs +907 -833
- package/output/js/ff/compiler/JsImporter.mjs +0 -2
- package/output/js/ff/compiler/LspHook.mjs +10 -12
- package/output/js/ff/compiler/Main.mjs +109 -111
- package/output/js/ff/compiler/Parser.mjs +405 -407
- package/output/js/ff/compiler/Patterns.mjs +64 -50
- package/output/js/ff/compiler/Resolver.mjs +36 -38
- package/output/js/ff/compiler/Substitution.mjs +4 -6
- package/output/js/ff/compiler/Syntax.mjs +160 -162
- package/output/js/ff/compiler/Token.mjs +52 -54
- package/output/js/ff/compiler/Tokenizer.mjs +16 -18
- package/output/js/ff/compiler/Unification.mjs +24 -26
- package/output/js/ff/compiler/Wildcards.mjs +0 -2
- package/output/js/ff/compiler/Workspace.mjs +18 -20
- package/output/js/ff/core/Any.mjs +0 -2
- package/output/js/ff/core/Array.mjs +216 -613
- package/output/js/ff/core/AssetSystem.mjs +2 -4
- package/output/js/ff/core/Atomic.mjs +0 -2
- package/output/js/ff/core/Bool.mjs +0 -2
- package/output/js/ff/core/Box.mjs +0 -2
- package/output/js/ff/core/BrowserSystem.mjs +0 -2
- package/output/js/ff/core/Buffer.mjs +0 -2
- package/output/js/ff/core/BuildSystem.mjs +12 -14
- package/output/js/ff/core/Channel.mjs +0 -2
- package/output/js/ff/core/Char.mjs +0 -2
- package/output/js/ff/core/Core.mjs +0 -2
- package/output/js/ff/core/Duration.mjs +0 -2
- package/output/js/ff/core/Equal.mjs +0 -22
- package/output/js/ff/core/Error.mjs +0 -2
- package/output/js/ff/core/FileHandle.mjs +0 -2
- package/output/js/ff/core/Float.mjs +0 -2
- package/output/js/ff/core/HttpClient.mjs +2 -4
- package/output/js/ff/core/Instant.mjs +0 -2
- package/output/js/ff/core/Int.mjs +8 -10
- package/output/js/ff/core/IntMap.mjs +32 -42
- package/output/js/ff/core/JsSystem.mjs +1 -3
- package/output/js/ff/core/JsValue.mjs +5 -12
- package/output/js/ff/core/Json.mjs +23 -56
- package/output/js/ff/core/List.mjs +648 -1989
- package/output/js/ff/core/Lock.mjs +0 -2
- package/output/js/ff/core/Log.mjs +0 -2
- package/output/js/ff/core/Map.mjs +10 -20
- package/output/js/ff/core/NodeSystem.mjs +6 -8
- package/output/js/ff/core/Nothing.mjs +0 -2
- package/output/js/ff/core/Option.mjs +8 -18
- package/output/js/ff/core/Ordering.mjs +20 -98
- package/output/js/ff/core/Pair.mjs +6 -16
- package/output/js/ff/core/Path.mjs +12 -14
- package/output/js/ff/core/Random.mjs +24 -54
- package/output/js/ff/core/RbMap.mjs +54 -56
- package/output/js/ff/core/Serializable.mjs +19 -36
- package/output/js/ff/core/Set.mjs +0 -14
- package/output/js/ff/core/Show.mjs +0 -2
- package/output/js/ff/core/SourceLocation.mjs +0 -2
- package/output/js/ff/core/Stream.mjs +34 -44
- package/output/js/ff/core/String.mjs +31 -5
- package/output/js/ff/core/StringMap.mjs +32 -42
- package/output/js/ff/core/Task.mjs +0 -2
- package/output/js/ff/core/Try.mjs +0 -2
- package/output/js/ff/core/Unit.mjs +0 -2
- package/package.json +1 -1
- package/vscode/package.json +1 -1
- package/webserver/WebServer.ff +8 -8
- package/output/js/ff/core/Stack.mjs +0 -603
|
@@ -88,8 +88,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
88
88
|
|
|
89
89
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
90
90
|
|
|
91
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
92
|
-
|
|
93
91
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
94
92
|
|
|
95
93
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -117,10 +115,10 @@ export function ParsedTargets(js_, jsSync_, jsAsync_, browser_, browserSync_, br
|
|
|
117
115
|
return {js_, jsSync_, jsAsync_, browser_, browserSync_, browserAsync_, node_, nodeSync_, nodeAsync_};
|
|
118
116
|
}
|
|
119
117
|
|
|
120
|
-
export const binaryOperators_ =
|
|
118
|
+
export const binaryOperators_ = [["||"], ["&&"], ["!=", "=="], ["<=", ">=", "<", ">"], ["+", "-"], ["*", "/", "%"], ["^"]];
|
|
121
119
|
|
|
122
120
|
export function make_(packagePair_, file_, tokens_, targetIsNode_, lspHook_) {
|
|
123
|
-
return ff_compiler_Parser.Parser(packagePair_, file_, tokens_,
|
|
121
|
+
return ff_compiler_Parser.Parser(packagePair_, file_, tokens_, ff_core_List.List_grabLast(tokens_), targetIsNode_, lspHook_, false, 0, 1)
|
|
124
122
|
}
|
|
125
123
|
|
|
126
124
|
export function findBestTarget_(targetIsNode_, body_, targets_) {
|
|
@@ -195,7 +193,7 @@ return
|
|
|
195
193
|
}
|
|
196
194
|
|
|
197
195
|
export async function make_$(packagePair_, file_, tokens_, targetIsNode_, lspHook_, $task) {
|
|
198
|
-
return ff_compiler_Parser.Parser(packagePair_, file_, tokens_,
|
|
196
|
+
return ff_compiler_Parser.Parser(packagePair_, file_, tokens_, ff_core_List.List_grabLast(tokens_), targetIsNode_, lspHook_, false, 0, 1)
|
|
199
197
|
}
|
|
200
198
|
|
|
201
199
|
export async function findBestTarget_$(targetIsNode_, body_, targets_, $task) {
|
|
@@ -277,8 +275,8 @@ export function Parser_behind(self_) {
|
|
|
277
275
|
if((self_.offset_ === 0)) {
|
|
278
276
|
return ff_compiler_Parser.Parser_current(self_)
|
|
279
277
|
} else {
|
|
280
|
-
if(((self_.offset_ - 1) <
|
|
281
|
-
return
|
|
278
|
+
if(((self_.offset_ - 1) < ff_core_List.List_size(self_.tokens_))) {
|
|
279
|
+
return ff_core_List.List_grab(self_.tokens_, (self_.offset_ - 1))
|
|
282
280
|
} else {
|
|
283
281
|
return self_.end_
|
|
284
282
|
}
|
|
@@ -286,24 +284,24 @@ return self_.end_
|
|
|
286
284
|
}
|
|
287
285
|
|
|
288
286
|
export function Parser_current(self_) {
|
|
289
|
-
if((self_.offset_ <
|
|
290
|
-
return
|
|
287
|
+
if((self_.offset_ < ff_core_List.List_size(self_.tokens_))) {
|
|
288
|
+
return ff_core_List.List_grab(self_.tokens_, self_.offset_)
|
|
291
289
|
} else {
|
|
292
290
|
return self_.end_
|
|
293
291
|
}
|
|
294
292
|
}
|
|
295
293
|
|
|
296
294
|
export function Parser_ahead(self_) {
|
|
297
|
-
if(((self_.offset_ + 1) <
|
|
298
|
-
return
|
|
295
|
+
if(((self_.offset_ + 1) < ff_core_List.List_size(self_.tokens_))) {
|
|
296
|
+
return ff_core_List.List_grab(self_.tokens_, (self_.offset_ + 1))
|
|
299
297
|
} else {
|
|
300
298
|
return self_.end_
|
|
301
299
|
}
|
|
302
300
|
}
|
|
303
301
|
|
|
304
302
|
export function Parser_aheadAhead(self_) {
|
|
305
|
-
if(((self_.offset_ + 2) <
|
|
306
|
-
return
|
|
303
|
+
if(((self_.offset_ + 2) < ff_core_List.List_size(self_.tokens_))) {
|
|
304
|
+
return ff_core_List.List_grab(self_.tokens_, (self_.offset_ + 2))
|
|
307
305
|
} else {
|
|
308
306
|
return self_.end_
|
|
309
307
|
}
|
|
@@ -390,46 +388,46 @@ return p_
|
|
|
390
388
|
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"))) {
|
|
391
389
|
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)})
|
|
392
390
|
};
|
|
393
|
-
const dependencies_ =
|
|
391
|
+
const dependencies_ = ff_core_Array.make_();
|
|
394
392
|
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"))) {
|
|
395
|
-
|
|
393
|
+
ff_core_Array.Array_push(dependencies_, ff_compiler_Parser.Parser_parseDependencyDefinition(self_, package_.targets_));
|
|
396
394
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
397
395
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
398
396
|
}
|
|
399
397
|
};
|
|
400
|
-
const includes_ =
|
|
398
|
+
const includes_ = ff_core_Array.make_();
|
|
401
399
|
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"))) {
|
|
402
|
-
|
|
400
|
+
ff_core_Array.Array_push(includes_, ff_compiler_Parser.Parser_parseIncludeDefinition(self_));
|
|
403
401
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
404
402
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
405
403
|
}
|
|
406
404
|
};
|
|
407
|
-
return ff_compiler_Syntax.PackageInfo(package_,
|
|
405
|
+
return ff_compiler_Syntax.PackageInfo(package_, ff_core_Array.Array_toList(dependencies_, 0, 9007199254740991), ff_core_Array.Array_toList(includes_, 0, 9007199254740991))
|
|
408
406
|
}
|
|
409
407
|
|
|
410
408
|
export function Parser_parseModule(self_) {
|
|
411
|
-
const imports_ =
|
|
412
|
-
const types_ =
|
|
413
|
-
const traits_ =
|
|
414
|
-
const instances_ =
|
|
415
|
-
const extends_ =
|
|
416
|
-
const lets_ =
|
|
417
|
-
const functions_ =
|
|
409
|
+
const imports_ = ff_core_Array.make_();
|
|
410
|
+
const types_ = ff_core_Array.make_();
|
|
411
|
+
const traits_ = ff_core_Array.make_();
|
|
412
|
+
const instances_ = ff_core_Array.make_();
|
|
413
|
+
const extends_ = ff_core_Array.make_();
|
|
414
|
+
const lets_ = ff_core_Array.make_();
|
|
415
|
+
const functions_ = ff_core_Array.make_();
|
|
418
416
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
419
417
|
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())))) {
|
|
420
|
-
|
|
418
|
+
ff_core_Array.Array_push(lets_, ff_compiler_Parser.Parser_parseLetDefinition(self_))
|
|
421
419
|
} else if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower())) {
|
|
422
|
-
|
|
420
|
+
ff_core_Array.Array_push(functions_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, false))
|
|
423
421
|
} else 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_), "extend"))) {
|
|
424
|
-
|
|
422
|
+
ff_core_Array.Array_push(extends_, ff_compiler_Parser.Parser_parseExtendDefinition(self_))
|
|
425
423
|
} else 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_), "trait"))) {
|
|
426
|
-
|
|
424
|
+
ff_core_Array.Array_push(traits_, ff_compiler_Parser.Parser_parseTraitDefinition(self_))
|
|
427
425
|
} else 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_), "instance"))) {
|
|
428
|
-
|
|
426
|
+
ff_core_Array.Array_push(instances_, ff_compiler_Parser.Parser_parseInstanceDefinition(self_))
|
|
429
427
|
} else if((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs4(ff_compiler_Parser.Parser_current(self_), "data", "class", "capability", "newtype"))) {
|
|
430
|
-
|
|
428
|
+
ff_core_Array.Array_push(types_, ff_compiler_Parser.Parser_parseTypeDefinition(self_))
|
|
431
429
|
} else 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_), "import"))) {
|
|
432
|
-
|
|
430
|
+
ff_core_Array.Array_push(imports_, ff_compiler_Parser.Parser_parseImportDefinition(self_, self_.packagePair_))
|
|
433
431
|
} else 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_), "include"))) {
|
|
434
432
|
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_)), "Includes must be at the top of the file or below 'package'"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
435
433
|
} else 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_), "dependency"))) {
|
|
@@ -443,7 +441,7 @@ if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_com
|
|
|
443
441
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
444
442
|
}
|
|
445
443
|
};
|
|
446
|
-
return ff_compiler_Syntax.Module(self_.file_, self_.packagePair_,
|
|
444
|
+
return ff_compiler_Syntax.Module(self_.file_, self_.packagePair_, ff_core_Array.Array_toList(imports_, 0, 9007199254740991), ff_core_Array.Array_toList(types_, 0, 9007199254740991), ff_core_Array.Array_toList(traits_, 0, 9007199254740991), ff_core_Array.Array_toList(instances_, 0, 9007199254740991), ff_core_Array.Array_toList(extends_, 0, 9007199254740991), ff_core_Array.Array_toList(lets_, 0, 9007199254740991), ff_core_Array.Array_toList(functions_, 0, 9007199254740991))
|
|
447
445
|
}
|
|
448
446
|
|
|
449
447
|
export function Parser_parseLetDefinition(self_) {
|
|
@@ -507,7 +505,7 @@ const lambda_ = ff_compiler_Parser.Parser_parseLambda(self_, parameterCount_, fa
|
|
|
507
505
|
do {
|
|
508
506
|
const _1 = target_;
|
|
509
507
|
{
|
|
510
|
-
if(_1
|
|
508
|
+
if(_1 === "js") {
|
|
511
509
|
if(ff_core_Equal.notEquals_(targets_.jsSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
512
510
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
513
511
|
};
|
|
@@ -518,7 +516,7 @@ break
|
|
|
518
516
|
}
|
|
519
517
|
}
|
|
520
518
|
{
|
|
521
|
-
if(_1
|
|
519
|
+
if(_1 === "browser") {
|
|
522
520
|
if(ff_core_Equal.notEquals_(targets_.browserSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
523
521
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
524
522
|
};
|
|
@@ -529,7 +527,7 @@ break
|
|
|
529
527
|
}
|
|
530
528
|
}
|
|
531
529
|
{
|
|
532
|
-
if(_1
|
|
530
|
+
if(_1 === "node") {
|
|
533
531
|
if(ff_core_Equal.notEquals_(targets_.nodeAsync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
534
532
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
535
533
|
};
|
|
@@ -550,8 +548,8 @@ const code_ = processCode_(ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser
|
|
|
550
548
|
do {
|
|
551
549
|
const _1 = ff_core_Pair.Pair(target_, mode_);
|
|
552
550
|
{
|
|
553
|
-
if(_1.first_
|
|
554
|
-
if(_1.second_
|
|
551
|
+
if(_1.first_ === "js") {
|
|
552
|
+
if(_1.second_ === "sync") {
|
|
555
553
|
if(ff_core_Equal.notEquals_(targets_.jsSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
556
554
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
557
555
|
};
|
|
@@ -563,8 +561,8 @@ break
|
|
|
563
561
|
}
|
|
564
562
|
}
|
|
565
563
|
{
|
|
566
|
-
if(_1.first_
|
|
567
|
-
if(_1.second_
|
|
564
|
+
if(_1.first_ === "js") {
|
|
565
|
+
if(_1.second_ === "async") {
|
|
568
566
|
if(ff_core_Equal.notEquals_(targets_.jsAsync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
569
567
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
570
568
|
};
|
|
@@ -576,8 +574,8 @@ break
|
|
|
576
574
|
}
|
|
577
575
|
}
|
|
578
576
|
{
|
|
579
|
-
if(_1.first_
|
|
580
|
-
if(_1.second_
|
|
577
|
+
if(_1.first_ === "browser") {
|
|
578
|
+
if(_1.second_ === "sync") {
|
|
581
579
|
if(ff_core_Equal.notEquals_(targets_.browserSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
582
580
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
583
581
|
};
|
|
@@ -589,8 +587,8 @@ break
|
|
|
589
587
|
}
|
|
590
588
|
}
|
|
591
589
|
{
|
|
592
|
-
if(_1.first_
|
|
593
|
-
if(_1.second_
|
|
590
|
+
if(_1.first_ === "browser") {
|
|
591
|
+
if(_1.second_ === "async") {
|
|
594
592
|
if(ff_core_Equal.notEquals_(targets_.browserAsync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
595
593
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
596
594
|
};
|
|
@@ -602,8 +600,8 @@ break
|
|
|
602
600
|
}
|
|
603
601
|
}
|
|
604
602
|
{
|
|
605
|
-
if(_1.first_
|
|
606
|
-
if(_1.second_
|
|
603
|
+
if(_1.first_ === "node") {
|
|
604
|
+
if(_1.second_ === "sync") {
|
|
607
605
|
if(ff_core_Equal.notEquals_(targets_.nodeSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
608
606
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
609
607
|
};
|
|
@@ -615,8 +613,8 @@ break
|
|
|
615
613
|
}
|
|
616
614
|
}
|
|
617
615
|
{
|
|
618
|
-
if(_1.first_
|
|
619
|
-
if(_1.second_
|
|
616
|
+
if(_1.first_ === "node") {
|
|
617
|
+
if(_1.second_ === "async") {
|
|
620
618
|
if(ff_core_Equal.notEquals_(targets_.nodeAsync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
621
619
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
622
620
|
};
|
|
@@ -641,17 +639,17 @@ export function Parser_parseSignature(self_, member_) {
|
|
|
641
639
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
642
640
|
const poly_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "[")
|
|
643
641
|
? ff_compiler_Parser.Parser_parseTypeParameters(self_)
|
|
644
|
-
: ff_compiler_Parser.Poly(
|
|
642
|
+
: ff_compiler_Parser.Poly([], []));
|
|
645
643
|
const parameters_ = ((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")))
|
|
646
|
-
?
|
|
644
|
+
? []
|
|
647
645
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, false));
|
|
648
646
|
const returnType_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())
|
|
649
647
|
? (function() {
|
|
650
648
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
651
649
|
return ff_compiler_Parser.Parser_parseType(self_)
|
|
652
650
|
})()
|
|
653
|
-
: ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "ff:core/Unit.Unit",
|
|
654
|
-
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(nameToken_), "TemporaryEffect$",
|
|
651
|
+
: ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "ff:core/Unit.Unit", []));
|
|
652
|
+
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(nameToken_), "TemporaryEffect$", []);
|
|
655
653
|
return ff_compiler_Syntax.Signature(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), member_, poly_.generics_, poly_.constraints_, parameters_, returnType_, temporaryEffect_)
|
|
656
654
|
}
|
|
657
655
|
|
|
@@ -663,20 +661,20 @@ const extendToken_ = ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.
|
|
|
663
661
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
664
662
|
const poly_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "[")
|
|
665
663
|
? ff_compiler_Parser.Parser_parseTypeParameters(self_)
|
|
666
|
-
: ff_compiler_Parser.Poly(
|
|
664
|
+
: ff_compiler_Parser.Poly([], []));
|
|
667
665
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
668
666
|
const type_ = ff_compiler_Parser.Parser_parseType(self_);
|
|
669
667
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
670
|
-
const methods_ =
|
|
668
|
+
const methods_ = ff_core_Array.make_();
|
|
671
669
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
672
|
-
|
|
670
|
+
ff_core_Array.Array_push(methods_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, true));
|
|
673
671
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
674
672
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
675
673
|
}
|
|
676
674
|
};
|
|
677
675
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}");
|
|
678
676
|
if(self_.lspHook_.trackSymbols_) {
|
|
679
|
-
let name_ = ff_compiler_Syntax.Type_show(type_,
|
|
677
|
+
let name_ = ff_compiler_Syntax.Type_show(type_, []);
|
|
680
678
|
ff_core_List.List_each(ff_core_List.List_zip(poly_.generics_, poly_.constraints_), ((_1) => {
|
|
681
679
|
{
|
|
682
680
|
const generic_ = _1.first_;
|
|
@@ -690,7 +688,7 @@ return
|
|
|
690
688
|
}));
|
|
691
689
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(name_, 3, ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(extendToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
692
690
|
};
|
|
693
|
-
return ff_compiler_Syntax.DExtend(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), poly_.generics_, poly_.constraints_, type_,
|
|
691
|
+
return ff_compiler_Syntax.DExtend(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), poly_.generics_, poly_.constraints_, type_, ff_core_Array.Array_toList(methods_, 0, 9007199254740991))
|
|
694
692
|
}
|
|
695
693
|
|
|
696
694
|
export function Parser_parseTraitDefinition(self_) {
|
|
@@ -702,26 +700,26 @@ const typeParameterToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_To
|
|
|
702
700
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
703
701
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
704
702
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
705
|
-
? ff_compiler_Parser.Poly(
|
|
703
|
+
? ff_compiler_Parser.Poly([], [])
|
|
706
704
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
707
|
-
const constraints_ =
|
|
705
|
+
const constraints_ = ff_core_Array.make_();
|
|
708
706
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())) {
|
|
709
707
|
ff_compiler_Parser.Parser_fail(self_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Trait constraints is not yet implemented");
|
|
710
708
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
711
709
|
const constraint_ = ff_compiler_Parser.Parser_parseConstraint(self_);
|
|
712
|
-
|
|
713
|
-
return ff_compiler_Syntax.Constraint(_c.at_, _c.name_,
|
|
710
|
+
ff_core_Array.Array_push(constraints_, (((_c) => {
|
|
711
|
+
return ff_compiler_Syntax.Constraint(_c.at_, _c.name_, [ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(typeParameterToken_), ff_compiler_Token.Token_raw(typeParameterToken_), []), ...constraint_.generics_])
|
|
714
712
|
}))(constraint_))
|
|
715
713
|
};
|
|
716
714
|
const generatorParameters_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "("))
|
|
717
|
-
?
|
|
715
|
+
? []
|
|
718
716
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, false));
|
|
719
|
-
const methodGenerators_ =
|
|
720
|
-
const methodDefaults_ =
|
|
717
|
+
const methodGenerators_ = ff_core_Array.make_();
|
|
718
|
+
const methodDefaults_ = ff_core_Array.make_();
|
|
721
719
|
const methodSignatures_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{"))
|
|
722
|
-
?
|
|
720
|
+
? []
|
|
723
721
|
: (function() {
|
|
724
|
-
const signatures_ =
|
|
722
|
+
const signatures_ = ff_core_Array.make_();
|
|
725
723
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
726
724
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
727
725
|
if(self_.lspHook_.trackSymbols_) {
|
|
@@ -732,14 +730,14 @@ const signature_ = ff_compiler_Parser.Parser_parseSignature(self_, true);
|
|
|
732
730
|
if(self_.lspHook_.trackSymbols_) {
|
|
733
731
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(signatureNameToken_), 12, ff_compiler_Token.Token_at(signatureNameToken_), ff_compiler_Token.Token_end(signatureNameToken_), ff_compiler_Token.Token_at(signatureNameToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
734
732
|
};
|
|
735
|
-
|
|
733
|
+
ff_core_Array.Array_push(signatures_, signature_);
|
|
736
734
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")) {
|
|
737
735
|
const generator_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_ahead(self_), "generate"));
|
|
738
736
|
const body_ = ff_compiler_Parser.Parser_parseLambda(self_, ff_core_List.List_size(signature_.parameters_), true, false);
|
|
739
737
|
if(generator_) {
|
|
740
|
-
|
|
738
|
+
ff_core_Array.Array_push(methodGenerators_, ff_core_Pair.Pair(signature_.name_, body_))
|
|
741
739
|
} else {
|
|
742
|
-
|
|
740
|
+
ff_core_Array.Array_push(methodDefaults_, ff_core_Pair.Pair(signature_.name_, body_))
|
|
743
741
|
}
|
|
744
742
|
};
|
|
745
743
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -747,12 +745,12 @@ ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
|
747
745
|
}
|
|
748
746
|
};
|
|
749
747
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}");
|
|
750
|
-
return
|
|
748
|
+
return ff_core_Array.Array_toList(signatures_, 0, 9007199254740991)
|
|
751
749
|
})());
|
|
752
750
|
if(self_.lspHook_.trackSymbols_) {
|
|
753
751
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(nameToken_), 11, ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(traitToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
754
752
|
};
|
|
755
|
-
return ff_compiler_Syntax.DTrait(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_),
|
|
753
|
+
return ff_compiler_Syntax.DTrait(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), [ff_compiler_Token.Token_raw(typeParameterToken_), ...poly_.generics_], [...ff_core_Array.Array_toList(constraints_, 0, 9007199254740991), ...poly_.constraints_], generatorParameters_, methodSignatures_, ff_core_Array.Array_toList(methodDefaults_, 0, 9007199254740991), ff_core_Array.Array_toList(methodGenerators_, 0, 9007199254740991))
|
|
756
754
|
}
|
|
757
755
|
|
|
758
756
|
export function Parser_parseInstanceDefinition(self_) {
|
|
@@ -762,18 +760,18 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbol
|
|
|
762
760
|
const instanceToken_ = ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "instance");
|
|
763
761
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
764
762
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
765
|
-
? ff_compiler_Parser.Poly(
|
|
763
|
+
? ff_compiler_Parser.Poly([], [])
|
|
766
764
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
767
|
-
const typeArguments_ =
|
|
768
|
-
|
|
769
|
-
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), _w1,
|
|
765
|
+
const typeArguments_ = ff_core_Array.make_();
|
|
766
|
+
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) => {
|
|
767
|
+
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), _w1, [])
|
|
770
768
|
}))));
|
|
771
769
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
772
770
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
773
771
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "[")) {
|
|
774
772
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "[");
|
|
775
773
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
776
|
-
|
|
774
|
+
ff_core_Array.Array_push(typeArguments_, ff_compiler_Parser.Parser_parseType(self_));
|
|
777
775
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
778
776
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
779
777
|
}
|
|
@@ -782,24 +780,24 @@ ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "]")
|
|
|
782
780
|
};
|
|
783
781
|
const generatorArguments_ = ff_compiler_Parser.Parser_parseFunctionArguments(self_, ff_compiler_Token.Token_at(nameToken_), false).first_;
|
|
784
782
|
const methods_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{"))
|
|
785
|
-
?
|
|
783
|
+
? []
|
|
786
784
|
: (function() {
|
|
787
|
-
const definitions_ =
|
|
785
|
+
const definitions_ = ff_core_Array.make_();
|
|
788
786
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
789
787
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
790
|
-
|
|
788
|
+
ff_core_Array.Array_push(definitions_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, false));
|
|
791
789
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
792
790
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
793
791
|
}
|
|
794
792
|
};
|
|
795
793
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}");
|
|
796
|
-
return
|
|
794
|
+
return ff_core_Array.Array_toList(definitions_, 0, 9007199254740991)
|
|
797
795
|
})());
|
|
798
796
|
if(self_.lspHook_.trackSymbols_) {
|
|
799
797
|
const name_ = ((ff_compiler_Token.Token_raw(token_) + ": ") + ff_compiler_Token.Token_raw(nameToken_));
|
|
800
798
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(name_, 19, ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(instanceToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
801
799
|
};
|
|
802
|
-
return ff_compiler_Syntax.DInstance(ff_compiler_Token.Token_at(nameToken_), poly_.generics_, poly_.constraints_, ff_compiler_Token.Token_raw(nameToken_),
|
|
800
|
+
return ff_compiler_Syntax.DInstance(ff_compiler_Token.Token_at(nameToken_), poly_.generics_, poly_.constraints_, ff_compiler_Token.Token_raw(nameToken_), ff_core_Array.Array_toList(typeArguments_, 0, 9007199254740991), generatorArguments_, methods_, false)
|
|
803
801
|
}
|
|
804
802
|
|
|
805
803
|
export function Parser_parseTypeDefinition(self_) {
|
|
@@ -808,8 +806,8 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbol
|
|
|
808
806
|
};
|
|
809
807
|
const newtype_ = ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "newtype");
|
|
810
808
|
const effectParameter_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "capability")
|
|
811
|
-
?
|
|
812
|
-
:
|
|
809
|
+
? ["Q$"]
|
|
810
|
+
: []);
|
|
813
811
|
const allowMutable_ = ff_compiler_Token.Token_rawIs2(ff_compiler_Parser.Parser_current(self_), "class", "capability");
|
|
814
812
|
const kindToken_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "newtype")
|
|
815
813
|
? ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "newtype")
|
|
@@ -820,26 +818,26 @@ const kindToken_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_curr
|
|
|
820
818
|
: ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "capability"));
|
|
821
819
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
822
820
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
823
|
-
? ff_compiler_Parser.Poly(
|
|
821
|
+
? ff_compiler_Parser.Poly([], [])
|
|
824
822
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
825
823
|
if(((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))) {
|
|
826
824
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{")
|
|
827
825
|
};
|
|
828
826
|
const commonFields_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "("))
|
|
829
|
-
?
|
|
827
|
+
? []
|
|
830
828
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, true));
|
|
831
829
|
const variants_ = ((newtype_ || (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))
|
|
832
|
-
?
|
|
830
|
+
? [ff_compiler_Syntax.Variant(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), [])]
|
|
833
831
|
: (function() {
|
|
834
832
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
835
|
-
const variantsBuilder_ =
|
|
833
|
+
const variantsBuilder_ = ff_core_Array.make_();
|
|
836
834
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
837
835
|
if(self_.lspHook_.trackSymbols_) {
|
|
838
836
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolBegin())
|
|
839
837
|
};
|
|
840
838
|
const variantNameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
841
839
|
const variantFields_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "("))
|
|
842
|
-
?
|
|
840
|
+
? []
|
|
843
841
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, true));
|
|
844
842
|
if(((!allowMutable_) && ff_core_List.List_any(variantFields_, ((_w1) => {
|
|
845
843
|
return _w1.mutable_
|
|
@@ -848,7 +846,7 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Sy
|
|
|
848
846
|
return _w1.mutable_
|
|
849
847
|
}))).at_, "Only classes can have mutable fields"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
850
848
|
};
|
|
851
|
-
|
|
849
|
+
ff_core_Array.Array_push(variantsBuilder_, ff_compiler_Syntax.Variant(ff_compiler_Token.Token_at(variantNameToken_), ff_compiler_Token.Token_raw(variantNameToken_), variantFields_));
|
|
852
850
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
853
851
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
854
852
|
};
|
|
@@ -857,7 +855,7 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbol
|
|
|
857
855
|
}
|
|
858
856
|
};
|
|
859
857
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}");
|
|
860
|
-
return
|
|
858
|
+
return ff_core_Array.Array_toList(variantsBuilder_, 0, 9007199254740991)
|
|
861
859
|
})());
|
|
862
860
|
if((newtype_ && (ff_core_List.List_size(commonFields_) !== 1))) {
|
|
863
861
|
ff_core_Log.show_(commonFields_, ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Parameter));
|
|
@@ -870,7 +868,7 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Sy
|
|
|
870
868
|
return _w1.mutable_
|
|
871
869
|
}))).at_, "Only classes and capabilities can have mutable fields"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
872
870
|
};
|
|
873
|
-
const generics_ =
|
|
871
|
+
const generics_ = [...effectParameter_, ...poly_.generics_];
|
|
874
872
|
const result_ = ff_compiler_Syntax.DType(ff_compiler_Token.Token_at(nameToken_), newtype_, (!allowMutable_), ff_compiler_Token.Token_raw(nameToken_), generics_, poly_.constraints_, commonFields_, variants_);
|
|
875
873
|
if(self_.lspHook_.trackSymbols_) {
|
|
876
874
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(nameToken_), 5, ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(kindToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
@@ -880,9 +878,9 @@ return result_
|
|
|
880
878
|
|
|
881
879
|
export function Parser_parseImportDefinition(self_, currentPackagePair_) {
|
|
882
880
|
const importToken_ = ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "import");
|
|
883
|
-
const path_ =
|
|
881
|
+
const path_ = ff_core_Array.make_();
|
|
884
882
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower())) {
|
|
885
|
-
|
|
883
|
+
ff_core_Array.Array_push(path_, ff_compiler_Parser.Parser_parseDashedName(self_));
|
|
886
884
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot())
|
|
887
885
|
};
|
|
888
886
|
const fileToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
@@ -901,7 +899,7 @@ const packageName_ = ff_compiler_Parser.Parser_parseDashedName(self_);
|
|
|
901
899
|
return ff_compiler_Syntax.PackagePair(userName_, packageName_)
|
|
902
900
|
})()
|
|
903
901
|
: currentPackagePair_);
|
|
904
|
-
return ff_compiler_Syntax.DImport(ff_compiler_Token.Token_at(fileToken_), alias_, packagePair_,
|
|
902
|
+
return ff_compiler_Syntax.DImport(ff_compiler_Token.Token_at(fileToken_), alias_, packagePair_, ff_core_Array.Array_toList(path_, 0, 9007199254740991), ff_compiler_Token.Token_raw(fileToken_))
|
|
905
903
|
}
|
|
906
904
|
|
|
907
905
|
export function Parser_parsePackageDefinition(self_) {
|
|
@@ -946,7 +944,7 @@ const token_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(sel
|
|
|
946
944
|
do {
|
|
947
945
|
const _1 = ff_compiler_Token.Token_raw(token_);
|
|
948
946
|
{
|
|
949
|
-
if(_1
|
|
947
|
+
if(_1 === "node") {
|
|
950
948
|
const _guard1 = targets_.node_;
|
|
951
949
|
if(_guard1) {
|
|
952
950
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Token.Token_at(token_), "Duplicate target name"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
@@ -955,7 +953,7 @@ break
|
|
|
955
953
|
}
|
|
956
954
|
}
|
|
957
955
|
{
|
|
958
|
-
if(_1
|
|
956
|
+
if(_1 === "node") {
|
|
959
957
|
targets_ = (((_c) => {
|
|
960
958
|
return ff_compiler_Syntax.TargetNames(true, _c.browser_)
|
|
961
959
|
}))(targets_)
|
|
@@ -963,7 +961,7 @@ break
|
|
|
963
961
|
}
|
|
964
962
|
}
|
|
965
963
|
{
|
|
966
|
-
if(_1
|
|
964
|
+
if(_1 === "browser") {
|
|
967
965
|
const _guard1 = targets_.browser_;
|
|
968
966
|
if(_guard1) {
|
|
969
967
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Token.Token_at(token_), "Duplicate target name"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
@@ -972,7 +970,7 @@ break
|
|
|
972
970
|
}
|
|
973
971
|
}
|
|
974
972
|
{
|
|
975
|
-
if(_1
|
|
973
|
+
if(_1 === "browser") {
|
|
976
974
|
targets_ = (((_c) => {
|
|
977
975
|
return ff_compiler_Syntax.TargetNames(_c.node_, true)
|
|
978
976
|
}))(targets_)
|
|
@@ -1003,7 +1001,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot());
|
|
|
1003
1001
|
return ff_core_String.String_grabInt(ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LInt())))
|
|
1004
1002
|
})()
|
|
1005
1003
|
: 0);
|
|
1006
|
-
return ff_compiler_Syntax.Version(ff_compiler_Token.Token_at(majorMinor_), ff_core_String.String_grabInt(
|
|
1004
|
+
return ff_compiler_Syntax.Version(ff_compiler_Token.Token_at(majorMinor_), ff_core_String.String_grabInt(ff_core_List.List_grab(parts_, 0)), ff_core_String.String_grabInt(ff_core_List.List_grab(parts_, 1)), patch_)
|
|
1007
1005
|
} else {
|
|
1008
1006
|
const major_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LInt());
|
|
1009
1007
|
return ff_compiler_Syntax.Version(ff_compiler_Token.Token_at(major_), ff_core_String.String_grabInt(ff_compiler_Token.Token_raw(major_)), 0, 0)
|
|
@@ -1046,19 +1044,19 @@ return part_
|
|
|
1046
1044
|
|
|
1047
1045
|
export function Parser_parseTypeParameters(self_) {
|
|
1048
1046
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "[");
|
|
1049
|
-
const parameters_ =
|
|
1050
|
-
const constraints_ =
|
|
1047
|
+
const parameters_ = ff_core_Array.make_();
|
|
1048
|
+
const constraints_ = ff_core_Array.make_();
|
|
1051
1049
|
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())))) {
|
|
1052
1050
|
if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LBracketLeft())) {
|
|
1053
|
-
|
|
1051
|
+
ff_core_Array.Array_push(constraints_, ff_compiler_Parser.Parser_parseConstraint(self_))
|
|
1054
1052
|
} else {
|
|
1055
1053
|
const parameterNameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
1056
|
-
|
|
1054
|
+
ff_core_Array.Array_push(parameters_, ff_compiler_Token.Token_raw(parameterNameToken_));
|
|
1057
1055
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())) {
|
|
1058
1056
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
1059
1057
|
const constraint_ = ff_compiler_Parser.Parser_parseConstraint(self_);
|
|
1060
|
-
|
|
1061
|
-
return ff_compiler_Syntax.Constraint(_c.at_, _c.name_,
|
|
1058
|
+
ff_core_Array.Array_push(constraints_, (((_c) => {
|
|
1059
|
+
return ff_compiler_Syntax.Constraint(_c.at_, _c.name_, [ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(parameterNameToken_), ff_compiler_Token.Token_raw(parameterNameToken_), []), ...constraint_.generics_])
|
|
1062
1060
|
}))(constraint_))
|
|
1063
1061
|
}
|
|
1064
1062
|
};
|
|
@@ -1067,16 +1065,16 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
|
1067
1065
|
}
|
|
1068
1066
|
};
|
|
1069
1067
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "]");
|
|
1070
|
-
return ff_compiler_Parser.Poly(
|
|
1068
|
+
return ff_compiler_Parser.Poly(ff_core_Array.Array_toList(parameters_, 0, 9007199254740991), ff_core_Array.Array_toList(constraints_, 0, 9007199254740991))
|
|
1071
1069
|
}
|
|
1072
1070
|
|
|
1073
1071
|
export function Parser_parseTypeArguments(self_, parenthesis_ = false) {
|
|
1074
1072
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), (parenthesis_
|
|
1075
1073
|
? "("
|
|
1076
1074
|
: "["));
|
|
1077
|
-
const types_ =
|
|
1075
|
+
const types_ = ff_core_Array.make_();
|
|
1078
1076
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1079
|
-
|
|
1077
|
+
ff_core_Array.Array_push(types_, ff_compiler_Parser.Parser_parseType(self_));
|
|
1080
1078
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1081
1079
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
1082
1080
|
}
|
|
@@ -1084,11 +1082,11 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
|
1084
1082
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), (parenthesis_
|
|
1085
1083
|
? ")"
|
|
1086
1084
|
: "]"));
|
|
1087
|
-
return
|
|
1085
|
+
return ff_core_Array.Array_toList(types_, 0, 9007199254740991)
|
|
1088
1086
|
}
|
|
1089
1087
|
|
|
1090
1088
|
export function Parser_parseFunctionParameters(self_, allowMutable_ = false) {
|
|
1091
|
-
const parameters_ =
|
|
1089
|
+
const parameters_ = ff_core_Array.make_();
|
|
1092
1090
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
1093
1091
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1094
1092
|
const lspTrackSymbols_ = (self_.lspHook_.trackSymbols_ && allowMutable_);
|
|
@@ -1102,8 +1100,8 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword())
|
|
|
1102
1100
|
};
|
|
1103
1101
|
const parameterNameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
1104
1102
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())))) {
|
|
1105
|
-
const t_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(parameterNameToken_), "ff:core/Nothing.Nothing",
|
|
1106
|
-
|
|
1103
|
+
const t_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(parameterNameToken_), "ff:core/Nothing.Nothing", []);
|
|
1104
|
+
ff_core_Array.Array_push(parameters_, ff_compiler_Syntax.Parameter(ff_compiler_Token.Token_at(parameterNameToken_), mutable_, ff_compiler_Token.Token_raw(parameterNameToken_), t_, ff_core_Option.None()));
|
|
1107
1105
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1108
1106
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
1109
1107
|
}
|
|
@@ -1116,7 +1114,7 @@ const default_ = ((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current
|
|
|
1116
1114
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
1117
1115
|
return ff_core_Option.Some(ff_compiler_Parser.Parser_parseTerm(self_))
|
|
1118
1116
|
})());
|
|
1119
|
-
|
|
1117
|
+
ff_core_Array.Array_push(parameters_, ff_compiler_Syntax.Parameter(ff_compiler_Token.Token_at(parameterNameToken_), mutable_, ff_compiler_Token.Token_raw(parameterNameToken_), parameterType_, default_));
|
|
1120
1118
|
if(lspTrackSymbols_) {
|
|
1121
1119
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(parameterNameToken_), 7, ff_compiler_Token.Token_at(parameterNameToken_), ff_compiler_Token.Token_end(parameterNameToken_), ff_compiler_Token.Token_at(lspFirst_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
1122
1120
|
};
|
|
@@ -1126,11 +1124,11 @@ ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
|
1126
1124
|
}
|
|
1127
1125
|
};
|
|
1128
1126
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
1129
|
-
return
|
|
1127
|
+
return ff_core_Array.Array_toList(parameters_, 0, 9007199254740991)
|
|
1130
1128
|
}
|
|
1131
1129
|
|
|
1132
1130
|
export function Parser_parseFunctionArguments(self_, callAt_, trailing_) {
|
|
1133
|
-
const arguments_ =
|
|
1131
|
+
const arguments_ = ff_core_Array.make_();
|
|
1134
1132
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
1135
1133
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
1136
1134
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -1145,13 +1143,13 @@ return ff_core_Option.Some(token_)
|
|
|
1145
1143
|
const value_ = ff_compiler_Parser.Parser_parseTerm(self_);
|
|
1146
1144
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
1147
1145
|
if(ff_compiler_LspHook.strictlyBetween_(callAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
1148
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_,
|
|
1146
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_, ff_core_Array.Array_size(arguments_), ff_core_Option.Option_map(nameToken_, ((_w1) => {
|
|
1149
1147
|
return ff_compiler_Token.Token_raw(_w1)
|
|
1150
1148
|
}))));
|
|
1151
1149
|
self_.lspEmittedArgumentHook_ = true
|
|
1152
1150
|
}
|
|
1153
1151
|
};
|
|
1154
|
-
|
|
1152
|
+
ff_core_Array.Array_push(arguments_, ff_compiler_Syntax.Argument(ff_compiler_Token.Token_at(argumentToken_), ff_core_Option.Option_map(nameToken_, ((_w1) => {
|
|
1155
1153
|
return ff_compiler_Token.Token_raw(_w1)
|
|
1156
1154
|
})), value_));
|
|
1157
1155
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -1160,7 +1158,7 @@ ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
|
1160
1158
|
};
|
|
1161
1159
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
1162
1160
|
if(ff_compiler_LspHook.strictlyBetween_(callAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
1163
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_,
|
|
1161
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_, ff_core_Array.Array_size(arguments_), ff_core_Option.None()));
|
|
1164
1162
|
self_.lspEmittedArgumentHook_ = true
|
|
1165
1163
|
}
|
|
1166
1164
|
};
|
|
@@ -1171,30 +1169,30 @@ if(trailing_) {
|
|
|
1171
1169
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower(), ff_compiler_Token.LUpper(), ff_compiler_Token.LString()) || ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LInt(), ff_compiler_Token.LChar(), ff_compiler_Token.LFloat())))) {
|
|
1172
1170
|
lastWasCurly_ = true;
|
|
1173
1171
|
const term_ = ff_compiler_Parser.Parser_parseTerm(self_);
|
|
1174
|
-
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(term_.at_, "TemporaryEffect$",
|
|
1175
|
-
const cases_ =
|
|
1172
|
+
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(term_.at_, "TemporaryEffect$", []);
|
|
1173
|
+
const cases_ = [ff_compiler_Syntax.MatchCase(term_.at_, [], [], term_)];
|
|
1176
1174
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
1177
1175
|
if(ff_compiler_LspHook.strictlyBetween_(callAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
1178
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_,
|
|
1176
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_, ff_core_Array.Array_size(arguments_), ff_core_Option.None()));
|
|
1179
1177
|
self_.lspEmittedArgumentHook_ = true
|
|
1180
1178
|
}
|
|
1181
1179
|
};
|
|
1182
|
-
|
|
1180
|
+
ff_core_Array.Array_push(arguments_, ff_compiler_Syntax.Argument(term_.at_, ff_core_Option.None(), ff_compiler_Syntax.ELambda(term_.at_, ff_compiler_Syntax.Lambda(term_.at_, temporaryEffect_, cases_))))
|
|
1183
1181
|
} else {
|
|
1184
1182
|
while((ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{") || ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon()))) {
|
|
1185
1183
|
lastWasCurly_ = ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{");
|
|
1186
1184
|
const lambda_ = ff_compiler_Parser.Parser_parseLambda(self_, 0, false, true);
|
|
1187
1185
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
1188
1186
|
if(ff_compiler_LspHook.strictlyBetween_(callAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
1189
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_,
|
|
1187
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_, ff_core_Array.Array_size(arguments_), ff_core_Option.None()));
|
|
1190
1188
|
self_.lspEmittedArgumentHook_ = true
|
|
1191
1189
|
}
|
|
1192
1190
|
};
|
|
1193
|
-
|
|
1191
|
+
ff_core_Array.Array_push(arguments_, ff_compiler_Syntax.Argument(lambda_.at_, ff_core_Option.None(), ff_compiler_Syntax.ELambda(lambda_.at_, lambda_)))
|
|
1194
1192
|
}
|
|
1195
1193
|
}
|
|
1196
1194
|
};
|
|
1197
|
-
return ff_core_Pair.Pair(
|
|
1195
|
+
return ff_core_Pair.Pair(ff_core_Array.Array_toList(arguments_, 0, 9007199254740991), lastWasCurly_)
|
|
1198
1196
|
}
|
|
1199
1197
|
|
|
1200
1198
|
export function Parser_parseLambda(self_, defaultParameterCount_ = 0, ignoreGenerateKeyword_ = false, allowColon_ = false) {
|
|
@@ -1207,21 +1205,21 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword())
|
|
|
1207
1205
|
};
|
|
1208
1206
|
const result_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe())
|
|
1209
1207
|
? (function() {
|
|
1210
|
-
const cases_ =
|
|
1208
|
+
const cases_ = ff_core_Array.make_();
|
|
1211
1209
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe())) {
|
|
1212
|
-
|
|
1210
|
+
ff_core_Array.Array_push(cases_, ff_compiler_Parser.Parser_parseCase(self_))
|
|
1213
1211
|
};
|
|
1214
|
-
return
|
|
1212
|
+
return ff_core_Array.Array_toList(cases_, 0, 9007199254740991)
|
|
1215
1213
|
})()
|
|
1216
1214
|
: (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()))
|
|
1217
1215
|
? (function() {
|
|
1218
|
-
const parameters_ =
|
|
1216
|
+
const parameters_ = ff_core_Array.make_();
|
|
1219
1217
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick()))) {
|
|
1220
1218
|
const isVariable_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower());
|
|
1221
1219
|
const parameterToken_ = (isVariable_
|
|
1222
1220
|
? ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower())
|
|
1223
1221
|
: ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LWildcard()));
|
|
1224
|
-
|
|
1222
|
+
ff_core_Array.Array_push(parameters_, ff_compiler_Syntax.PVariable(ff_compiler_Token.Token_at(parameterToken_), (isVariable_
|
|
1225
1223
|
? ff_core_Option.Some(ff_compiler_Token.Token_raw(parameterToken_))
|
|
1226
1224
|
: ff_core_Option.None())));
|
|
1227
1225
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick()))) {
|
|
@@ -1230,7 +1228,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
|
1230
1228
|
};
|
|
1231
1229
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LArrowThick());
|
|
1232
1230
|
const term_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
1233
|
-
return
|
|
1231
|
+
return [ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_), ff_core_Array.Array_toList(parameters_, 0, 9007199254740991), [], term_)]
|
|
1234
1232
|
})()
|
|
1235
1233
|
: (function() {
|
|
1236
1234
|
const term_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
@@ -1243,40 +1241,40 @@ return ff_compiler_Syntax.PVariable(ff_compiler_Token.Token_at(token_), ff_core_
|
|
|
1243
1241
|
: ff_core_List.List_map(ff_core_List.range_(defaultParameterCount_), ((i_) => {
|
|
1244
1242
|
return ff_compiler_Syntax.PVariable(ff_compiler_Token.Token_at(token_), ff_core_Option.None())
|
|
1245
1243
|
})));
|
|
1246
|
-
return
|
|
1244
|
+
return [ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_), arguments_, [], e_)]
|
|
1247
1245
|
})());
|
|
1248
1246
|
if((!colon_)) {
|
|
1249
1247
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}")
|
|
1250
1248
|
};
|
|
1251
|
-
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), "TemporaryEffect$",
|
|
1249
|
+
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), "TemporaryEffect$", []);
|
|
1252
1250
|
return ff_compiler_Syntax.Lambda(ff_compiler_Token.Token_at(token_), temporaryEffect_, result_)
|
|
1253
1251
|
}
|
|
1254
1252
|
|
|
1255
1253
|
export function Parser_parseCase(self_) {
|
|
1256
1254
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LPipe());
|
|
1257
|
-
const patterns_ =
|
|
1255
|
+
const patterns_ = ff_core_Array.make_();
|
|
1258
1256
|
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_), "{")))) {
|
|
1259
|
-
|
|
1257
|
+
ff_core_Array.Array_push(patterns_, ff_compiler_Parser.Parser_parsePattern(self_));
|
|
1260
1258
|
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_), "{")))) {
|
|
1261
1259
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
1262
1260
|
}
|
|
1263
1261
|
};
|
|
1264
|
-
const guards_ =
|
|
1262
|
+
const guards_ = ff_core_Array.make_();
|
|
1265
1263
|
while(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")) {
|
|
1266
|
-
|
|
1264
|
+
ff_core_Array.Array_push(guards_, ff_compiler_Parser.Parser_parseCaseGuard(self_))
|
|
1267
1265
|
};
|
|
1268
1266
|
if(((!ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) || (!ff_compiler_Token.Token_is2(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe(), ff_compiler_Token.LBracketRight())))) {
|
|
1269
1267
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LArrowThick())
|
|
1270
1268
|
};
|
|
1271
1269
|
const body_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
1272
|
-
return ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_),
|
|
1270
|
+
return ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_), ff_core_Array.Array_toList(patterns_, 0, 9007199254740991), ff_core_Array.Array_toList(guards_, 0, 9007199254740991), body_)
|
|
1273
1271
|
}
|
|
1274
1272
|
|
|
1275
1273
|
export function Parser_parseCaseGuard(self_) {
|
|
1276
1274
|
const guardToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LBracketLeft());
|
|
1277
1275
|
const term_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
1278
1276
|
const p_ = ((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe()))
|
|
1279
|
-
? ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(guardToken_), "True",
|
|
1277
|
+
? ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(guardToken_), "True", [])
|
|
1280
1278
|
: (function() {
|
|
1281
1279
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LPipe());
|
|
1282
1280
|
return ff_compiler_Parser.Parser_parsePattern(self_)
|
|
@@ -1322,29 +1320,29 @@ return ff_compiler_Syntax.PChar(ff_compiler_Token.Token_at(token_), ff_compiler_
|
|
|
1322
1320
|
: (function() {
|
|
1323
1321
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
1324
1322
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
1325
|
-
const patterns_ =
|
|
1323
|
+
const patterns_ = ff_core_Array.make_();
|
|
1326
1324
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
1327
1325
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1328
1326
|
const pattern_ = ff_compiler_Parser.Parser_parsePattern(self_);
|
|
1329
1327
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
1330
1328
|
if(ff_compiler_LspHook.strictlyBetween_(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
1331
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(ff_compiler_Token.Token_at(token_),
|
|
1329
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(ff_compiler_Token.Token_at(token_), ff_core_Array.Array_size(patterns_), ff_core_Option.None()));
|
|
1332
1330
|
self_.lspEmittedArgumentHook_ = true
|
|
1333
1331
|
}
|
|
1334
1332
|
};
|
|
1335
|
-
|
|
1333
|
+
ff_core_Array.Array_push(patterns_, pattern_);
|
|
1336
1334
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1337
1335
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
1338
1336
|
}
|
|
1339
1337
|
};
|
|
1340
1338
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
1341
1339
|
if(ff_compiler_LspHook.strictlyBetween_(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
1342
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(ff_compiler_Token.Token_at(token_),
|
|
1340
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(ff_compiler_Token.Token_at(token_), ff_core_Array.Array_size(patterns_), ff_core_Option.None()));
|
|
1343
1341
|
self_.lspEmittedArgumentHook_ = true
|
|
1344
1342
|
}
|
|
1345
1343
|
};
|
|
1346
1344
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
1347
|
-
return ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_),
|
|
1345
|
+
return ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_), ff_core_Array.Array_toList(patterns_, 0, 9007199254740991))
|
|
1348
1346
|
} else {
|
|
1349
1347
|
if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower())) {
|
|
1350
1348
|
const asToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
@@ -1353,7 +1351,7 @@ return ff_compiler_Syntax.PVariantAs(ff_compiler_Token.Token_at(token_), ff_comp
|
|
|
1353
1351
|
const wildcardToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LWildcard());
|
|
1354
1352
|
return ff_compiler_Syntax.PVariantAs(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_), ff_compiler_Token.Token_at(wildcardToken_), ff_core_Option.None())
|
|
1355
1353
|
} else {
|
|
1356
|
-
return ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_),
|
|
1354
|
+
return ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_), [])
|
|
1357
1355
|
}
|
|
1358
1356
|
}
|
|
1359
1357
|
})());
|
|
@@ -1371,7 +1369,7 @@ const leftTypes_ = (((ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_cu
|
|
|
1371
1369
|
? (function() {
|
|
1372
1370
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
1373
1371
|
const pair_ = ff_core_List.List_unzip(ff_compiler_Parser.Parser_parseRecordType(self_));
|
|
1374
|
-
return
|
|
1372
|
+
return [ff_compiler_Syntax.TConstructor(at_, ("Record$" + ff_core_List.List_join(pair_.first_, "$")), pair_.second_)]
|
|
1375
1373
|
})()
|
|
1376
1374
|
: ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")
|
|
1377
1375
|
? ff_compiler_Parser.Parser_parseTypeArguments(self_, true)
|
|
@@ -1381,16 +1379,16 @@ const namespace_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current
|
|
|
1381
1379
|
: "");
|
|
1382
1380
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
1383
1381
|
const arguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
1384
|
-
?
|
|
1382
|
+
? []
|
|
1385
1383
|
: ff_compiler_Parser.Parser_parseTypeArguments(self_, false));
|
|
1386
|
-
return
|
|
1384
|
+
return [ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), (namespace_ + ff_compiler_Token.Token_raw(token_)), arguments_)]
|
|
1387
1385
|
})());
|
|
1388
1386
|
if(((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick())) && (ff_core_List.List_size(leftTypes_) === 1))) {
|
|
1389
1387
|
return ff_core_List.List_grabFirst(leftTypes_)
|
|
1390
1388
|
} else {
|
|
1391
1389
|
const arrowToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LArrowThick());
|
|
1392
1390
|
const rightType_ = ff_compiler_Parser.Parser_parseType(self_);
|
|
1393
|
-
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(arrowToken_), ("Function$" + ff_core_List.List_size(leftTypes_)),
|
|
1391
|
+
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(arrowToken_), ("Function$" + ff_core_List.List_size(leftTypes_)), [...leftTypes_, rightType_])
|
|
1394
1392
|
}
|
|
1395
1393
|
}
|
|
1396
1394
|
|
|
@@ -1400,14 +1398,14 @@ const namespace_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current
|
|
|
1400
1398
|
: "");
|
|
1401
1399
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
1402
1400
|
const arguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
1403
|
-
?
|
|
1401
|
+
? []
|
|
1404
1402
|
: ff_compiler_Parser.Parser_parseTypeArguments(self_, false));
|
|
1405
1403
|
return ff_compiler_Syntax.Constraint(ff_compiler_Token.Token_at(token_), (namespace_ + ff_compiler_Token.Token_raw(token_)), arguments_)
|
|
1406
1404
|
}
|
|
1407
1405
|
|
|
1408
1406
|
export function Parser_parseStatements(self_) {
|
|
1409
1407
|
if(ff_compiler_Token.Token_is2(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight(), ff_compiler_Token.LPipe())) {
|
|
1410
|
-
return ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Unit",
|
|
1408
|
+
return ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Unit", [], ff_core_Option.None())
|
|
1411
1409
|
} else {
|
|
1412
1410
|
let result_ = ff_compiler_Parser.Parser_parseStatement(self_);
|
|
1413
1411
|
while(ff_compiler_Parser.Parser_currentIsSeparator(self_, ff_compiler_Token.LSemicolon())) {
|
|
@@ -1490,7 +1488,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
|
1490
1488
|
return ff_compiler_Parser.Parser_parseType(self_)
|
|
1491
1489
|
})());
|
|
1492
1490
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssign())))) {
|
|
1493
|
-
const unit_ = ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit",
|
|
1491
|
+
const unit_ = ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit", [], ff_core_Option.None());
|
|
1494
1492
|
return ff_compiler_Syntax.ELet(ff_compiler_Token.Token_at(nameToken_), mutable_, ff_compiler_Token.Token_raw(nameToken_), valueType_, unit_, unit_)
|
|
1495
1493
|
} else {
|
|
1496
1494
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
@@ -1506,14 +1504,14 @@ const body_ = (ff_compiler_Parser.Parser_currentIsSeparator(self_, ff_compiler_T
|
|
|
1506
1504
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon());
|
|
1507
1505
|
return ff_compiler_Parser.Parser_parseStatements(self_)
|
|
1508
1506
|
})()
|
|
1509
|
-
: ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit",
|
|
1507
|
+
: ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit", [], ff_core_Option.None()));
|
|
1510
1508
|
return ff_compiler_Syntax.ELet(ff_compiler_Token.Token_at(nameToken_), mutable_, ff_compiler_Token.Token_raw(nameToken_), valueType_, value_, body_)
|
|
1511
1509
|
}
|
|
1512
1510
|
}
|
|
1513
1511
|
|
|
1514
1512
|
export function Parser_parseFunctions(self_) {
|
|
1515
1513
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
1516
|
-
const functions_ =
|
|
1514
|
+
const functions_ = ff_core_Array.make_();
|
|
1517
1515
|
while(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "function")) {
|
|
1518
1516
|
if(self_.lspHook_.trackSymbols_) {
|
|
1519
1517
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolBegin())
|
|
@@ -1522,11 +1520,11 @@ const functionAt_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip
|
|
|
1522
1520
|
const signature_ = ff_compiler_Parser.Parser_parseSignature(self_, false);
|
|
1523
1521
|
const body_ = ((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))
|
|
1524
1522
|
? (function() {
|
|
1525
|
-
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(functionAt_, "TemporaryEffect$",
|
|
1526
|
-
return ff_compiler_Syntax.Lambda(functionAt_, temporaryEffect_,
|
|
1523
|
+
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(functionAt_, "TemporaryEffect$", []);
|
|
1524
|
+
return ff_compiler_Syntax.Lambda(functionAt_, temporaryEffect_, [])
|
|
1527
1525
|
})()
|
|
1528
1526
|
: ff_compiler_Parser.Parser_parseLambda(self_, ff_core_List.List_size(signature_.parameters_), false, false));
|
|
1529
|
-
|
|
1527
|
+
ff_core_Array.Array_push(functions_, ff_compiler_Syntax.DFunction(signature_.at_, signature_, ff_compiler_Syntax.FireflyTarget(body_)));
|
|
1530
1528
|
if(self_.lspHook_.trackSymbols_) {
|
|
1531
1529
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(signature_.name_, 12, signature_.at_, (((_c) => {
|
|
1532
1530
|
return ff_compiler_Syntax.Location(_c.file_, _c.line_, (signature_.at_.column_ + ff_core_String.String_size(signature_.name_)))
|
|
@@ -1539,7 +1537,7 @@ ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
|
1539
1537
|
}
|
|
1540
1538
|
};
|
|
1541
1539
|
const body_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
1542
|
-
return ff_compiler_Syntax.EFunctions(at_,
|
|
1540
|
+
return ff_compiler_Syntax.EFunctions(at_, ff_core_Array.Array_toList(functions_, 0, 9007199254740991), body_)
|
|
1543
1541
|
}
|
|
1544
1542
|
|
|
1545
1543
|
export function Parser_parseTerm(self_) {
|
|
@@ -1547,10 +1545,10 @@ return ff_compiler_Parser.Parser_parseBinary(self_, 0)
|
|
|
1547
1545
|
}
|
|
1548
1546
|
|
|
1549
1547
|
export function Parser_parseBinary(self_, level_) {
|
|
1550
|
-
if((level_ >=
|
|
1548
|
+
if((level_ >= ff_core_List.List_size(ff_compiler_Parser.binaryOperators_))) {
|
|
1551
1549
|
return ff_compiler_Parser.Parser_parseUnary(self_)
|
|
1552
1550
|
} else {
|
|
1553
|
-
const operators_ =
|
|
1551
|
+
const operators_ = ff_core_List.List_grab(ff_compiler_Parser.binaryOperators_, level_);
|
|
1554
1552
|
let result_ = ff_compiler_Parser.Parser_parseBinary(self_, (level_ + 1));
|
|
1555
1553
|
if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LOperator())) {
|
|
1556
1554
|
while(ff_core_List.List_any(operators_, ((value_) => {
|
|
@@ -1558,41 +1556,41 @@ return ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), v
|
|
|
1558
1556
|
}))) {
|
|
1559
1557
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LOperator());
|
|
1560
1558
|
const right_ = ff_compiler_Parser.Parser_parseBinary(self_, (level_ + 1));
|
|
1561
|
-
const arguments_ =
|
|
1559
|
+
const arguments_ = [ff_compiler_Syntax.Argument(result_.at_, ff_core_Option.None(), result_), ff_compiler_Syntax.Argument(right_.at_, ff_core_Option.None(), right_)];
|
|
1562
1560
|
const effect_ = ff_compiler_Parser.Parser_freshUnificationVariable(self_, ff_compiler_Token.Token_at(token_));
|
|
1563
1561
|
const target_ = (((_1) => {
|
|
1564
1562
|
{
|
|
1565
|
-
if(_1
|
|
1563
|
+
if(_1 === "==") {
|
|
1566
1564
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Equal.equals"), false)
|
|
1567
1565
|
return
|
|
1568
1566
|
}
|
|
1569
1567
|
}
|
|
1570
1568
|
{
|
|
1571
|
-
if(_1
|
|
1569
|
+
if(_1 === "!=") {
|
|
1572
1570
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Equal.notEquals"), false)
|
|
1573
1571
|
return
|
|
1574
1572
|
}
|
|
1575
1573
|
}
|
|
1576
1574
|
{
|
|
1577
|
-
if(_1
|
|
1575
|
+
if(_1 === "<") {
|
|
1578
1576
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Ordering.before"), false)
|
|
1579
1577
|
return
|
|
1580
1578
|
}
|
|
1581
1579
|
}
|
|
1582
1580
|
{
|
|
1583
|
-
if(_1
|
|
1581
|
+
if(_1 === "<=") {
|
|
1584
1582
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Ordering.notAfter"), false)
|
|
1585
1583
|
return
|
|
1586
1584
|
}
|
|
1587
1585
|
}
|
|
1588
1586
|
{
|
|
1589
|
-
if(_1
|
|
1587
|
+
if(_1 === ">") {
|
|
1590
1588
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Ordering.after"), false)
|
|
1591
1589
|
return
|
|
1592
1590
|
}
|
|
1593
1591
|
}
|
|
1594
1592
|
{
|
|
1595
|
-
if(_1
|
|
1593
|
+
if(_1 === ">=") {
|
|
1596
1594
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Ordering.notBefore"), false)
|
|
1597
1595
|
return
|
|
1598
1596
|
}
|
|
@@ -1603,7 +1601,7 @@ return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_T
|
|
|
1603
1601
|
return
|
|
1604
1602
|
}
|
|
1605
1603
|
}))(ff_compiler_Token.Token_raw(token_));
|
|
1606
|
-
result_ = ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_,
|
|
1604
|
+
result_ = ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_, [], arguments_, [])
|
|
1607
1605
|
}
|
|
1608
1606
|
};
|
|
1609
1607
|
return result_
|
|
@@ -1616,7 +1614,7 @@ const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LOperator
|
|
|
1616
1614
|
const term_ = ff_compiler_Parser.Parser_parseUnary(self_);
|
|
1617
1615
|
const effect_ = ff_compiler_Parser.Parser_freshUnificationVariable(self_, ff_compiler_Token.Token_at(token_));
|
|
1618
1616
|
const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_)), false);
|
|
1619
|
-
return ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_,
|
|
1617
|
+
return ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_, [], [ff_compiler_Syntax.Argument(term_.at_, ff_core_Option.None(), term_)], [])
|
|
1620
1618
|
} else {
|
|
1621
1619
|
return ff_compiler_Parser.Parser_parseFieldsAndCalls(self_)
|
|
1622
1620
|
}
|
|
@@ -1646,12 +1644,12 @@ result_ = ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false, r
|
|
|
1646
1644
|
} else {
|
|
1647
1645
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
1648
1646
|
const typeArguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
1649
|
-
?
|
|
1647
|
+
? []
|
|
1650
1648
|
: ff_compiler_Parser.Parser_parseTypeArguments(self_, false));
|
|
1651
1649
|
const arguments_ = ff_compiler_Parser.Parser_parseFunctionArguments(self_, result_.at_, true);
|
|
1652
1650
|
const effect_ = ff_compiler_Parser.Parser_freshUnificationVariable(self_, at_);
|
|
1653
1651
|
const target_ = ff_compiler_Syntax.DynamicCall(result_, tailCall_);
|
|
1654
|
-
result_ = ff_compiler_Syntax.ECall(result_.at_, target_, effect_, typeArguments_, arguments_.first_,
|
|
1652
|
+
result_ = ff_compiler_Syntax.ECall(result_.at_, target_, effect_, typeArguments_, arguments_.first_, []);
|
|
1655
1653
|
if((arguments_.second_ && ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower()))) {
|
|
1656
1654
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
1657
1655
|
result_ = ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false, result_, ff_compiler_Token.Token_raw(token_))
|
|
@@ -1723,7 +1721,7 @@ export function Parser_parseVariant(self_, prefix_) {
|
|
|
1723
1721
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
1724
1722
|
const name_ = (prefix_ + ff_compiler_Token.Token_raw(token_));
|
|
1725
1723
|
const typeArguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
1726
|
-
?
|
|
1724
|
+
? []
|
|
1727
1725
|
: ff_compiler_Parser.Parser_parseTypeArguments(self_, false));
|
|
1728
1726
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "?")) {
|
|
1729
1727
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LOperator());
|
|
@@ -1747,13 +1745,13 @@ const prefix_ = (namespace_ + extraNamespace_);
|
|
|
1747
1745
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
1748
1746
|
const name_ = (prefix_ + ff_compiler_Token.Token_raw(token_));
|
|
1749
1747
|
const fields_ = ((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")))
|
|
1750
|
-
?
|
|
1748
|
+
? []
|
|
1751
1749
|
: ff_compiler_Parser.Parser_parseRecord(self_, ff_core_Option.Some(ff_compiler_Token.Token_at(token_))));
|
|
1752
1750
|
return ff_compiler_Syntax.ECopy(ff_compiler_Token.Token_at(token_), name_, record_, fields_)
|
|
1753
1751
|
}
|
|
1754
1752
|
|
|
1755
1753
|
export function Parser_parseRecord(self_, copyAt_) {
|
|
1756
|
-
const fields_ =
|
|
1754
|
+
const fields_ = ff_core_Array.make_();
|
|
1757
1755
|
const startBracketAt_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "("));
|
|
1758
1756
|
const startAt_ = ff_core_Option.Option_else(copyAt_, (() => {
|
|
1759
1757
|
return startBracketAt_
|
|
@@ -1768,57 +1766,57 @@ return ff_compiler_Syntax.Field(ff_compiler_Token.Token_at(fieldToken_), ff_comp
|
|
|
1768
1766
|
: ff_compiler_Syntax.Field(ff_compiler_Token.Token_at(fieldToken_), ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(fieldToken_), ff_compiler_Token.Token_raw(fieldToken_))));
|
|
1769
1767
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
1770
1768
|
if(ff_compiler_LspHook.strictlyBetween_(startAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
1771
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(startAt_,
|
|
1769
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(startAt_, ff_core_Array.Array_size(fields_), ff_core_Option.Option_filter(ff_core_Option.Some(field_.name_), ((_w1) => {
|
|
1772
1770
|
return (_w1 !== "")
|
|
1773
1771
|
}))));
|
|
1774
1772
|
self_.lspEmittedArgumentHook_ = true
|
|
1775
1773
|
}
|
|
1776
1774
|
};
|
|
1777
|
-
|
|
1775
|
+
ff_core_Array.Array_push(fields_, field_);
|
|
1778
1776
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1779
1777
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
1780
1778
|
}
|
|
1781
1779
|
};
|
|
1782
1780
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
1783
1781
|
if(ff_compiler_LspHook.strictlyBetween_(startAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
1784
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(startAt_,
|
|
1782
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(startAt_, ff_core_Array.Array_size(fields_), ff_core_Option.None()));
|
|
1785
1783
|
self_.lspEmittedArgumentHook_ = true
|
|
1786
1784
|
}
|
|
1787
1785
|
};
|
|
1788
1786
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
1789
|
-
return
|
|
1787
|
+
return ff_core_Array.Array_toList(fields_, 0, 9007199254740991)
|
|
1790
1788
|
}
|
|
1791
1789
|
|
|
1792
1790
|
export function Parser_parseRecordType(self_) {
|
|
1793
|
-
const fields_ =
|
|
1791
|
+
const fields_ = ff_core_Array.make_();
|
|
1794
1792
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
1795
1793
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1796
1794
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
1797
1795
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LColon());
|
|
1798
|
-
|
|
1796
|
+
ff_core_Array.Array_push(fields_, ff_core_Pair.Pair(ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Parser.Parser_parseType(self_)));
|
|
1799
1797
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1800
1798
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
1801
1799
|
}
|
|
1802
1800
|
};
|
|
1803
1801
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
1804
|
-
return ff_core_List.List_sortBy(
|
|
1802
|
+
return ff_core_List.List_sortBy(ff_core_Array.Array_toList(fields_, 0, 9007199254740991), ((_w1) => {
|
|
1805
1803
|
return _w1.first_
|
|
1806
1804
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
1807
1805
|
}
|
|
1808
1806
|
|
|
1809
1807
|
export function Parser_parseRecordPattern(self_) {
|
|
1810
|
-
const fields_ =
|
|
1808
|
+
const fields_ = ff_core_Array.make_();
|
|
1811
1809
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
1812
1810
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1813
1811
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
1814
1812
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
1815
|
-
|
|
1813
|
+
ff_core_Array.Array_push(fields_, ff_core_Pair.Pair(ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Parser.Parser_parsePattern(self_)));
|
|
1816
1814
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1817
1815
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
1818
1816
|
}
|
|
1819
1817
|
};
|
|
1820
1818
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
1821
|
-
return ff_core_List.List_sortBy(
|
|
1819
|
+
return ff_core_List.List_sortBy(ff_core_Array.Array_toList(fields_, 0, 9007199254740991), ((_w1) => {
|
|
1822
1820
|
return _w1.first_
|
|
1823
1821
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
1824
1822
|
}
|
|
@@ -1829,26 +1827,26 @@ function convertListPattern_(at_, items_) {
|
|
|
1829
1827
|
const at_a = at_;
|
|
1830
1828
|
const items_a = items_;
|
|
1831
1829
|
{
|
|
1832
|
-
if(items_a.
|
|
1833
|
-
return ff_compiler_Syntax.PVariant(at_, "
|
|
1830
|
+
if(items_a.length === 0) {
|
|
1831
|
+
return ff_compiler_Syntax.PVariant(at_, "List$Empty", [])
|
|
1834
1832
|
return
|
|
1835
1833
|
}
|
|
1836
1834
|
}
|
|
1837
1835
|
{
|
|
1838
|
-
if(items_a.
|
|
1839
|
-
const p_ = items_a.
|
|
1840
|
-
if(!items_a.
|
|
1841
|
-
const ps_ = items_a.
|
|
1842
|
-
return ff_compiler_Syntax.PVariant(at_, "
|
|
1836
|
+
if(items_a.length > 0) {
|
|
1837
|
+
const p_ = items_a[0].first_;
|
|
1838
|
+
if(!items_a[0].second_) {
|
|
1839
|
+
const ps_ = items_a.slice(1);
|
|
1840
|
+
return ff_compiler_Syntax.PVariant(at_, "List$Link", [p_, convertListPattern_(at_, ps_)])
|
|
1843
1841
|
return
|
|
1844
1842
|
}
|
|
1845
1843
|
}
|
|
1846
1844
|
}
|
|
1847
1845
|
{
|
|
1848
|
-
if(items_a.
|
|
1849
|
-
const p_ = items_a.
|
|
1850
|
-
if(items_a.
|
|
1851
|
-
if(items_a.
|
|
1846
|
+
if(items_a.length > 0) {
|
|
1847
|
+
const p_ = items_a[0].first_;
|
|
1848
|
+
if(items_a[0].second_) {
|
|
1849
|
+
if(items_a.length === 1) {
|
|
1852
1850
|
return p_
|
|
1853
1851
|
return
|
|
1854
1852
|
}
|
|
@@ -1856,9 +1854,9 @@ return
|
|
|
1856
1854
|
}
|
|
1857
1855
|
}
|
|
1858
1856
|
{
|
|
1859
|
-
if(items_a.
|
|
1860
|
-
const p_ = items_a.
|
|
1861
|
-
if(items_a.
|
|
1857
|
+
if(items_a.length > 0) {
|
|
1858
|
+
const p_ = items_a[0].first_;
|
|
1859
|
+
if(items_a[0].second_) {
|
|
1862
1860
|
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)})
|
|
1863
1861
|
return
|
|
1864
1862
|
}
|
|
@@ -1866,7 +1864,7 @@ return
|
|
|
1866
1864
|
}
|
|
1867
1865
|
}
|
|
1868
1866
|
}
|
|
1869
|
-
const items_ =
|
|
1867
|
+
const items_ = ff_core_Array.make_();
|
|
1870
1868
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "["));
|
|
1871
1869
|
while((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
1872
1870
|
const spread_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDotDotDot());
|
|
@@ -1876,30 +1874,30 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDotDotDot())
|
|
|
1876
1874
|
const pattern_ = ((spread_ && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))
|
|
1877
1875
|
? ff_compiler_Syntax.PVariable(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), ff_core_Option.None())
|
|
1878
1876
|
: ff_compiler_Parser.Parser_parsePattern(self_));
|
|
1879
|
-
|
|
1877
|
+
ff_core_Array.Array_push(items_, ff_core_Pair.Pair(pattern_, spread_));
|
|
1880
1878
|
if((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
1881
1879
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
1882
1880
|
}
|
|
1883
1881
|
};
|
|
1884
1882
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "]");
|
|
1885
|
-
return convertListPattern_(at_,
|
|
1883
|
+
return convertListPattern_(at_, ff_core_Array.Array_toList(items_, 0, 9007199254740991))
|
|
1886
1884
|
}
|
|
1887
1885
|
|
|
1888
1886
|
export function Parser_parseList(self_) {
|
|
1889
|
-
const items_ =
|
|
1887
|
+
const items_ = ff_core_Array.make_();
|
|
1890
1888
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "["));
|
|
1891
1889
|
while((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
1892
1890
|
const spread_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDotDotDot());
|
|
1893
1891
|
if(spread_) {
|
|
1894
1892
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDotDotDot())
|
|
1895
1893
|
};
|
|
1896
|
-
|
|
1894
|
+
ff_core_Array.Array_push(items_, ff_core_Pair.Pair(ff_compiler_Parser.Parser_parseTerm(self_), spread_));
|
|
1897
1895
|
if((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
1898
1896
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
1899
1897
|
}
|
|
1900
1898
|
};
|
|
1901
1899
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "]");
|
|
1902
|
-
return ff_compiler_Syntax.EList(at_, ff_compiler_Parser.Parser_freshUnificationVariable(self_, at_),
|
|
1900
|
+
return ff_compiler_Syntax.EList(at_, ff_compiler_Parser.Parser_freshUnificationVariable(self_, at_), ff_core_Array.Array_toList(items_, 0, 9007199254740991))
|
|
1903
1901
|
}
|
|
1904
1902
|
|
|
1905
1903
|
export async function Parser_fail$(self_, at_, message_, $task) {
|
|
@@ -1910,8 +1908,8 @@ export async function Parser_behind$(self_, $task) {
|
|
|
1910
1908
|
if((self_.offset_ === 0)) {
|
|
1911
1909
|
return ff_compiler_Parser.Parser_current(self_)
|
|
1912
1910
|
} else {
|
|
1913
|
-
if(((self_.offset_ - 1) <
|
|
1914
|
-
return
|
|
1911
|
+
if(((self_.offset_ - 1) < ff_core_List.List_size(self_.tokens_))) {
|
|
1912
|
+
return ff_core_List.List_grab(self_.tokens_, (self_.offset_ - 1))
|
|
1915
1913
|
} else {
|
|
1916
1914
|
return self_.end_
|
|
1917
1915
|
}
|
|
@@ -1919,24 +1917,24 @@ return self_.end_
|
|
|
1919
1917
|
}
|
|
1920
1918
|
|
|
1921
1919
|
export async function Parser_current$(self_, $task) {
|
|
1922
|
-
if((self_.offset_ <
|
|
1923
|
-
return
|
|
1920
|
+
if((self_.offset_ < ff_core_List.List_size(self_.tokens_))) {
|
|
1921
|
+
return ff_core_List.List_grab(self_.tokens_, self_.offset_)
|
|
1924
1922
|
} else {
|
|
1925
1923
|
return self_.end_
|
|
1926
1924
|
}
|
|
1927
1925
|
}
|
|
1928
1926
|
|
|
1929
1927
|
export async function Parser_ahead$(self_, $task) {
|
|
1930
|
-
if(((self_.offset_ + 1) <
|
|
1931
|
-
return
|
|
1928
|
+
if(((self_.offset_ + 1) < ff_core_List.List_size(self_.tokens_))) {
|
|
1929
|
+
return ff_core_List.List_grab(self_.tokens_, (self_.offset_ + 1))
|
|
1932
1930
|
} else {
|
|
1933
1931
|
return self_.end_
|
|
1934
1932
|
}
|
|
1935
1933
|
}
|
|
1936
1934
|
|
|
1937
1935
|
export async function Parser_aheadAhead$(self_, $task) {
|
|
1938
|
-
if(((self_.offset_ + 2) <
|
|
1939
|
-
return
|
|
1936
|
+
if(((self_.offset_ + 2) < ff_core_List.List_size(self_.tokens_))) {
|
|
1937
|
+
return ff_core_List.List_grab(self_.tokens_, (self_.offset_ + 2))
|
|
1940
1938
|
} else {
|
|
1941
1939
|
return self_.end_
|
|
1942
1940
|
}
|
|
@@ -2023,46 +2021,46 @@ return p_
|
|
|
2023
2021
|
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"))) {
|
|
2024
2022
|
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)})
|
|
2025
2023
|
};
|
|
2026
|
-
const dependencies_ =
|
|
2024
|
+
const dependencies_ = ff_core_Array.make_();
|
|
2027
2025
|
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"))) {
|
|
2028
|
-
|
|
2026
|
+
ff_core_Array.Array_push(dependencies_, ff_compiler_Parser.Parser_parseDependencyDefinition(self_, package_.targets_));
|
|
2029
2027
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
2030
2028
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
2031
2029
|
}
|
|
2032
2030
|
};
|
|
2033
|
-
const includes_ =
|
|
2031
|
+
const includes_ = ff_core_Array.make_();
|
|
2034
2032
|
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"))) {
|
|
2035
|
-
|
|
2033
|
+
ff_core_Array.Array_push(includes_, ff_compiler_Parser.Parser_parseIncludeDefinition(self_));
|
|
2036
2034
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
2037
2035
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
2038
2036
|
}
|
|
2039
2037
|
};
|
|
2040
|
-
return ff_compiler_Syntax.PackageInfo(package_,
|
|
2038
|
+
return ff_compiler_Syntax.PackageInfo(package_, ff_core_Array.Array_toList(dependencies_, 0, 9007199254740991), ff_core_Array.Array_toList(includes_, 0, 9007199254740991))
|
|
2041
2039
|
}
|
|
2042
2040
|
|
|
2043
2041
|
export async function Parser_parseModule$(self_, $task) {
|
|
2044
|
-
const imports_ =
|
|
2045
|
-
const types_ =
|
|
2046
|
-
const traits_ =
|
|
2047
|
-
const instances_ =
|
|
2048
|
-
const extends_ =
|
|
2049
|
-
const lets_ =
|
|
2050
|
-
const functions_ =
|
|
2042
|
+
const imports_ = ff_core_Array.make_();
|
|
2043
|
+
const types_ = ff_core_Array.make_();
|
|
2044
|
+
const traits_ = ff_core_Array.make_();
|
|
2045
|
+
const instances_ = ff_core_Array.make_();
|
|
2046
|
+
const extends_ = ff_core_Array.make_();
|
|
2047
|
+
const lets_ = ff_core_Array.make_();
|
|
2048
|
+
const functions_ = ff_core_Array.make_();
|
|
2051
2049
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LEnd()))) {
|
|
2052
2050
|
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())))) {
|
|
2053
|
-
|
|
2051
|
+
ff_core_Array.Array_push(lets_, ff_compiler_Parser.Parser_parseLetDefinition(self_))
|
|
2054
2052
|
} else if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower())) {
|
|
2055
|
-
|
|
2053
|
+
ff_core_Array.Array_push(functions_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, false))
|
|
2056
2054
|
} else 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_), "extend"))) {
|
|
2057
|
-
|
|
2055
|
+
ff_core_Array.Array_push(extends_, ff_compiler_Parser.Parser_parseExtendDefinition(self_))
|
|
2058
2056
|
} else 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_), "trait"))) {
|
|
2059
|
-
|
|
2057
|
+
ff_core_Array.Array_push(traits_, ff_compiler_Parser.Parser_parseTraitDefinition(self_))
|
|
2060
2058
|
} else 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_), "instance"))) {
|
|
2061
|
-
|
|
2059
|
+
ff_core_Array.Array_push(instances_, ff_compiler_Parser.Parser_parseInstanceDefinition(self_))
|
|
2062
2060
|
} else if((ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs4(ff_compiler_Parser.Parser_current(self_), "data", "class", "capability", "newtype"))) {
|
|
2063
|
-
|
|
2061
|
+
ff_core_Array.Array_push(types_, ff_compiler_Parser.Parser_parseTypeDefinition(self_))
|
|
2064
2062
|
} else 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_), "import"))) {
|
|
2065
|
-
|
|
2063
|
+
ff_core_Array.Array_push(imports_, ff_compiler_Parser.Parser_parseImportDefinition(self_, self_.packagePair_))
|
|
2066
2064
|
} else 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_), "include"))) {
|
|
2067
2065
|
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_)), "Includes must be at the top of the file or below 'package'"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2068
2066
|
} else 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_), "dependency"))) {
|
|
@@ -2076,7 +2074,7 @@ if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_com
|
|
|
2076
2074
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
2077
2075
|
}
|
|
2078
2076
|
};
|
|
2079
|
-
return ff_compiler_Syntax.Module(self_.file_, self_.packagePair_,
|
|
2077
|
+
return ff_compiler_Syntax.Module(self_.file_, self_.packagePair_, ff_core_Array.Array_toList(imports_, 0, 9007199254740991), ff_core_Array.Array_toList(types_, 0, 9007199254740991), ff_core_Array.Array_toList(traits_, 0, 9007199254740991), ff_core_Array.Array_toList(instances_, 0, 9007199254740991), ff_core_Array.Array_toList(extends_, 0, 9007199254740991), ff_core_Array.Array_toList(lets_, 0, 9007199254740991), ff_core_Array.Array_toList(functions_, 0, 9007199254740991))
|
|
2080
2078
|
}
|
|
2081
2079
|
|
|
2082
2080
|
export async function Parser_parseLetDefinition$(self_, $task) {
|
|
@@ -2140,7 +2138,7 @@ const lambda_ = ff_compiler_Parser.Parser_parseLambda(self_, parameterCount_, fa
|
|
|
2140
2138
|
do {
|
|
2141
2139
|
const _1 = target_;
|
|
2142
2140
|
{
|
|
2143
|
-
if(_1
|
|
2141
|
+
if(_1 === "js") {
|
|
2144
2142
|
if(ff_core_Equal.notEquals_(targets_.jsSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
2145
2143
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2146
2144
|
};
|
|
@@ -2151,7 +2149,7 @@ break
|
|
|
2151
2149
|
}
|
|
2152
2150
|
}
|
|
2153
2151
|
{
|
|
2154
|
-
if(_1
|
|
2152
|
+
if(_1 === "browser") {
|
|
2155
2153
|
if(ff_core_Equal.notEquals_(targets_.browserSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
2156
2154
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2157
2155
|
};
|
|
@@ -2162,7 +2160,7 @@ break
|
|
|
2162
2160
|
}
|
|
2163
2161
|
}
|
|
2164
2162
|
{
|
|
2165
|
-
if(_1
|
|
2163
|
+
if(_1 === "node") {
|
|
2166
2164
|
if(ff_core_Equal.notEquals_(targets_.nodeAsync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
2167
2165
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2168
2166
|
};
|
|
@@ -2183,8 +2181,8 @@ const code_ = processCode_(ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser
|
|
|
2183
2181
|
do {
|
|
2184
2182
|
const _1 = ff_core_Pair.Pair(target_, mode_);
|
|
2185
2183
|
{
|
|
2186
|
-
if(_1.first_
|
|
2187
|
-
if(_1.second_
|
|
2184
|
+
if(_1.first_ === "js") {
|
|
2185
|
+
if(_1.second_ === "sync") {
|
|
2188
2186
|
if(ff_core_Equal.notEquals_(targets_.jsSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
2189
2187
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2190
2188
|
};
|
|
@@ -2196,8 +2194,8 @@ break
|
|
|
2196
2194
|
}
|
|
2197
2195
|
}
|
|
2198
2196
|
{
|
|
2199
|
-
if(_1.first_
|
|
2200
|
-
if(_1.second_
|
|
2197
|
+
if(_1.first_ === "js") {
|
|
2198
|
+
if(_1.second_ === "async") {
|
|
2201
2199
|
if(ff_core_Equal.notEquals_(targets_.jsAsync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
2202
2200
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2203
2201
|
};
|
|
@@ -2209,8 +2207,8 @@ break
|
|
|
2209
2207
|
}
|
|
2210
2208
|
}
|
|
2211
2209
|
{
|
|
2212
|
-
if(_1.first_
|
|
2213
|
-
if(_1.second_
|
|
2210
|
+
if(_1.first_ === "browser") {
|
|
2211
|
+
if(_1.second_ === "sync") {
|
|
2214
2212
|
if(ff_core_Equal.notEquals_(targets_.browserSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
2215
2213
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2216
2214
|
};
|
|
@@ -2222,8 +2220,8 @@ break
|
|
|
2222
2220
|
}
|
|
2223
2221
|
}
|
|
2224
2222
|
{
|
|
2225
|
-
if(_1.first_
|
|
2226
|
-
if(_1.second_
|
|
2223
|
+
if(_1.first_ === "browser") {
|
|
2224
|
+
if(_1.second_ === "async") {
|
|
2227
2225
|
if(ff_core_Equal.notEquals_(targets_.browserAsync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
2228
2226
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2229
2227
|
};
|
|
@@ -2235,8 +2233,8 @@ break
|
|
|
2235
2233
|
}
|
|
2236
2234
|
}
|
|
2237
2235
|
{
|
|
2238
|
-
if(_1.first_
|
|
2239
|
-
if(_1.second_
|
|
2236
|
+
if(_1.first_ === "node") {
|
|
2237
|
+
if(_1.second_ === "sync") {
|
|
2240
2238
|
if(ff_core_Equal.notEquals_(targets_.nodeSync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
2241
2239
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2242
2240
|
};
|
|
@@ -2248,8 +2246,8 @@ break
|
|
|
2248
2246
|
}
|
|
2249
2247
|
}
|
|
2250
2248
|
{
|
|
2251
|
-
if(_1.first_
|
|
2252
|
-
if(_1.second_
|
|
2249
|
+
if(_1.first_ === "node") {
|
|
2250
|
+
if(_1.second_ === "async") {
|
|
2253
2251
|
if(ff_core_Equal.notEquals_(targets_.nodeAsync_, ff_core_Option.None(), ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String))) {
|
|
2254
2252
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Duplicate target definition"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2255
2253
|
};
|
|
@@ -2274,17 +2272,17 @@ export async function Parser_parseSignature$(self_, member_, $task) {
|
|
|
2274
2272
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
2275
2273
|
const poly_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "[")
|
|
2276
2274
|
? ff_compiler_Parser.Parser_parseTypeParameters(self_)
|
|
2277
|
-
: ff_compiler_Parser.Poly(
|
|
2275
|
+
: ff_compiler_Parser.Poly([], []));
|
|
2278
2276
|
const parameters_ = ((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")))
|
|
2279
|
-
?
|
|
2277
|
+
? []
|
|
2280
2278
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, false));
|
|
2281
2279
|
const returnType_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())
|
|
2282
2280
|
? (await (async function() {
|
|
2283
2281
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
2284
2282
|
return ff_compiler_Parser.Parser_parseType(self_)
|
|
2285
2283
|
})())
|
|
2286
|
-
: ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "ff:core/Unit.Unit",
|
|
2287
|
-
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(nameToken_), "TemporaryEffect$",
|
|
2284
|
+
: ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "ff:core/Unit.Unit", []));
|
|
2285
|
+
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(nameToken_), "TemporaryEffect$", []);
|
|
2288
2286
|
return ff_compiler_Syntax.Signature(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), member_, poly_.generics_, poly_.constraints_, parameters_, returnType_, temporaryEffect_)
|
|
2289
2287
|
}
|
|
2290
2288
|
|
|
@@ -2296,20 +2294,20 @@ const extendToken_ = ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.
|
|
|
2296
2294
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
2297
2295
|
const poly_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "[")
|
|
2298
2296
|
? ff_compiler_Parser.Parser_parseTypeParameters(self_)
|
|
2299
|
-
: ff_compiler_Parser.Poly(
|
|
2297
|
+
: ff_compiler_Parser.Poly([], []));
|
|
2300
2298
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
2301
2299
|
const type_ = ff_compiler_Parser.Parser_parseType(self_);
|
|
2302
2300
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
2303
|
-
const methods_ =
|
|
2301
|
+
const methods_ = ff_core_Array.make_();
|
|
2304
2302
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2305
|
-
|
|
2303
|
+
ff_core_Array.Array_push(methods_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, true));
|
|
2306
2304
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2307
2305
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
2308
2306
|
}
|
|
2309
2307
|
};
|
|
2310
2308
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}");
|
|
2311
2309
|
if(self_.lspHook_.trackSymbols_) {
|
|
2312
|
-
let name_ = ff_compiler_Syntax.Type_show(type_,
|
|
2310
|
+
let name_ = ff_compiler_Syntax.Type_show(type_, []);
|
|
2313
2311
|
ff_core_List.List_each(ff_core_List.List_zip(poly_.generics_, poly_.constraints_), ((_1) => {
|
|
2314
2312
|
{
|
|
2315
2313
|
const generic_ = _1.first_;
|
|
@@ -2323,7 +2321,7 @@ return
|
|
|
2323
2321
|
}));
|
|
2324
2322
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(name_, 3, ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(extendToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
2325
2323
|
};
|
|
2326
|
-
return ff_compiler_Syntax.DExtend(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), poly_.generics_, poly_.constraints_, type_,
|
|
2324
|
+
return ff_compiler_Syntax.DExtend(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), poly_.generics_, poly_.constraints_, type_, ff_core_Array.Array_toList(methods_, 0, 9007199254740991))
|
|
2327
2325
|
}
|
|
2328
2326
|
|
|
2329
2327
|
export async function Parser_parseTraitDefinition$(self_, $task) {
|
|
@@ -2335,26 +2333,26 @@ const typeParameterToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_To
|
|
|
2335
2333
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
2336
2334
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
2337
2335
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
2338
|
-
? ff_compiler_Parser.Poly(
|
|
2336
|
+
? ff_compiler_Parser.Poly([], [])
|
|
2339
2337
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
2340
|
-
const constraints_ =
|
|
2338
|
+
const constraints_ = ff_core_Array.make_();
|
|
2341
2339
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())) {
|
|
2342
2340
|
ff_compiler_Parser.Parser_fail(self_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Trait constraints is not yet implemented");
|
|
2343
2341
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
2344
2342
|
const constraint_ = ff_compiler_Parser.Parser_parseConstraint(self_);
|
|
2345
|
-
|
|
2346
|
-
return ff_compiler_Syntax.Constraint(_c.at_, _c.name_,
|
|
2343
|
+
ff_core_Array.Array_push(constraints_, (((_c) => {
|
|
2344
|
+
return ff_compiler_Syntax.Constraint(_c.at_, _c.name_, [ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(typeParameterToken_), ff_compiler_Token.Token_raw(typeParameterToken_), []), ...constraint_.generics_])
|
|
2347
2345
|
}))(constraint_))
|
|
2348
2346
|
};
|
|
2349
2347
|
const generatorParameters_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "("))
|
|
2350
|
-
?
|
|
2348
|
+
? []
|
|
2351
2349
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, false));
|
|
2352
|
-
const methodGenerators_ =
|
|
2353
|
-
const methodDefaults_ =
|
|
2350
|
+
const methodGenerators_ = ff_core_Array.make_();
|
|
2351
|
+
const methodDefaults_ = ff_core_Array.make_();
|
|
2354
2352
|
const methodSignatures_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{"))
|
|
2355
|
-
?
|
|
2353
|
+
? []
|
|
2356
2354
|
: (await (async function() {
|
|
2357
|
-
const signatures_ =
|
|
2355
|
+
const signatures_ = ff_core_Array.make_();
|
|
2358
2356
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
2359
2357
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2360
2358
|
if(self_.lspHook_.trackSymbols_) {
|
|
@@ -2365,14 +2363,14 @@ const signature_ = ff_compiler_Parser.Parser_parseSignature(self_, true);
|
|
|
2365
2363
|
if(self_.lspHook_.trackSymbols_) {
|
|
2366
2364
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(signatureNameToken_), 12, ff_compiler_Token.Token_at(signatureNameToken_), ff_compiler_Token.Token_end(signatureNameToken_), ff_compiler_Token.Token_at(signatureNameToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
2367
2365
|
};
|
|
2368
|
-
|
|
2366
|
+
ff_core_Array.Array_push(signatures_, signature_);
|
|
2369
2367
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")) {
|
|
2370
2368
|
const generator_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LKeyword()) && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_ahead(self_), "generate"));
|
|
2371
2369
|
const body_ = ff_compiler_Parser.Parser_parseLambda(self_, ff_core_List.List_size(signature_.parameters_), true, false);
|
|
2372
2370
|
if(generator_) {
|
|
2373
|
-
|
|
2371
|
+
ff_core_Array.Array_push(methodGenerators_, ff_core_Pair.Pair(signature_.name_, body_))
|
|
2374
2372
|
} else {
|
|
2375
|
-
|
|
2373
|
+
ff_core_Array.Array_push(methodDefaults_, ff_core_Pair.Pair(signature_.name_, body_))
|
|
2376
2374
|
}
|
|
2377
2375
|
};
|
|
2378
2376
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -2380,12 +2378,12 @@ ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
|
2380
2378
|
}
|
|
2381
2379
|
};
|
|
2382
2380
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}");
|
|
2383
|
-
return
|
|
2381
|
+
return ff_core_Array.Array_toList(signatures_, 0, 9007199254740991)
|
|
2384
2382
|
})()));
|
|
2385
2383
|
if(self_.lspHook_.trackSymbols_) {
|
|
2386
2384
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(nameToken_), 11, ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(traitToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
2387
2385
|
};
|
|
2388
|
-
return ff_compiler_Syntax.DTrait(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_),
|
|
2386
|
+
return ff_compiler_Syntax.DTrait(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), [ff_compiler_Token.Token_raw(typeParameterToken_), ...poly_.generics_], [...ff_core_Array.Array_toList(constraints_, 0, 9007199254740991), ...poly_.constraints_], generatorParameters_, methodSignatures_, ff_core_Array.Array_toList(methodDefaults_, 0, 9007199254740991), ff_core_Array.Array_toList(methodGenerators_, 0, 9007199254740991))
|
|
2389
2387
|
}
|
|
2390
2388
|
|
|
2391
2389
|
export async function Parser_parseInstanceDefinition$(self_, $task) {
|
|
@@ -2395,18 +2393,18 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbol
|
|
|
2395
2393
|
const instanceToken_ = ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "instance");
|
|
2396
2394
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
2397
2395
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
2398
|
-
? ff_compiler_Parser.Poly(
|
|
2396
|
+
? ff_compiler_Parser.Poly([], [])
|
|
2399
2397
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
2400
|
-
const typeArguments_ =
|
|
2401
|
-
|
|
2402
|
-
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), _w1,
|
|
2398
|
+
const typeArguments_ = ff_core_Array.make_();
|
|
2399
|
+
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) => {
|
|
2400
|
+
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), _w1, [])
|
|
2403
2401
|
}))));
|
|
2404
2402
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
2405
2403
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
2406
2404
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "[")) {
|
|
2407
2405
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "[");
|
|
2408
2406
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2409
|
-
|
|
2407
|
+
ff_core_Array.Array_push(typeArguments_, ff_compiler_Parser.Parser_parseType(self_));
|
|
2410
2408
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2411
2409
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
2412
2410
|
}
|
|
@@ -2415,24 +2413,24 @@ ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "]")
|
|
|
2415
2413
|
};
|
|
2416
2414
|
const generatorArguments_ = ff_compiler_Parser.Parser_parseFunctionArguments(self_, ff_compiler_Token.Token_at(nameToken_), false).first_;
|
|
2417
2415
|
const methods_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{"))
|
|
2418
|
-
?
|
|
2416
|
+
? []
|
|
2419
2417
|
: (await (async function() {
|
|
2420
|
-
const definitions_ =
|
|
2418
|
+
const definitions_ = ff_core_Array.make_();
|
|
2421
2419
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
2422
2420
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2423
|
-
|
|
2421
|
+
ff_core_Array.Array_push(definitions_, ff_compiler_Parser.Parser_parseFunctionDefinition(self_, false));
|
|
2424
2422
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2425
2423
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
2426
2424
|
}
|
|
2427
2425
|
};
|
|
2428
2426
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}");
|
|
2429
|
-
return
|
|
2427
|
+
return ff_core_Array.Array_toList(definitions_, 0, 9007199254740991)
|
|
2430
2428
|
})()));
|
|
2431
2429
|
if(self_.lspHook_.trackSymbols_) {
|
|
2432
2430
|
const name_ = ((ff_compiler_Token.Token_raw(token_) + ": ") + ff_compiler_Token.Token_raw(nameToken_));
|
|
2433
2431
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(name_, 19, ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(instanceToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
2434
2432
|
};
|
|
2435
|
-
return ff_compiler_Syntax.DInstance(ff_compiler_Token.Token_at(nameToken_), poly_.generics_, poly_.constraints_, ff_compiler_Token.Token_raw(nameToken_),
|
|
2433
|
+
return ff_compiler_Syntax.DInstance(ff_compiler_Token.Token_at(nameToken_), poly_.generics_, poly_.constraints_, ff_compiler_Token.Token_raw(nameToken_), ff_core_Array.Array_toList(typeArguments_, 0, 9007199254740991), generatorArguments_, methods_, false)
|
|
2436
2434
|
}
|
|
2437
2435
|
|
|
2438
2436
|
export async function Parser_parseTypeDefinition$(self_, $task) {
|
|
@@ -2441,8 +2439,8 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbol
|
|
|
2441
2439
|
};
|
|
2442
2440
|
const newtype_ = ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "newtype");
|
|
2443
2441
|
const effectParameter_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "capability")
|
|
2444
|
-
?
|
|
2445
|
-
:
|
|
2442
|
+
? ["Q$"]
|
|
2443
|
+
: []);
|
|
2446
2444
|
const allowMutable_ = ff_compiler_Token.Token_rawIs2(ff_compiler_Parser.Parser_current(self_), "class", "capability");
|
|
2447
2445
|
const kindToken_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "newtype")
|
|
2448
2446
|
? ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "newtype")
|
|
@@ -2453,26 +2451,26 @@ const kindToken_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_curr
|
|
|
2453
2451
|
: ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "capability"));
|
|
2454
2452
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
2455
2453
|
const poly_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
2456
|
-
? ff_compiler_Parser.Poly(
|
|
2454
|
+
? ff_compiler_Parser.Poly([], [])
|
|
2457
2455
|
: ff_compiler_Parser.Parser_parseTypeParameters(self_));
|
|
2458
2456
|
if(((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))) {
|
|
2459
2457
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{")
|
|
2460
2458
|
};
|
|
2461
2459
|
const commonFields_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "("))
|
|
2462
|
-
?
|
|
2460
|
+
? []
|
|
2463
2461
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, true));
|
|
2464
2462
|
const variants_ = ((newtype_ || (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))
|
|
2465
|
-
?
|
|
2463
|
+
? [ff_compiler_Syntax.Variant(ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_raw(nameToken_), [])]
|
|
2466
2464
|
: (await (async function() {
|
|
2467
2465
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "{");
|
|
2468
|
-
const variantsBuilder_ =
|
|
2466
|
+
const variantsBuilder_ = ff_core_Array.make_();
|
|
2469
2467
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2470
2468
|
if(self_.lspHook_.trackSymbols_) {
|
|
2471
2469
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolBegin())
|
|
2472
2470
|
};
|
|
2473
2471
|
const variantNameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
2474
2472
|
const variantFields_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "("))
|
|
2475
|
-
?
|
|
2473
|
+
? []
|
|
2476
2474
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, true));
|
|
2477
2475
|
if(((!allowMutable_) && ff_core_List.List_any(variantFields_, ((_w1) => {
|
|
2478
2476
|
return _w1.mutable_
|
|
@@ -2481,7 +2479,7 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Sy
|
|
|
2481
2479
|
return _w1.mutable_
|
|
2482
2480
|
}))).at_, "Only classes can have mutable fields"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2483
2481
|
};
|
|
2484
|
-
|
|
2482
|
+
ff_core_Array.Array_push(variantsBuilder_, ff_compiler_Syntax.Variant(ff_compiler_Token.Token_at(variantNameToken_), ff_compiler_Token.Token_raw(variantNameToken_), variantFields_));
|
|
2485
2483
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2486
2484
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
2487
2485
|
};
|
|
@@ -2490,7 +2488,7 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbol
|
|
|
2490
2488
|
}
|
|
2491
2489
|
};
|
|
2492
2490
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}");
|
|
2493
|
-
return
|
|
2491
|
+
return ff_core_Array.Array_toList(variantsBuilder_, 0, 9007199254740991)
|
|
2494
2492
|
})()));
|
|
2495
2493
|
if((newtype_ && (ff_core_List.List_size(commonFields_) !== 1))) {
|
|
2496
2494
|
ff_core_Log.show_(commonFields_, ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Parameter));
|
|
@@ -2503,7 +2501,7 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Sy
|
|
|
2503
2501
|
return _w1.mutable_
|
|
2504
2502
|
}))).at_, "Only classes and capabilities can have mutable fields"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
2505
2503
|
};
|
|
2506
|
-
const generics_ =
|
|
2504
|
+
const generics_ = [...effectParameter_, ...poly_.generics_];
|
|
2507
2505
|
const result_ = ff_compiler_Syntax.DType(ff_compiler_Token.Token_at(nameToken_), newtype_, (!allowMutable_), ff_compiler_Token.Token_raw(nameToken_), generics_, poly_.constraints_, commonFields_, variants_);
|
|
2508
2506
|
if(self_.lspHook_.trackSymbols_) {
|
|
2509
2507
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(nameToken_), 5, ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(kindToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
@@ -2513,9 +2511,9 @@ return result_
|
|
|
2513
2511
|
|
|
2514
2512
|
export async function Parser_parseImportDefinition$(self_, currentPackagePair_, $task) {
|
|
2515
2513
|
const importToken_ = ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "import");
|
|
2516
|
-
const path_ =
|
|
2514
|
+
const path_ = ff_core_Array.make_();
|
|
2517
2515
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower())) {
|
|
2518
|
-
|
|
2516
|
+
ff_core_Array.Array_push(path_, ff_compiler_Parser.Parser_parseDashedName(self_));
|
|
2519
2517
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot())
|
|
2520
2518
|
};
|
|
2521
2519
|
const fileToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
@@ -2534,7 +2532,7 @@ const packageName_ = ff_compiler_Parser.Parser_parseDashedName(self_);
|
|
|
2534
2532
|
return ff_compiler_Syntax.PackagePair(userName_, packageName_)
|
|
2535
2533
|
})())
|
|
2536
2534
|
: currentPackagePair_);
|
|
2537
|
-
return ff_compiler_Syntax.DImport(ff_compiler_Token.Token_at(fileToken_), alias_, packagePair_,
|
|
2535
|
+
return ff_compiler_Syntax.DImport(ff_compiler_Token.Token_at(fileToken_), alias_, packagePair_, ff_core_Array.Array_toList(path_, 0, 9007199254740991), ff_compiler_Token.Token_raw(fileToken_))
|
|
2538
2536
|
}
|
|
2539
2537
|
|
|
2540
2538
|
export async function Parser_parsePackageDefinition$(self_, $task) {
|
|
@@ -2579,7 +2577,7 @@ const token_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(sel
|
|
|
2579
2577
|
do {
|
|
2580
2578
|
const _1 = ff_compiler_Token.Token_raw(token_);
|
|
2581
2579
|
{
|
|
2582
|
-
if(_1
|
|
2580
|
+
if(_1 === "node") {
|
|
2583
2581
|
const _guard1 = targets_.node_;
|
|
2584
2582
|
if(_guard1) {
|
|
2585
2583
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Token.Token_at(token_), "Duplicate target name"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
@@ -2588,7 +2586,7 @@ break
|
|
|
2588
2586
|
}
|
|
2589
2587
|
}
|
|
2590
2588
|
{
|
|
2591
|
-
if(_1
|
|
2589
|
+
if(_1 === "node") {
|
|
2592
2590
|
targets_ = (((_c) => {
|
|
2593
2591
|
return ff_compiler_Syntax.TargetNames(true, _c.browser_)
|
|
2594
2592
|
}))(targets_)
|
|
@@ -2596,7 +2594,7 @@ break
|
|
|
2596
2594
|
}
|
|
2597
2595
|
}
|
|
2598
2596
|
{
|
|
2599
|
-
if(_1
|
|
2597
|
+
if(_1 === "browser") {
|
|
2600
2598
|
const _guard1 = targets_.browser_;
|
|
2601
2599
|
if(_guard1) {
|
|
2602
2600
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Token.Token_at(token_), "Duplicate target name"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
@@ -2605,7 +2603,7 @@ break
|
|
|
2605
2603
|
}
|
|
2606
2604
|
}
|
|
2607
2605
|
{
|
|
2608
|
-
if(_1
|
|
2606
|
+
if(_1 === "browser") {
|
|
2609
2607
|
targets_ = (((_c) => {
|
|
2610
2608
|
return ff_compiler_Syntax.TargetNames(_c.node_, true)
|
|
2611
2609
|
}))(targets_)
|
|
@@ -2636,7 +2634,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot());
|
|
|
2636
2634
|
return ff_core_String.String_grabInt(ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LInt())))
|
|
2637
2635
|
})())
|
|
2638
2636
|
: 0);
|
|
2639
|
-
return ff_compiler_Syntax.Version(ff_compiler_Token.Token_at(majorMinor_), ff_core_String.String_grabInt(
|
|
2637
|
+
return ff_compiler_Syntax.Version(ff_compiler_Token.Token_at(majorMinor_), ff_core_String.String_grabInt(ff_core_List.List_grab(parts_, 0)), ff_core_String.String_grabInt(ff_core_List.List_grab(parts_, 1)), patch_)
|
|
2640
2638
|
} else {
|
|
2641
2639
|
const major_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LInt());
|
|
2642
2640
|
return ff_compiler_Syntax.Version(ff_compiler_Token.Token_at(major_), ff_core_String.String_grabInt(ff_compiler_Token.Token_raw(major_)), 0, 0)
|
|
@@ -2679,19 +2677,19 @@ return part_
|
|
|
2679
2677
|
|
|
2680
2678
|
export async function Parser_parseTypeParameters$(self_, $task) {
|
|
2681
2679
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "[");
|
|
2682
|
-
const parameters_ =
|
|
2683
|
-
const constraints_ =
|
|
2680
|
+
const parameters_ = ff_core_Array.make_();
|
|
2681
|
+
const constraints_ = ff_core_Array.make_();
|
|
2684
2682
|
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())))) {
|
|
2685
2683
|
if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_ahead(self_), ff_compiler_Token.LBracketLeft())) {
|
|
2686
|
-
|
|
2684
|
+
ff_core_Array.Array_push(constraints_, ff_compiler_Parser.Parser_parseConstraint(self_))
|
|
2687
2685
|
} else {
|
|
2688
2686
|
const parameterNameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
2689
|
-
|
|
2687
|
+
ff_core_Array.Array_push(parameters_, ff_compiler_Token.Token_raw(parameterNameToken_));
|
|
2690
2688
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())) {
|
|
2691
2689
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
2692
2690
|
const constraint_ = ff_compiler_Parser.Parser_parseConstraint(self_);
|
|
2693
|
-
|
|
2694
|
-
return ff_compiler_Syntax.Constraint(_c.at_, _c.name_,
|
|
2691
|
+
ff_core_Array.Array_push(constraints_, (((_c) => {
|
|
2692
|
+
return ff_compiler_Syntax.Constraint(_c.at_, _c.name_, [ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(parameterNameToken_), ff_compiler_Token.Token_raw(parameterNameToken_), []), ...constraint_.generics_])
|
|
2695
2693
|
}))(constraint_))
|
|
2696
2694
|
}
|
|
2697
2695
|
};
|
|
@@ -2700,16 +2698,16 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
|
2700
2698
|
}
|
|
2701
2699
|
};
|
|
2702
2700
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "]");
|
|
2703
|
-
return ff_compiler_Parser.Poly(
|
|
2701
|
+
return ff_compiler_Parser.Poly(ff_core_Array.Array_toList(parameters_, 0, 9007199254740991), ff_core_Array.Array_toList(constraints_, 0, 9007199254740991))
|
|
2704
2702
|
}
|
|
2705
2703
|
|
|
2706
2704
|
export async function Parser_parseTypeArguments$(self_, parenthesis_ = false, $task) {
|
|
2707
2705
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), (parenthesis_
|
|
2708
2706
|
? "("
|
|
2709
2707
|
: "["));
|
|
2710
|
-
const types_ =
|
|
2708
|
+
const types_ = ff_core_Array.make_();
|
|
2711
2709
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2712
|
-
|
|
2710
|
+
ff_core_Array.Array_push(types_, ff_compiler_Parser.Parser_parseType(self_));
|
|
2713
2711
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2714
2712
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
2715
2713
|
}
|
|
@@ -2717,11 +2715,11 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
|
2717
2715
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), (parenthesis_
|
|
2718
2716
|
? ")"
|
|
2719
2717
|
: "]"));
|
|
2720
|
-
return
|
|
2718
|
+
return ff_core_Array.Array_toList(types_, 0, 9007199254740991)
|
|
2721
2719
|
}
|
|
2722
2720
|
|
|
2723
2721
|
export async function Parser_parseFunctionParameters$(self_, allowMutable_ = false, $task) {
|
|
2724
|
-
const parameters_ =
|
|
2722
|
+
const parameters_ = ff_core_Array.make_();
|
|
2725
2723
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
2726
2724
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2727
2725
|
const lspTrackSymbols_ = (self_.lspHook_.trackSymbols_ && allowMutable_);
|
|
@@ -2735,8 +2733,8 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword())
|
|
|
2735
2733
|
};
|
|
2736
2734
|
const parameterNameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
2737
2735
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())))) {
|
|
2738
|
-
const t_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(parameterNameToken_), "ff:core/Nothing.Nothing",
|
|
2739
|
-
|
|
2736
|
+
const t_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(parameterNameToken_), "ff:core/Nothing.Nothing", []);
|
|
2737
|
+
ff_core_Array.Array_push(parameters_, ff_compiler_Syntax.Parameter(ff_compiler_Token.Token_at(parameterNameToken_), mutable_, ff_compiler_Token.Token_raw(parameterNameToken_), t_, ff_core_Option.None()));
|
|
2740
2738
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2741
2739
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
2742
2740
|
}
|
|
@@ -2749,7 +2747,7 @@ const default_ = ((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current
|
|
|
2749
2747
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
2750
2748
|
return ff_core_Option.Some(ff_compiler_Parser.Parser_parseTerm(self_))
|
|
2751
2749
|
})()));
|
|
2752
|
-
|
|
2750
|
+
ff_core_Array.Array_push(parameters_, ff_compiler_Syntax.Parameter(ff_compiler_Token.Token_at(parameterNameToken_), mutable_, ff_compiler_Token.Token_raw(parameterNameToken_), parameterType_, default_));
|
|
2753
2751
|
if(lspTrackSymbols_) {
|
|
2754
2752
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(parameterNameToken_), 7, ff_compiler_Token.Token_at(parameterNameToken_), ff_compiler_Token.Token_end(parameterNameToken_), ff_compiler_Token.Token_at(lspFirst_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
2755
2753
|
};
|
|
@@ -2759,11 +2757,11 @@ ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
|
2759
2757
|
}
|
|
2760
2758
|
};
|
|
2761
2759
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
2762
|
-
return
|
|
2760
|
+
return ff_core_Array.Array_toList(parameters_, 0, 9007199254740991)
|
|
2763
2761
|
}
|
|
2764
2762
|
|
|
2765
2763
|
export async function Parser_parseFunctionArguments$(self_, callAt_, trailing_, $task) {
|
|
2766
|
-
const arguments_ =
|
|
2764
|
+
const arguments_ = ff_core_Array.make_();
|
|
2767
2765
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
2768
2766
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
2769
2767
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -2778,13 +2776,13 @@ return ff_core_Option.Some(token_)
|
|
|
2778
2776
|
const value_ = ff_compiler_Parser.Parser_parseTerm(self_);
|
|
2779
2777
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
2780
2778
|
if(ff_compiler_LspHook.strictlyBetween_(callAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
2781
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_,
|
|
2779
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_, ff_core_Array.Array_size(arguments_), ff_core_Option.Option_map(nameToken_, ((_w1) => {
|
|
2782
2780
|
return ff_compiler_Token.Token_raw(_w1)
|
|
2783
2781
|
}))));
|
|
2784
2782
|
self_.lspEmittedArgumentHook_ = true
|
|
2785
2783
|
}
|
|
2786
2784
|
};
|
|
2787
|
-
|
|
2785
|
+
ff_core_Array.Array_push(arguments_, ff_compiler_Syntax.Argument(ff_compiler_Token.Token_at(argumentToken_), ff_core_Option.Option_map(nameToken_, ((_w1) => {
|
|
2788
2786
|
return ff_compiler_Token.Token_raw(_w1)
|
|
2789
2787
|
})), value_));
|
|
2790
2788
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
@@ -2793,7 +2791,7 @@ ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
|
2793
2791
|
};
|
|
2794
2792
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
2795
2793
|
if(ff_compiler_LspHook.strictlyBetween_(callAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
2796
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_,
|
|
2794
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_, ff_core_Array.Array_size(arguments_), ff_core_Option.None()));
|
|
2797
2795
|
self_.lspEmittedArgumentHook_ = true
|
|
2798
2796
|
}
|
|
2799
2797
|
};
|
|
@@ -2804,30 +2802,30 @@ if(trailing_) {
|
|
|
2804
2802
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower(), ff_compiler_Token.LUpper(), ff_compiler_Token.LString()) || ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LInt(), ff_compiler_Token.LChar(), ff_compiler_Token.LFloat())))) {
|
|
2805
2803
|
lastWasCurly_ = true;
|
|
2806
2804
|
const term_ = ff_compiler_Parser.Parser_parseTerm(self_);
|
|
2807
|
-
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(term_.at_, "TemporaryEffect$",
|
|
2808
|
-
const cases_ =
|
|
2805
|
+
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(term_.at_, "TemporaryEffect$", []);
|
|
2806
|
+
const cases_ = [ff_compiler_Syntax.MatchCase(term_.at_, [], [], term_)];
|
|
2809
2807
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
2810
2808
|
if(ff_compiler_LspHook.strictlyBetween_(callAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
2811
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_,
|
|
2809
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_, ff_core_Array.Array_size(arguments_), ff_core_Option.None()));
|
|
2812
2810
|
self_.lspEmittedArgumentHook_ = true
|
|
2813
2811
|
}
|
|
2814
2812
|
};
|
|
2815
|
-
|
|
2813
|
+
ff_core_Array.Array_push(arguments_, ff_compiler_Syntax.Argument(term_.at_, ff_core_Option.None(), ff_compiler_Syntax.ELambda(term_.at_, ff_compiler_Syntax.Lambda(term_.at_, temporaryEffect_, cases_))))
|
|
2816
2814
|
} else {
|
|
2817
2815
|
while((ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{") || ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon()))) {
|
|
2818
2816
|
lastWasCurly_ = ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{");
|
|
2819
2817
|
const lambda_ = ff_compiler_Parser.Parser_parseLambda(self_, 0, false, true);
|
|
2820
2818
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
2821
2819
|
if(ff_compiler_LspHook.strictlyBetween_(callAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
2822
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_,
|
|
2820
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(callAt_, ff_core_Array.Array_size(arguments_), ff_core_Option.None()));
|
|
2823
2821
|
self_.lspEmittedArgumentHook_ = true
|
|
2824
2822
|
}
|
|
2825
2823
|
};
|
|
2826
|
-
|
|
2824
|
+
ff_core_Array.Array_push(arguments_, ff_compiler_Syntax.Argument(lambda_.at_, ff_core_Option.None(), ff_compiler_Syntax.ELambda(lambda_.at_, lambda_)))
|
|
2827
2825
|
}
|
|
2828
2826
|
}
|
|
2829
2827
|
};
|
|
2830
|
-
return ff_core_Pair.Pair(
|
|
2828
|
+
return ff_core_Pair.Pair(ff_core_Array.Array_toList(arguments_, 0, 9007199254740991), lastWasCurly_)
|
|
2831
2829
|
}
|
|
2832
2830
|
|
|
2833
2831
|
export async function Parser_parseLambda$(self_, defaultParameterCount_ = 0, ignoreGenerateKeyword_ = false, allowColon_ = false, $task) {
|
|
@@ -2840,21 +2838,21 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword())
|
|
|
2840
2838
|
};
|
|
2841
2839
|
const result_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe())
|
|
2842
2840
|
? (await (async function() {
|
|
2843
|
-
const cases_ =
|
|
2841
|
+
const cases_ = ff_core_Array.make_();
|
|
2844
2842
|
while(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe())) {
|
|
2845
|
-
|
|
2843
|
+
ff_core_Array.Array_push(cases_, ff_compiler_Parser.Parser_parseCase(self_))
|
|
2846
2844
|
};
|
|
2847
|
-
return
|
|
2845
|
+
return ff_core_Array.Array_toList(cases_, 0, 9007199254740991)
|
|
2848
2846
|
})())
|
|
2849
2847
|
: (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()))
|
|
2850
2848
|
? (await (async function() {
|
|
2851
|
-
const parameters_ =
|
|
2849
|
+
const parameters_ = ff_core_Array.make_();
|
|
2852
2850
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick()))) {
|
|
2853
2851
|
const isVariable_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower());
|
|
2854
2852
|
const parameterToken_ = (isVariable_
|
|
2855
2853
|
? ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower())
|
|
2856
2854
|
: ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LWildcard()));
|
|
2857
|
-
|
|
2855
|
+
ff_core_Array.Array_push(parameters_, ff_compiler_Syntax.PVariable(ff_compiler_Token.Token_at(parameterToken_), (isVariable_
|
|
2858
2856
|
? ff_core_Option.Some(ff_compiler_Token.Token_raw(parameterToken_))
|
|
2859
2857
|
: ff_core_Option.None())));
|
|
2860
2858
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick()))) {
|
|
@@ -2863,7 +2861,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
|
2863
2861
|
};
|
|
2864
2862
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LArrowThick());
|
|
2865
2863
|
const term_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
2866
|
-
return
|
|
2864
|
+
return [ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_), ff_core_Array.Array_toList(parameters_, 0, 9007199254740991), [], term_)]
|
|
2867
2865
|
})())
|
|
2868
2866
|
: (await (async function() {
|
|
2869
2867
|
const term_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
@@ -2876,40 +2874,40 @@ return ff_compiler_Syntax.PVariable(ff_compiler_Token.Token_at(token_), ff_core_
|
|
|
2876
2874
|
: ff_core_List.List_map(ff_core_List.range_(defaultParameterCount_), ((i_) => {
|
|
2877
2875
|
return ff_compiler_Syntax.PVariable(ff_compiler_Token.Token_at(token_), ff_core_Option.None())
|
|
2878
2876
|
})));
|
|
2879
|
-
return
|
|
2877
|
+
return [ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_), arguments_, [], e_)]
|
|
2880
2878
|
})()));
|
|
2881
2879
|
if((!colon_)) {
|
|
2882
2880
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "}")
|
|
2883
2881
|
};
|
|
2884
|
-
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), "TemporaryEffect$",
|
|
2882
|
+
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), "TemporaryEffect$", []);
|
|
2885
2883
|
return ff_compiler_Syntax.Lambda(ff_compiler_Token.Token_at(token_), temporaryEffect_, result_)
|
|
2886
2884
|
}
|
|
2887
2885
|
|
|
2888
2886
|
export async function Parser_parseCase$(self_, $task) {
|
|
2889
2887
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LPipe());
|
|
2890
|
-
const patterns_ =
|
|
2888
|
+
const patterns_ = ff_core_Array.make_();
|
|
2891
2889
|
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_), "{")))) {
|
|
2892
|
-
|
|
2890
|
+
ff_core_Array.Array_push(patterns_, ff_compiler_Parser.Parser_parsePattern(self_));
|
|
2893
2891
|
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_), "{")))) {
|
|
2894
2892
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
2895
2893
|
}
|
|
2896
2894
|
};
|
|
2897
|
-
const guards_ =
|
|
2895
|
+
const guards_ = ff_core_Array.make_();
|
|
2898
2896
|
while(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")) {
|
|
2899
|
-
|
|
2897
|
+
ff_core_Array.Array_push(guards_, ff_compiler_Parser.Parser_parseCaseGuard(self_))
|
|
2900
2898
|
};
|
|
2901
2899
|
if(((!ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) || (!ff_compiler_Token.Token_is2(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe(), ff_compiler_Token.LBracketRight())))) {
|
|
2902
2900
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LArrowThick())
|
|
2903
2901
|
};
|
|
2904
2902
|
const body_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
2905
|
-
return ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_),
|
|
2903
|
+
return ff_compiler_Syntax.MatchCase(ff_compiler_Token.Token_at(token_), ff_core_Array.Array_toList(patterns_, 0, 9007199254740991), ff_core_Array.Array_toList(guards_, 0, 9007199254740991), body_)
|
|
2906
2904
|
}
|
|
2907
2905
|
|
|
2908
2906
|
export async function Parser_parseCaseGuard$(self_, $task) {
|
|
2909
2907
|
const guardToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LBracketLeft());
|
|
2910
2908
|
const term_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
2911
2909
|
const p_ = ((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LPipe()))
|
|
2912
|
-
? ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(guardToken_), "True",
|
|
2910
|
+
? ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(guardToken_), "True", [])
|
|
2913
2911
|
: (await (async function() {
|
|
2914
2912
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LPipe());
|
|
2915
2913
|
return ff_compiler_Parser.Parser_parsePattern(self_)
|
|
@@ -2955,29 +2953,29 @@ return ff_compiler_Syntax.PChar(ff_compiler_Token.Token_at(token_), ff_compiler_
|
|
|
2955
2953
|
: (await (async function() {
|
|
2956
2954
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
2957
2955
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
2958
|
-
const patterns_ =
|
|
2956
|
+
const patterns_ = ff_core_Array.make_();
|
|
2959
2957
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
2960
2958
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2961
2959
|
const pattern_ = ff_compiler_Parser.Parser_parsePattern(self_);
|
|
2962
2960
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
2963
2961
|
if(ff_compiler_LspHook.strictlyBetween_(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
2964
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(ff_compiler_Token.Token_at(token_),
|
|
2962
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(ff_compiler_Token.Token_at(token_), ff_core_Array.Array_size(patterns_), ff_core_Option.None()));
|
|
2965
2963
|
self_.lspEmittedArgumentHook_ = true
|
|
2966
2964
|
}
|
|
2967
2965
|
};
|
|
2968
|
-
|
|
2966
|
+
ff_core_Array.Array_push(patterns_, pattern_);
|
|
2969
2967
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
2970
2968
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LComma())
|
|
2971
2969
|
}
|
|
2972
2970
|
};
|
|
2973
2971
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
2974
2972
|
if(ff_compiler_LspHook.strictlyBetween_(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
2975
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(ff_compiler_Token.Token_at(token_),
|
|
2973
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(ff_compiler_Token.Token_at(token_), ff_core_Array.Array_size(patterns_), ff_core_Option.None()));
|
|
2976
2974
|
self_.lspEmittedArgumentHook_ = true
|
|
2977
2975
|
}
|
|
2978
2976
|
};
|
|
2979
2977
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
2980
|
-
return ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_),
|
|
2978
|
+
return ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_), ff_core_Array.Array_toList(patterns_, 0, 9007199254740991))
|
|
2981
2979
|
} else {
|
|
2982
2980
|
if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower())) {
|
|
2983
2981
|
const asToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
@@ -2986,7 +2984,7 @@ return ff_compiler_Syntax.PVariantAs(ff_compiler_Token.Token_at(token_), ff_comp
|
|
|
2986
2984
|
const wildcardToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LWildcard());
|
|
2987
2985
|
return ff_compiler_Syntax.PVariantAs(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_), ff_compiler_Token.Token_at(wildcardToken_), ff_core_Option.None())
|
|
2988
2986
|
} else {
|
|
2989
|
-
return ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_),
|
|
2987
|
+
return ff_compiler_Syntax.PVariant(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_), [])
|
|
2990
2988
|
}
|
|
2991
2989
|
}
|
|
2992
2990
|
})()));
|
|
@@ -3004,7 +3002,7 @@ const leftTypes_ = (((ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_cu
|
|
|
3004
3002
|
? (await (async function() {
|
|
3005
3003
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
3006
3004
|
const pair_ = ff_core_List.List_unzip(ff_compiler_Parser.Parser_parseRecordType(self_));
|
|
3007
|
-
return
|
|
3005
|
+
return [ff_compiler_Syntax.TConstructor(at_, ("Record$" + ff_core_List.List_join(pair_.first_, "$")), pair_.second_)]
|
|
3008
3006
|
})())
|
|
3009
3007
|
: ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")
|
|
3010
3008
|
? ff_compiler_Parser.Parser_parseTypeArguments(self_, true)
|
|
@@ -3014,16 +3012,16 @@ const namespace_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current
|
|
|
3014
3012
|
: "");
|
|
3015
3013
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
3016
3014
|
const arguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
3017
|
-
?
|
|
3015
|
+
? []
|
|
3018
3016
|
: ff_compiler_Parser.Parser_parseTypeArguments(self_, false));
|
|
3019
|
-
return
|
|
3017
|
+
return [ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(token_), (namespace_ + ff_compiler_Token.Token_raw(token_)), arguments_)]
|
|
3020
3018
|
})()));
|
|
3021
3019
|
if(((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThick())) && (ff_core_List.List_size(leftTypes_) === 1))) {
|
|
3022
3020
|
return ff_core_List.List_grabFirst(leftTypes_)
|
|
3023
3021
|
} else {
|
|
3024
3022
|
const arrowToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LArrowThick());
|
|
3025
3023
|
const rightType_ = ff_compiler_Parser.Parser_parseType(self_);
|
|
3026
|
-
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(arrowToken_), ("Function$" + ff_core_List.List_size(leftTypes_)),
|
|
3024
|
+
return ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(arrowToken_), ("Function$" + ff_core_List.List_size(leftTypes_)), [...leftTypes_, rightType_])
|
|
3027
3025
|
}
|
|
3028
3026
|
}
|
|
3029
3027
|
|
|
@@ -3033,14 +3031,14 @@ const namespace_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current
|
|
|
3033
3031
|
: "");
|
|
3034
3032
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
3035
3033
|
const arguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
3036
|
-
?
|
|
3034
|
+
? []
|
|
3037
3035
|
: ff_compiler_Parser.Parser_parseTypeArguments(self_, false));
|
|
3038
3036
|
return ff_compiler_Syntax.Constraint(ff_compiler_Token.Token_at(token_), (namespace_ + ff_compiler_Token.Token_raw(token_)), arguments_)
|
|
3039
3037
|
}
|
|
3040
3038
|
|
|
3041
3039
|
export async function Parser_parseStatements$(self_, $task) {
|
|
3042
3040
|
if(ff_compiler_Token.Token_is2(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight(), ff_compiler_Token.LPipe())) {
|
|
3043
|
-
return ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Unit",
|
|
3041
|
+
return ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "Unit", [], ff_core_Option.None())
|
|
3044
3042
|
} else {
|
|
3045
3043
|
let result_ = ff_compiler_Parser.Parser_parseStatement(self_);
|
|
3046
3044
|
while(ff_compiler_Parser.Parser_currentIsSeparator(self_, ff_compiler_Token.LSemicolon())) {
|
|
@@ -3123,7 +3121,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
|
3123
3121
|
return ff_compiler_Parser.Parser_parseType(self_)
|
|
3124
3122
|
})()));
|
|
3125
3123
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssign())))) {
|
|
3126
|
-
const unit_ = ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit",
|
|
3124
|
+
const unit_ = ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit", [], ff_core_Option.None());
|
|
3127
3125
|
return ff_compiler_Syntax.ELet(ff_compiler_Token.Token_at(nameToken_), mutable_, ff_compiler_Token.Token_raw(nameToken_), valueType_, unit_, unit_)
|
|
3128
3126
|
} else {
|
|
3129
3127
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
@@ -3139,14 +3137,14 @@ const body_ = (ff_compiler_Parser.Parser_currentIsSeparator(self_, ff_compiler_T
|
|
|
3139
3137
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon());
|
|
3140
3138
|
return ff_compiler_Parser.Parser_parseStatements(self_)
|
|
3141
3139
|
})())
|
|
3142
|
-
: ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit",
|
|
3140
|
+
: ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit", [], ff_core_Option.None()));
|
|
3143
3141
|
return ff_compiler_Syntax.ELet(ff_compiler_Token.Token_at(nameToken_), mutable_, ff_compiler_Token.Token_raw(nameToken_), valueType_, value_, body_)
|
|
3144
3142
|
}
|
|
3145
3143
|
}
|
|
3146
3144
|
|
|
3147
3145
|
export async function Parser_parseFunctions$(self_, $task) {
|
|
3148
3146
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
3149
|
-
const functions_ =
|
|
3147
|
+
const functions_ = ff_core_Array.make_();
|
|
3150
3148
|
while(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "function")) {
|
|
3151
3149
|
if(self_.lspHook_.trackSymbols_) {
|
|
3152
3150
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolBegin())
|
|
@@ -3155,11 +3153,11 @@ const functionAt_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip
|
|
|
3155
3153
|
const signature_ = ff_compiler_Parser.Parser_parseSignature(self_, false);
|
|
3156
3154
|
const body_ = ((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "{")))
|
|
3157
3155
|
? (await (async function() {
|
|
3158
|
-
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(functionAt_, "TemporaryEffect$",
|
|
3159
|
-
return ff_compiler_Syntax.Lambda(functionAt_, temporaryEffect_,
|
|
3156
|
+
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(functionAt_, "TemporaryEffect$", []);
|
|
3157
|
+
return ff_compiler_Syntax.Lambda(functionAt_, temporaryEffect_, [])
|
|
3160
3158
|
})())
|
|
3161
3159
|
: ff_compiler_Parser.Parser_parseLambda(self_, ff_core_List.List_size(signature_.parameters_), false, false));
|
|
3162
|
-
|
|
3160
|
+
ff_core_Array.Array_push(functions_, ff_compiler_Syntax.DFunction(signature_.at_, signature_, ff_compiler_Syntax.FireflyTarget(body_)));
|
|
3163
3161
|
if(self_.lspHook_.trackSymbols_) {
|
|
3164
3162
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(signature_.name_, 12, signature_.at_, (((_c) => {
|
|
3165
3163
|
return ff_compiler_Syntax.Location(_c.file_, _c.line_, (signature_.at_.column_ + ff_core_String.String_size(signature_.name_)))
|
|
@@ -3172,7 +3170,7 @@ ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
|
3172
3170
|
}
|
|
3173
3171
|
};
|
|
3174
3172
|
const body_ = ff_compiler_Parser.Parser_parseStatements(self_);
|
|
3175
|
-
return ff_compiler_Syntax.EFunctions(at_,
|
|
3173
|
+
return ff_compiler_Syntax.EFunctions(at_, ff_core_Array.Array_toList(functions_, 0, 9007199254740991), body_)
|
|
3176
3174
|
}
|
|
3177
3175
|
|
|
3178
3176
|
export async function Parser_parseTerm$(self_, $task) {
|
|
@@ -3180,10 +3178,10 @@ return ff_compiler_Parser.Parser_parseBinary(self_, 0)
|
|
|
3180
3178
|
}
|
|
3181
3179
|
|
|
3182
3180
|
export async function Parser_parseBinary$(self_, level_, $task) {
|
|
3183
|
-
if((level_ >=
|
|
3181
|
+
if((level_ >= ff_core_List.List_size(ff_compiler_Parser.binaryOperators_))) {
|
|
3184
3182
|
return ff_compiler_Parser.Parser_parseUnary(self_)
|
|
3185
3183
|
} else {
|
|
3186
|
-
const operators_ =
|
|
3184
|
+
const operators_ = ff_core_List.List_grab(ff_compiler_Parser.binaryOperators_, level_);
|
|
3187
3185
|
let result_ = ff_compiler_Parser.Parser_parseBinary(self_, (level_ + 1));
|
|
3188
3186
|
if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LOperator())) {
|
|
3189
3187
|
while(ff_core_List.List_any(operators_, ((value_) => {
|
|
@@ -3191,41 +3189,41 @@ return ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), v
|
|
|
3191
3189
|
}))) {
|
|
3192
3190
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LOperator());
|
|
3193
3191
|
const right_ = ff_compiler_Parser.Parser_parseBinary(self_, (level_ + 1));
|
|
3194
|
-
const arguments_ =
|
|
3192
|
+
const arguments_ = [ff_compiler_Syntax.Argument(result_.at_, ff_core_Option.None(), result_), ff_compiler_Syntax.Argument(right_.at_, ff_core_Option.None(), right_)];
|
|
3195
3193
|
const effect_ = ff_compiler_Parser.Parser_freshUnificationVariable(self_, ff_compiler_Token.Token_at(token_));
|
|
3196
3194
|
const target_ = (((_1) => {
|
|
3197
3195
|
{
|
|
3198
|
-
if(_1
|
|
3196
|
+
if(_1 === "==") {
|
|
3199
3197
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Equal.equals"), false)
|
|
3200
3198
|
return
|
|
3201
3199
|
}
|
|
3202
3200
|
}
|
|
3203
3201
|
{
|
|
3204
|
-
if(_1
|
|
3202
|
+
if(_1 === "!=") {
|
|
3205
3203
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Equal.notEquals"), false)
|
|
3206
3204
|
return
|
|
3207
3205
|
}
|
|
3208
3206
|
}
|
|
3209
3207
|
{
|
|
3210
|
-
if(_1
|
|
3208
|
+
if(_1 === "<") {
|
|
3211
3209
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Ordering.before"), false)
|
|
3212
3210
|
return
|
|
3213
3211
|
}
|
|
3214
3212
|
}
|
|
3215
3213
|
{
|
|
3216
|
-
if(_1
|
|
3214
|
+
if(_1 === "<=") {
|
|
3217
3215
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Ordering.notAfter"), false)
|
|
3218
3216
|
return
|
|
3219
3217
|
}
|
|
3220
3218
|
}
|
|
3221
3219
|
{
|
|
3222
|
-
if(_1
|
|
3220
|
+
if(_1 === ">") {
|
|
3223
3221
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Ordering.after"), false)
|
|
3224
3222
|
return
|
|
3225
3223
|
}
|
|
3226
3224
|
}
|
|
3227
3225
|
{
|
|
3228
|
-
if(_1
|
|
3226
|
+
if(_1 === ">=") {
|
|
3229
3227
|
return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), "ff:core/Ordering.notBefore"), false)
|
|
3230
3228
|
return
|
|
3231
3229
|
}
|
|
@@ -3236,7 +3234,7 @@ return ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_T
|
|
|
3236
3234
|
return
|
|
3237
3235
|
}
|
|
3238
3236
|
}))(ff_compiler_Token.Token_raw(token_));
|
|
3239
|
-
result_ = ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_,
|
|
3237
|
+
result_ = ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_, [], arguments_, [])
|
|
3240
3238
|
}
|
|
3241
3239
|
};
|
|
3242
3240
|
return result_
|
|
@@ -3249,7 +3247,7 @@ const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LOperator
|
|
|
3249
3247
|
const term_ = ff_compiler_Parser.Parser_parseUnary(self_);
|
|
3250
3248
|
const effect_ = ff_compiler_Parser.Parser_freshUnificationVariable(self_, ff_compiler_Token.Token_at(token_));
|
|
3251
3249
|
const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), ff_compiler_Token.Token_raw(token_)), false);
|
|
3252
|
-
return ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_,
|
|
3250
|
+
return ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_, [], [ff_compiler_Syntax.Argument(term_.at_, ff_core_Option.None(), term_)], [])
|
|
3253
3251
|
} else {
|
|
3254
3252
|
return ff_compiler_Parser.Parser_parseFieldsAndCalls(self_)
|
|
3255
3253
|
}
|
|
@@ -3279,12 +3277,12 @@ result_ = ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false, r
|
|
|
3279
3277
|
} else {
|
|
3280
3278
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
3281
3279
|
const typeArguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
3282
|
-
?
|
|
3280
|
+
? []
|
|
3283
3281
|
: ff_compiler_Parser.Parser_parseTypeArguments(self_, false));
|
|
3284
3282
|
const arguments_ = ff_compiler_Parser.Parser_parseFunctionArguments(self_, result_.at_, true);
|
|
3285
3283
|
const effect_ = ff_compiler_Parser.Parser_freshUnificationVariable(self_, at_);
|
|
3286
3284
|
const target_ = ff_compiler_Syntax.DynamicCall(result_, tailCall_);
|
|
3287
|
-
result_ = ff_compiler_Syntax.ECall(result_.at_, target_, effect_, typeArguments_, arguments_.first_,
|
|
3285
|
+
result_ = ff_compiler_Syntax.ECall(result_.at_, target_, effect_, typeArguments_, arguments_.first_, []);
|
|
3288
3286
|
if((arguments_.second_ && ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LLower()))) {
|
|
3289
3287
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
3290
3288
|
result_ = ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false, result_, ff_compiler_Token.Token_raw(token_))
|
|
@@ -3356,7 +3354,7 @@ export async function Parser_parseVariant$(self_, prefix_, $task) {
|
|
|
3356
3354
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
3357
3355
|
const name_ = (prefix_ + ff_compiler_Token.Token_raw(token_));
|
|
3358
3356
|
const typeArguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
3359
|
-
?
|
|
3357
|
+
? []
|
|
3360
3358
|
: ff_compiler_Parser.Parser_parseTypeArguments(self_, false));
|
|
3361
3359
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "?")) {
|
|
3362
3360
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LOperator());
|
|
@@ -3380,13 +3378,13 @@ const prefix_ = (namespace_ + extraNamespace_);
|
|
|
3380
3378
|
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
3381
3379
|
const name_ = (prefix_ + ff_compiler_Token.Token_raw(token_));
|
|
3382
3380
|
const fields_ = ((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")))
|
|
3383
|
-
?
|
|
3381
|
+
? []
|
|
3384
3382
|
: ff_compiler_Parser.Parser_parseRecord(self_, ff_core_Option.Some(ff_compiler_Token.Token_at(token_))));
|
|
3385
3383
|
return ff_compiler_Syntax.ECopy(ff_compiler_Token.Token_at(token_), name_, record_, fields_)
|
|
3386
3384
|
}
|
|
3387
3385
|
|
|
3388
3386
|
export async function Parser_parseRecord$(self_, copyAt_, $task) {
|
|
3389
|
-
const fields_ =
|
|
3387
|
+
const fields_ = ff_core_Array.make_();
|
|
3390
3388
|
const startBracketAt_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "("));
|
|
3391
3389
|
const startAt_ = ff_core_Option.Option_else(copyAt_, (() => {
|
|
3392
3390
|
return startBracketAt_
|
|
@@ -3401,57 +3399,57 @@ return ff_compiler_Syntax.Field(ff_compiler_Token.Token_at(fieldToken_), ff_comp
|
|
|
3401
3399
|
: ff_compiler_Syntax.Field(ff_compiler_Token.Token_at(fieldToken_), ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(fieldToken_), ff_compiler_Token.Token_raw(fieldToken_))));
|
|
3402
3400
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
3403
3401
|
if(ff_compiler_LspHook.strictlyBetween_(startAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
3404
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(startAt_,
|
|
3402
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(startAt_, ff_core_Array.Array_size(fields_), ff_core_Option.Option_filter(ff_core_Option.Some(field_.name_), ((_w1) => {
|
|
3405
3403
|
return (_w1 !== "")
|
|
3406
3404
|
}))));
|
|
3407
3405
|
self_.lspEmittedArgumentHook_ = true
|
|
3408
3406
|
}
|
|
3409
3407
|
};
|
|
3410
|
-
|
|
3408
|
+
ff_core_Array.Array_push(fields_, field_);
|
|
3411
3409
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
3412
3410
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
3413
3411
|
}
|
|
3414
3412
|
};
|
|
3415
3413
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
3416
3414
|
if(ff_compiler_LspHook.strictlyBetween_(startAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
3417
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(startAt_,
|
|
3415
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseArgumentHook(startAt_, ff_core_Array.Array_size(fields_), ff_core_Option.None()));
|
|
3418
3416
|
self_.lspEmittedArgumentHook_ = true
|
|
3419
3417
|
}
|
|
3420
3418
|
};
|
|
3421
3419
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
3422
|
-
return
|
|
3420
|
+
return ff_core_Array.Array_toList(fields_, 0, 9007199254740991)
|
|
3423
3421
|
}
|
|
3424
3422
|
|
|
3425
3423
|
export async function Parser_parseRecordType$(self_, $task) {
|
|
3426
|
-
const fields_ =
|
|
3424
|
+
const fields_ = ff_core_Array.make_();
|
|
3427
3425
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
3428
3426
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
3429
3427
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
3430
3428
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LColon());
|
|
3431
|
-
|
|
3429
|
+
ff_core_Array.Array_push(fields_, ff_core_Pair.Pair(ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Parser.Parser_parseType(self_)));
|
|
3432
3430
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
3433
3431
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
3434
3432
|
}
|
|
3435
3433
|
};
|
|
3436
3434
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
3437
|
-
return ff_core_List.List_sortBy(
|
|
3435
|
+
return ff_core_List.List_sortBy(ff_core_Array.Array_toList(fields_, 0, 9007199254740991), ((_w1) => {
|
|
3438
3436
|
return _w1.first_
|
|
3439
3437
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
3440
3438
|
}
|
|
3441
3439
|
|
|
3442
3440
|
export async function Parser_parseRecordPattern$(self_, $task) {
|
|
3443
|
-
const fields_ =
|
|
3441
|
+
const fields_ = ff_core_Array.make_();
|
|
3444
3442
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "(");
|
|
3445
3443
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
3446
3444
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
3447
3445
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
3448
|
-
|
|
3446
|
+
ff_core_Array.Array_push(fields_, ff_core_Pair.Pair(ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Parser.Parser_parsePattern(self_)));
|
|
3449
3447
|
if((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
3450
3448
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
3451
3449
|
}
|
|
3452
3450
|
};
|
|
3453
3451
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), ")");
|
|
3454
|
-
return ff_core_List.List_sortBy(
|
|
3452
|
+
return ff_core_List.List_sortBy(ff_core_Array.Array_toList(fields_, 0, 9007199254740991), ((_w1) => {
|
|
3455
3453
|
return _w1.first_
|
|
3456
3454
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
3457
3455
|
}
|
|
@@ -3462,26 +3460,26 @@ function convertListPattern_(at_, items_) {
|
|
|
3462
3460
|
const at_a = at_;
|
|
3463
3461
|
const items_a = items_;
|
|
3464
3462
|
{
|
|
3465
|
-
if(items_a.
|
|
3466
|
-
return ff_compiler_Syntax.PVariant(at_, "
|
|
3463
|
+
if(items_a.length === 0) {
|
|
3464
|
+
return ff_compiler_Syntax.PVariant(at_, "List$Empty", [])
|
|
3467
3465
|
return
|
|
3468
3466
|
}
|
|
3469
3467
|
}
|
|
3470
3468
|
{
|
|
3471
|
-
if(items_a.
|
|
3472
|
-
const p_ = items_a.
|
|
3473
|
-
if(!items_a.
|
|
3474
|
-
const ps_ = items_a.
|
|
3475
|
-
return ff_compiler_Syntax.PVariant(at_, "
|
|
3469
|
+
if(items_a.length > 0) {
|
|
3470
|
+
const p_ = items_a[0].first_;
|
|
3471
|
+
if(!items_a[0].second_) {
|
|
3472
|
+
const ps_ = items_a.slice(1);
|
|
3473
|
+
return ff_compiler_Syntax.PVariant(at_, "List$Link", [p_, convertListPattern_(at_, ps_)])
|
|
3476
3474
|
return
|
|
3477
3475
|
}
|
|
3478
3476
|
}
|
|
3479
3477
|
}
|
|
3480
3478
|
{
|
|
3481
|
-
if(items_a.
|
|
3482
|
-
const p_ = items_a.
|
|
3483
|
-
if(items_a.
|
|
3484
|
-
if(items_a.
|
|
3479
|
+
if(items_a.length > 0) {
|
|
3480
|
+
const p_ = items_a[0].first_;
|
|
3481
|
+
if(items_a[0].second_) {
|
|
3482
|
+
if(items_a.length === 1) {
|
|
3485
3483
|
return p_
|
|
3486
3484
|
return
|
|
3487
3485
|
}
|
|
@@ -3489,9 +3487,9 @@ return
|
|
|
3489
3487
|
}
|
|
3490
3488
|
}
|
|
3491
3489
|
{
|
|
3492
|
-
if(items_a.
|
|
3493
|
-
const p_ = items_a.
|
|
3494
|
-
if(items_a.
|
|
3490
|
+
if(items_a.length > 0) {
|
|
3491
|
+
const p_ = items_a[0].first_;
|
|
3492
|
+
if(items_a[0].second_) {
|
|
3495
3493
|
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)})
|
|
3496
3494
|
return
|
|
3497
3495
|
}
|
|
@@ -3499,7 +3497,7 @@ return
|
|
|
3499
3497
|
}
|
|
3500
3498
|
}
|
|
3501
3499
|
}
|
|
3502
|
-
const items_ =
|
|
3500
|
+
const items_ = ff_core_Array.make_();
|
|
3503
3501
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "["));
|
|
3504
3502
|
while((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
3505
3503
|
const spread_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDotDotDot());
|
|
@@ -3509,30 +3507,30 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDotDotDot())
|
|
|
3509
3507
|
const pattern_ = ((spread_ && ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))
|
|
3510
3508
|
? ff_compiler_Syntax.PVariable(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), ff_core_Option.None())
|
|
3511
3509
|
: ff_compiler_Parser.Parser_parsePattern(self_));
|
|
3512
|
-
|
|
3510
|
+
ff_core_Array.Array_push(items_, ff_core_Pair.Pair(pattern_, spread_));
|
|
3513
3511
|
if((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
3514
3512
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
3515
3513
|
}
|
|
3516
3514
|
};
|
|
3517
3515
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "]");
|
|
3518
|
-
return convertListPattern_(at_,
|
|
3516
|
+
return convertListPattern_(at_, ff_core_Array.Array_toList(items_, 0, 9007199254740991))
|
|
3519
3517
|
}
|
|
3520
3518
|
|
|
3521
3519
|
export async function Parser_parseList$(self_, $task) {
|
|
3522
|
-
const items_ =
|
|
3520
|
+
const items_ = ff_core_Array.make_();
|
|
3523
3521
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketLeft(), "["));
|
|
3524
3522
|
while((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
3525
3523
|
const spread_ = ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDotDotDot());
|
|
3526
3524
|
if(spread_) {
|
|
3527
3525
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDotDotDot())
|
|
3528
3526
|
};
|
|
3529
|
-
|
|
3527
|
+
ff_core_Array.Array_push(items_, ff_core_Pair.Pair(ff_compiler_Parser.Parser_parseTerm(self_), spread_));
|
|
3530
3528
|
if((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "]"))) {
|
|
3531
3529
|
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LComma())
|
|
3532
3530
|
}
|
|
3533
3531
|
};
|
|
3534
3532
|
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LBracketRight(), "]");
|
|
3535
|
-
return ff_compiler_Syntax.EList(at_, ff_compiler_Parser.Parser_freshUnificationVariable(self_, at_),
|
|
3533
|
+
return ff_compiler_Syntax.EList(at_, ff_compiler_Parser.Parser_freshUnificationVariable(self_, at_), ff_core_Array.Array_toList(items_, 0, 9007199254740991))
|
|
3536
3534
|
}
|
|
3537
3535
|
|
|
3538
3536
|
export const ff_core_Any_HasAnyTag$ff_compiler_Parser_Poly = {
|
|
@@ -3880,7 +3878,7 @@ serialization_.offset_ += 1;
|
|
|
3880
3878
|
{
|
|
3881
3879
|
const _1 = variantIndex_;
|
|
3882
3880
|
{
|
|
3883
|
-
if(_1
|
|
3881
|
+
if(_1 === 0) {
|
|
3884
3882
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 23), 0);
|
|
3885
3883
|
return ff_compiler_Parser.Poly(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(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_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Constraint).deserializeUsing_(serialization_))
|
|
3886
3884
|
return
|
|
@@ -3914,7 +3912,7 @@ serialization_.offset_ += 1;
|
|
|
3914
3912
|
{
|
|
3915
3913
|
const _1 = variantIndex_;
|
|
3916
3914
|
{
|
|
3917
|
-
if(_1
|
|
3915
|
+
if(_1 === 0) {
|
|
3918
3916
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 23), 0);
|
|
3919
3917
|
return ff_compiler_Parser.Poly(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(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_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Constraint).deserializeUsing_(serialization_))
|
|
3920
3918
|
return
|
|
@@ -3958,7 +3956,7 @@ serialization_.offset_ += 1;
|
|
|
3958
3956
|
{
|
|
3959
3957
|
const _1 = variantIndex_;
|
|
3960
3958
|
{
|
|
3961
|
-
if(_1
|
|
3959
|
+
if(_1 === 0) {
|
|
3962
3960
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 32), 0);
|
|
3963
3961
|
return ff_compiler_Parser.ParsedTargets(ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Lambda).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Lambda).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Lambda).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
|
|
3964
3962
|
return
|
|
@@ -3999,7 +3997,7 @@ serialization_.offset_ += 1;
|
|
|
3999
3997
|
{
|
|
4000
3998
|
const _1 = variantIndex_;
|
|
4001
3999
|
{
|
|
4002
|
-
if(_1
|
|
4000
|
+
if(_1 === 0) {
|
|
4003
4001
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 32), 0);
|
|
4004
4002
|
return ff_compiler_Parser.ParsedTargets(ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Lambda).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Lambda).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Lambda).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
|
|
4005
4003
|
return
|