firefly-compiler 0.5.11 → 0.5.12
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/JsEmitter.ff
CHANGED
|
@@ -386,13 +386,13 @@ extend self: JsEmitter {
|
|
|
386
386
|
if(await) {"(await " + call + ")"} else {call}
|
|
387
387
|
| [Pair(EVariant(_, "ff:core/Bool.True", _, _), elseBody), ...list] =>
|
|
388
388
|
"(" + list.foldLeft(self.emitTerm(elseBody, async)) {| otherwise, Pair(condition, body) =>
|
|
389
|
-
self.
|
|
390
|
-
"\n? " + self.
|
|
389
|
+
self.emitComma(condition, async) +
|
|
390
|
+
"\n? " + self.emitComma(body, async) + "\n: " + otherwise
|
|
391
391
|
} + ")"
|
|
392
392
|
| list =>
|
|
393
393
|
"(" + list.foldLeft("ff_core_Option.None()") {| otherwise, Pair(condition, body) =>
|
|
394
|
-
self.
|
|
395
|
-
"\n? ff_core_Option.Some(" + self.
|
|
394
|
+
self.emitComma(condition, async) +
|
|
395
|
+
"\n? ff_core_Option.Some(" + self.emitComma(body, async) + ")\n: " + otherwise
|
|
396
396
|
} + ")"
|
|
397
397
|
}
|
|
398
398
|
| ECall(at, DynamicCall(function, _), effect, typeArguments, arguments, dictionaries) =>
|
|
@@ -1081,13 +1081,22 @@ extend self: JsEmitter {
|
|
|
1081
1081
|
|
|
1082
1082
|
emitComma(term: Term, async: Bool): String {
|
|
1083
1083
|
term.{
|
|
1084
|
+
| ESequential(_, ESequential(_, ESequential(_, before1, before2), before3), after) {
|
|
1085
|
+
safeCommable(before1) && safeCommable(before2) && safeCommable(before3) && safeCommable(after)
|
|
1086
|
+
} =>
|
|
1087
|
+
"(" + self.emitStatements(before1, False, async) + ", " +
|
|
1088
|
+
self.emitStatements(before2, False, async) + ", " +
|
|
1089
|
+
self.emitStatements(before3, False, async) + ", " +
|
|
1090
|
+
self.emitTerm(after, async) + ")"
|
|
1084
1091
|
| ESequential(_, ESequential(_, before1, before2), after) {
|
|
1085
|
-
safeCommable(before1) && safeCommable(before2)
|
|
1092
|
+
safeCommable(before1) && safeCommable(before2) && safeCommable(after)
|
|
1086
1093
|
} =>
|
|
1087
1094
|
"(" + self.emitStatements(before1, False, async) + ", " +
|
|
1088
1095
|
self.emitStatements(before2, False, async) + ", " +
|
|
1089
1096
|
self.emitTerm(after, async) + ")"
|
|
1090
|
-
| ESequential(_, before, after) {
|
|
1097
|
+
| ESequential(_, before, after) {
|
|
1098
|
+
safeCommable(before) && safeCommable(after)
|
|
1099
|
+
} =>
|
|
1091
1100
|
"(" + self.emitStatements(before, False, async) + ", " +
|
|
1092
1101
|
self.emitTerm(after, async) + ")"
|
|
1093
1102
|
| _ =>
|
|
@@ -1134,10 +1143,16 @@ safeCommable(term: Term): Bool {
|
|
|
1134
1143
|
| EAssign _ => True
|
|
1135
1144
|
| EAssignField _ => True
|
|
1136
1145
|
| ECall _ => True
|
|
1146
|
+
| ECopy _ => True
|
|
1147
|
+
| EVariant _ => True
|
|
1137
1148
|
| EString(_, _) => True
|
|
1138
1149
|
| EInt(_, _) => True
|
|
1139
1150
|
| EChar(_, _) => True
|
|
1140
1151
|
| EFloat(_, _) => True
|
|
1152
|
+
| EList _ => True
|
|
1153
|
+
| EPipe _ => True
|
|
1154
|
+
| ERecord _ => True
|
|
1155
|
+
| EWildcard _ => True
|
|
1141
1156
|
| _ => False
|
|
1142
1157
|
}
|
|
1143
1158
|
}
|
|
@@ -210,6 +210,12 @@ return true
|
|
|
210
210
|
if(_1.ECall) {
|
|
211
211
|
return true
|
|
212
212
|
}
|
|
213
|
+
if(_1.ECopy) {
|
|
214
|
+
return true
|
|
215
|
+
}
|
|
216
|
+
if(_1.EVariant) {
|
|
217
|
+
return true
|
|
218
|
+
}
|
|
213
219
|
if(_1.EString) {
|
|
214
220
|
return true
|
|
215
221
|
}
|
|
@@ -222,6 +228,18 @@ return true
|
|
|
222
228
|
if(_1.EFloat) {
|
|
223
229
|
return true
|
|
224
230
|
}
|
|
231
|
+
if(_1.EList) {
|
|
232
|
+
return true
|
|
233
|
+
}
|
|
234
|
+
if(_1.EPipe) {
|
|
235
|
+
return true
|
|
236
|
+
}
|
|
237
|
+
if(_1.ERecord) {
|
|
238
|
+
return true
|
|
239
|
+
}
|
|
240
|
+
if(_1.EWildcard) {
|
|
241
|
+
return true
|
|
242
|
+
}
|
|
225
243
|
{
|
|
226
244
|
return false
|
|
227
245
|
}
|
|
@@ -445,6 +463,12 @@ return true
|
|
|
445
463
|
if(_1.ECall) {
|
|
446
464
|
return true
|
|
447
465
|
}
|
|
466
|
+
if(_1.ECopy) {
|
|
467
|
+
return true
|
|
468
|
+
}
|
|
469
|
+
if(_1.EVariant) {
|
|
470
|
+
return true
|
|
471
|
+
}
|
|
448
472
|
if(_1.EString) {
|
|
449
473
|
return true
|
|
450
474
|
}
|
|
@@ -457,6 +481,18 @@ return true
|
|
|
457
481
|
if(_1.EFloat) {
|
|
458
482
|
return true
|
|
459
483
|
}
|
|
484
|
+
if(_1.EList) {
|
|
485
|
+
return true
|
|
486
|
+
}
|
|
487
|
+
if(_1.EPipe) {
|
|
488
|
+
return true
|
|
489
|
+
}
|
|
490
|
+
if(_1.ERecord) {
|
|
491
|
+
return true
|
|
492
|
+
}
|
|
493
|
+
if(_1.EWildcard) {
|
|
494
|
+
return true
|
|
495
|
+
}
|
|
460
496
|
{
|
|
461
497
|
return false
|
|
462
498
|
}
|
|
@@ -1182,7 +1218,7 @@ return (("(" + ff_core_List.List_foldLeft(list_, ff_compiler_JsEmitter.JsEmitter
|
|
|
1182
1218
|
const otherwise_ = _1;
|
|
1183
1219
|
const condition_ = _2.first_;
|
|
1184
1220
|
const body_ = _2.second_;
|
|
1185
|
-
return ((((ff_compiler_JsEmitter.
|
|
1221
|
+
return ((((ff_compiler_JsEmitter.JsEmitter_emitComma(self_, condition_, async_) + "\n? ") + ff_compiler_JsEmitter.JsEmitter_emitComma(self_, body_, async_)) + "\n: ") + otherwise_)
|
|
1186
1222
|
}
|
|
1187
1223
|
}))) + ")")
|
|
1188
1224
|
return
|
|
@@ -1194,7 +1230,7 @@ return (("(" + ff_core_List.List_foldLeft(list_, "ff_core_Option.None()", ((_1,
|
|
|
1194
1230
|
const otherwise_ = _1;
|
|
1195
1231
|
const condition_ = _2.first_;
|
|
1196
1232
|
const body_ = _2.second_;
|
|
1197
|
-
return ((((ff_compiler_JsEmitter.
|
|
1233
|
+
return ((((ff_compiler_JsEmitter.JsEmitter_emitComma(self_, condition_, async_) + "\n? ff_core_Option.Some(") + ff_compiler_JsEmitter.JsEmitter_emitComma(self_, body_, async_)) + ")\n: ") + otherwise_)
|
|
1198
1234
|
}
|
|
1199
1235
|
}))) + ")")
|
|
1200
1236
|
return
|
|
@@ -2523,18 +2559,27 @@ return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)
|
|
|
2523
2559
|
export function JsEmitter_emitComma(self_, term_, async_) {
|
|
2524
2560
|
{
|
|
2525
2561
|
const _1 = term_;
|
|
2562
|
+
if(_1.ESequential && _1.before_.ESequential && _1.before_.before_.ESequential) {
|
|
2563
|
+
const before1_ = _1.before_.before_.before_;
|
|
2564
|
+
const before2_ = _1.before_.before_.after_;
|
|
2565
|
+
const before3_ = _1.before_.after_;
|
|
2566
|
+
const after_ = _1.after_;
|
|
2567
|
+
if((((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(before3_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
2568
|
+
return (((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before1_, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before2_, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before3_, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_)) + ")")
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2526
2571
|
if(_1.ESequential && _1.before_.ESequential) {
|
|
2527
2572
|
const before1_ = _1.before_.before_;
|
|
2528
2573
|
const before2_ = _1.before_.after_;
|
|
2529
2574
|
const after_ = _1.after_;
|
|
2530
|
-
if((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_))) {
|
|
2575
|
+
if(((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
2531
2576
|
return (((((("(" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before1_, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before2_, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_)) + ")")
|
|
2532
2577
|
}
|
|
2533
2578
|
}
|
|
2534
2579
|
if(_1.ESequential) {
|
|
2535
2580
|
const before_ = _1.before_;
|
|
2536
2581
|
const after_ = _1.after_;
|
|
2537
|
-
if(ff_compiler_JsEmitter.safeCommable_(before_)) {
|
|
2582
|
+
if((ff_compiler_JsEmitter.safeCommable_(before_) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
2538
2583
|
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before_, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_)) + ")")
|
|
2539
2584
|
}
|
|
2540
2585
|
}
|
|
@@ -3126,7 +3171,7 @@ return (("(" + (await ff_core_List.List_foldLeft$(list_, (await ff_compiler_JsEm
|
|
|
3126
3171
|
const otherwise_ = _1;
|
|
3127
3172
|
const condition_ = _2.first_;
|
|
3128
3173
|
const body_ = _2.second_;
|
|
3129
|
-
return (((((await ff_compiler_JsEmitter.
|
|
3174
|
+
return (((((await ff_compiler_JsEmitter.JsEmitter_emitComma$(self_, condition_, async_, $task)) + "\n? ") + (await ff_compiler_JsEmitter.JsEmitter_emitComma$(self_, body_, async_, $task))) + "\n: ") + otherwise_)
|
|
3130
3175
|
}
|
|
3131
3176
|
}), $task))) + ")")
|
|
3132
3177
|
return
|
|
@@ -3138,7 +3183,7 @@ return (("(" + (await ff_core_List.List_foldLeft$(list_, "ff_core_Option.None()"
|
|
|
3138
3183
|
const otherwise_ = _1;
|
|
3139
3184
|
const condition_ = _2.first_;
|
|
3140
3185
|
const body_ = _2.second_;
|
|
3141
|
-
return (((((await ff_compiler_JsEmitter.
|
|
3186
|
+
return (((((await ff_compiler_JsEmitter.JsEmitter_emitComma$(self_, condition_, async_, $task)) + "\n? ff_core_Option.Some(") + (await ff_compiler_JsEmitter.JsEmitter_emitComma$(self_, body_, async_, $task))) + ")\n: ") + otherwise_)
|
|
3142
3187
|
}
|
|
3143
3188
|
}), $task))) + ")")
|
|
3144
3189
|
return
|
|
@@ -4467,18 +4512,27 @@ return (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, value_, async_, $
|
|
|
4467
4512
|
export async function JsEmitter_emitComma$(self_, term_, async_, $task) {
|
|
4468
4513
|
{
|
|
4469
4514
|
const _1 = term_;
|
|
4515
|
+
if(_1.ESequential && _1.before_.ESequential && _1.before_.before_.ESequential) {
|
|
4516
|
+
const before1_ = _1.before_.before_.before_;
|
|
4517
|
+
const before2_ = _1.before_.before_.after_;
|
|
4518
|
+
const before3_ = _1.before_.after_;
|
|
4519
|
+
const after_ = _1.after_;
|
|
4520
|
+
if((((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(before3_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
4521
|
+
return (((((((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitStatements$(self_, before1_, false, async_, $task))) + ", ") + (await ff_compiler_JsEmitter.JsEmitter_emitStatements$(self_, before2_, false, async_, $task))) + ", ") + (await ff_compiler_JsEmitter.JsEmitter_emitStatements$(self_, before3_, false, async_, $task))) + ", ") + (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, after_, async_, $task))) + ")")
|
|
4522
|
+
}
|
|
4523
|
+
}
|
|
4470
4524
|
if(_1.ESequential && _1.before_.ESequential) {
|
|
4471
4525
|
const before1_ = _1.before_.before_;
|
|
4472
4526
|
const before2_ = _1.before_.after_;
|
|
4473
4527
|
const after_ = _1.after_;
|
|
4474
|
-
if((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_))) {
|
|
4528
|
+
if(((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
4475
4529
|
return (((((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitStatements$(self_, before1_, false, async_, $task))) + ", ") + (await ff_compiler_JsEmitter.JsEmitter_emitStatements$(self_, before2_, false, async_, $task))) + ", ") + (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, after_, async_, $task))) + ")")
|
|
4476
4530
|
}
|
|
4477
4531
|
}
|
|
4478
4532
|
if(_1.ESequential) {
|
|
4479
4533
|
const before_ = _1.before_;
|
|
4480
4534
|
const after_ = _1.after_;
|
|
4481
|
-
if(ff_compiler_JsEmitter.safeCommable_(before_)) {
|
|
4535
|
+
if((ff_compiler_JsEmitter.safeCommable_(before_) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
4482
4536
|
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitStatements$(self_, before_, false, async_, $task))) + ", ") + (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, after_, async_, $task))) + ")")
|
|
4483
4537
|
}
|
|
4484
4538
|
}
|
|
@@ -414,10 +414,7 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbol
|
|
|
414
414
|
};
|
|
415
415
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
416
416
|
const variableType_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())
|
|
417
|
-
? (
|
|
418
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
419
|
-
return ff_compiler_Parser.Parser_parseType(self_)
|
|
420
|
-
})()
|
|
417
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon()), ff_compiler_Parser.Parser_parseType(self_))
|
|
421
418
|
: ff_compiler_Parser.Parser_freshUnificationVariable(self_, ff_compiler_Token.Token_at(nameToken_)));
|
|
422
419
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
423
420
|
const value_ = ff_compiler_Parser.Parser_parseTerm(self_);
|
|
@@ -573,10 +570,7 @@ const parameters_ = ((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (
|
|
|
573
570
|
? []
|
|
574
571
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, false));
|
|
575
572
|
const returnType_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())
|
|
576
|
-
? (
|
|
577
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
578
|
-
return ff_compiler_Parser.Parser_parseType(self_)
|
|
579
|
-
})()
|
|
573
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon()), ff_compiler_Parser.Parser_parseType(self_))
|
|
580
574
|
: ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "ff:core/Unit.Unit", []));
|
|
581
575
|
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(nameToken_), "TemporaryEffect$", []);
|
|
582
576
|
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_)
|
|
@@ -814,10 +808,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot())
|
|
|
814
808
|
};
|
|
815
809
|
const fileToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
816
810
|
const alias_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "as")
|
|
817
|
-
? (
|
|
818
|
-
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "as");
|
|
819
|
-
return ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper()))
|
|
820
|
-
})()
|
|
811
|
+
? (ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "as"), ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper())))
|
|
821
812
|
: ff_compiler_Token.Token_raw(fileToken_));
|
|
822
813
|
const packagePair_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "from")
|
|
823
814
|
? (function() {
|
|
@@ -908,10 +899,7 @@ if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compi
|
|
|
908
899
|
const majorMinor_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LFloat());
|
|
909
900
|
const parts_ = ff_core_String.String_split(ff_compiler_Token.Token_raw(majorMinor_), 46);
|
|
910
901
|
const patch_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDot())
|
|
911
|
-
? (
|
|
912
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot());
|
|
913
|
-
return ff_core_String.String_grabInt(ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LInt())))
|
|
914
|
-
})()
|
|
902
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot()), ff_core_String.String_grabInt(ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LInt()))))
|
|
915
903
|
: 0);
|
|
916
904
|
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_)
|
|
917
905
|
} else {
|
|
@@ -1398,10 +1386,7 @@ if(self_.lspHook_.trackSymbols_) {
|
|
|
1398
1386
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(nameToken_), ff_compiler_LspHook.SLet(mutable_), ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(mutableToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
1399
1387
|
};
|
|
1400
1388
|
const body_ = (ff_compiler_Parser.Parser_currentIsSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
1401
|
-
? (
|
|
1402
|
-
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon());
|
|
1403
|
-
return ff_compiler_Parser.Parser_parseStatements(self_)
|
|
1404
|
-
})()
|
|
1389
|
+
? (ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon()), ff_compiler_Parser.Parser_parseStatements(self_))
|
|
1405
1390
|
: ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit", [], ff_core_Option.None()));
|
|
1406
1391
|
return ff_compiler_Syntax.ELet(ff_compiler_Token.Token_at(nameToken_), mutable_, ff_compiler_Token.Token_raw(nameToken_), valueType_, value_, body_)
|
|
1407
1392
|
}
|
|
@@ -1503,10 +1488,7 @@ return ff_compiler_Parser.Parser_parseFieldsAndCalls(self_)
|
|
|
1503
1488
|
|
|
1504
1489
|
export function Parser_parseFieldsAndCalls(self_) {
|
|
1505
1490
|
const tailCall_ = ((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_), "tailcall"))
|
|
1506
|
-
? (
|
|
1507
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword());
|
|
1508
|
-
return true
|
|
1509
|
-
})()
|
|
1491
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword()), true)
|
|
1510
1492
|
: false);
|
|
1511
1493
|
let result_ = ff_compiler_Parser.Parser_parseAtom(self_);
|
|
1512
1494
|
while(ff_compiler_Token.Token_is5(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketLeft(), ff_compiler_Token.LColon(), ff_compiler_Token.LDot(), ff_compiler_Token.LArrowThin(), ff_compiler_Token.LUnary())) {
|
|
@@ -1608,15 +1590,9 @@ const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EField(ff_comp
|
|
|
1608
1590
|
return ff_compiler_Syntax.ECall(record_.at_, target_, effect_, [], [ff_compiler_Syntax.Argument(member_.at_, ff_core_Option.None(), member_), ...arguments_.first_], [])
|
|
1609
1591
|
} else if(ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssign(), ff_compiler_Token.LAssignPlus(), ff_compiler_Token.LAssignMinus())) {
|
|
1610
1592
|
const method_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssign())
|
|
1611
|
-
? (
|
|
1612
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
1613
|
-
return "set"
|
|
1614
|
-
})()
|
|
1593
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign()), "set")
|
|
1615
1594
|
: ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssignPlus())
|
|
1616
|
-
? (
|
|
1617
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssignPlus());
|
|
1618
|
-
return "increment"
|
|
1619
|
-
})()
|
|
1595
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssignPlus()), "increment")
|
|
1620
1596
|
: (function() {
|
|
1621
1597
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssignMinus());
|
|
1622
1598
|
return "decrement"
|
|
@@ -1733,10 +1709,7 @@ return startBracketAt_
|
|
|
1733
1709
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
1734
1710
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
1735
1711
|
const field_ = (((!ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) || ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssign()))
|
|
1736
|
-
? (
|
|
1737
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
1738
|
-
return ff_compiler_Syntax.Field(ff_compiler_Token.Token_at(fieldToken_), ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Parser.Parser_parseTerm(self_))
|
|
1739
|
-
})()
|
|
1712
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign()), ff_compiler_Syntax.Field(ff_compiler_Token.Token_at(fieldToken_), ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Parser.Parser_parseTerm(self_)))
|
|
1740
1713
|
: 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_))));
|
|
1741
1714
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
1742
1715
|
if(ff_compiler_LspHook.strictlyBetween_(startAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
@@ -2035,10 +2008,7 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbol
|
|
|
2035
2008
|
};
|
|
2036
2009
|
const nameToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
2037
2010
|
const variableType_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())
|
|
2038
|
-
? (
|
|
2039
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
2040
|
-
return ff_compiler_Parser.Parser_parseType(self_)
|
|
2041
|
-
})())
|
|
2011
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon()), ff_compiler_Parser.Parser_parseType(self_))
|
|
2042
2012
|
: ff_compiler_Parser.Parser_freshUnificationVariable(self_, ff_compiler_Token.Token_at(nameToken_)));
|
|
2043
2013
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
2044
2014
|
const value_ = ff_compiler_Parser.Parser_parseTerm(self_);
|
|
@@ -2194,10 +2164,7 @@ const parameters_ = ((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (
|
|
|
2194
2164
|
? []
|
|
2195
2165
|
: ff_compiler_Parser.Parser_parseFunctionParameters(self_, false));
|
|
2196
2166
|
const returnType_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LColon())
|
|
2197
|
-
? (
|
|
2198
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon());
|
|
2199
|
-
return ff_compiler_Parser.Parser_parseType(self_)
|
|
2200
|
-
})())
|
|
2167
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LColon()), ff_compiler_Parser.Parser_parseType(self_))
|
|
2201
2168
|
: ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), "ff:core/Unit.Unit", []));
|
|
2202
2169
|
const temporaryEffect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Token.Token_at(nameToken_), "TemporaryEffect$", []);
|
|
2203
2170
|
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_)
|
|
@@ -2435,10 +2402,7 @@ ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot())
|
|
|
2435
2402
|
};
|
|
2436
2403
|
const fileToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper());
|
|
2437
2404
|
const alias_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "as")
|
|
2438
|
-
? (
|
|
2439
|
-
ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "as");
|
|
2440
|
-
return ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper()))
|
|
2441
|
-
})())
|
|
2405
|
+
? (ff_compiler_Parser.Parser_rawSkip(self_, ff_compiler_Token.LKeyword(), "as"), ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LUpper())))
|
|
2442
2406
|
: ff_compiler_Token.Token_raw(fileToken_));
|
|
2443
2407
|
const packagePair_ = (ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "from")
|
|
2444
2408
|
? (await (async function() {
|
|
@@ -2529,10 +2493,7 @@ if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compi
|
|
|
2529
2493
|
const majorMinor_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LFloat());
|
|
2530
2494
|
const parts_ = ff_core_String.String_split(ff_compiler_Token.Token_raw(majorMinor_), 46);
|
|
2531
2495
|
const patch_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LDot())
|
|
2532
|
-
? (
|
|
2533
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot());
|
|
2534
|
-
return ff_core_String.String_grabInt(ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LInt())))
|
|
2535
|
-
})())
|
|
2496
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LDot()), ff_core_String.String_grabInt(ff_compiler_Token.Token_raw(ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LInt()))))
|
|
2536
2497
|
: 0);
|
|
2537
2498
|
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_)
|
|
2538
2499
|
} else {
|
|
@@ -3019,10 +2980,7 @@ if(self_.lspHook_.trackSymbols_) {
|
|
|
3019
2980
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ParseSymbolEnd(ff_compiler_Token.Token_raw(nameToken_), ff_compiler_LspHook.SLet(mutable_), ff_compiler_Token.Token_at(nameToken_), ff_compiler_Token.Token_end(nameToken_), ff_compiler_Token.Token_at(mutableToken_), ff_compiler_Token.Token_end(ff_compiler_Parser.Parser_behind(self_))))
|
|
3020
2981
|
};
|
|
3021
2982
|
const body_ = (ff_compiler_Parser.Parser_currentIsSeparator(self_, ff_compiler_Token.LSemicolon())
|
|
3022
|
-
? (
|
|
3023
|
-
ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon());
|
|
3024
|
-
return ff_compiler_Parser.Parser_parseStatements(self_)
|
|
3025
|
-
})())
|
|
2983
|
+
? (ff_compiler_Parser.Parser_skipSeparator(self_, ff_compiler_Token.LSemicolon()), ff_compiler_Parser.Parser_parseStatements(self_))
|
|
3026
2984
|
: ff_compiler_Syntax.EVariant(ff_compiler_Token.Token_at(keywordToken_), "Unit", [], ff_core_Option.None()));
|
|
3027
2985
|
return ff_compiler_Syntax.ELet(ff_compiler_Token.Token_at(nameToken_), mutable_, ff_compiler_Token.Token_raw(nameToken_), valueType_, value_, body_)
|
|
3028
2986
|
}
|
|
@@ -3124,10 +3082,7 @@ return ff_compiler_Parser.Parser_parseFieldsAndCalls(self_)
|
|
|
3124
3082
|
|
|
3125
3083
|
export async function Parser_parseFieldsAndCalls$(self_, $task) {
|
|
3126
3084
|
const tailCall_ = ((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_), "tailcall"))
|
|
3127
|
-
? (
|
|
3128
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword());
|
|
3129
|
-
return true
|
|
3130
|
-
})())
|
|
3085
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LKeyword()), true)
|
|
3131
3086
|
: false);
|
|
3132
3087
|
let result_ = ff_compiler_Parser.Parser_parseAtom(self_);
|
|
3133
3088
|
while(ff_compiler_Token.Token_is5(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketLeft(), ff_compiler_Token.LColon(), ff_compiler_Token.LDot(), ff_compiler_Token.LArrowThin(), ff_compiler_Token.LUnary())) {
|
|
@@ -3229,15 +3184,9 @@ const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EField(ff_comp
|
|
|
3229
3184
|
return ff_compiler_Syntax.ECall(record_.at_, target_, effect_, [], [ff_compiler_Syntax.Argument(member_.at_, ff_core_Option.None(), member_), ...arguments_.first_], [])
|
|
3230
3185
|
} else if(ff_compiler_Token.Token_is3(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssign(), ff_compiler_Token.LAssignPlus(), ff_compiler_Token.LAssignMinus())) {
|
|
3231
3186
|
const method_ = (ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssign())
|
|
3232
|
-
? (
|
|
3233
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
3234
|
-
return "set"
|
|
3235
|
-
})())
|
|
3187
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign()), "set")
|
|
3236
3188
|
: ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssignPlus())
|
|
3237
|
-
? (
|
|
3238
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssignPlus());
|
|
3239
|
-
return "increment"
|
|
3240
|
-
})())
|
|
3189
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssignPlus()), "increment")
|
|
3241
3190
|
: (await (async function() {
|
|
3242
3191
|
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssignMinus());
|
|
3243
3192
|
return "decrement"
|
|
@@ -3354,10 +3303,7 @@ return startBracketAt_
|
|
|
3354
3303
|
while((!ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LBracketRight()))) {
|
|
3355
3304
|
const fieldToken_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LLower());
|
|
3356
3305
|
const field_ = (((!ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) || ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LAssign()))
|
|
3357
|
-
? (
|
|
3358
|
-
ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign());
|
|
3359
|
-
return ff_compiler_Syntax.Field(ff_compiler_Token.Token_at(fieldToken_), ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Parser.Parser_parseTerm(self_))
|
|
3360
|
-
})())
|
|
3306
|
+
? (ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LAssign()), ff_compiler_Syntax.Field(ff_compiler_Token.Token_at(fieldToken_), ff_compiler_Token.Token_raw(fieldToken_), ff_compiler_Parser.Parser_parseTerm(self_)))
|
|
3361
3307
|
: 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_))));
|
|
3362
3308
|
if((ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_) && (!self_.lspEmittedArgumentHook_))) {
|
|
3363
3309
|
if(ff_compiler_LspHook.strictlyBetween_(startAt_, ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_)), self_.lspHook_.at_, 1)) {
|
|
@@ -413,10 +413,7 @@ let i_ = 0;
|
|
|
413
413
|
for(let for_i = 0, for_a = self_, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
414
414
|
const x_ = for_a[for_i];
|
|
415
415
|
if(!(body_(x_)
|
|
416
|
-
? (
|
|
417
|
-
result_ = ff_core_Option.Some(i_);
|
|
418
|
-
return false
|
|
419
|
-
})()
|
|
416
|
+
? (result_ = ff_core_Option.Some(i_), false)
|
|
420
417
|
: (function() {
|
|
421
418
|
i_ += 1;
|
|
422
419
|
return true
|
|
@@ -430,10 +427,7 @@ let result_ = ff_core_Option.None();
|
|
|
430
427
|
for(let for_i = 0, for_a = self_, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
431
428
|
const x_ = for_a[for_i];
|
|
432
429
|
if(!(body_(x_)
|
|
433
|
-
? (
|
|
434
|
-
result_ = ff_core_Option.Some(x_);
|
|
435
|
-
return false
|
|
436
|
-
})()
|
|
430
|
+
? (result_ = ff_core_Option.Some(x_), false)
|
|
437
431
|
: true)) break
|
|
438
432
|
};
|
|
439
433
|
return result_
|
|
@@ -782,10 +776,7 @@ let i_ = 0;
|
|
|
782
776
|
for(let for_i = 0, for_a = self_, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
783
777
|
const x_ = for_a[for_i];
|
|
784
778
|
if(!((await body_(x_, $task))
|
|
785
|
-
? (
|
|
786
|
-
result_ = ff_core_Option.Some(i_);
|
|
787
|
-
return false
|
|
788
|
-
})())
|
|
779
|
+
? (result_ = ff_core_Option.Some(i_), false)
|
|
789
780
|
: (await (async function() {
|
|
790
781
|
i_ += 1;
|
|
791
782
|
return true
|
|
@@ -799,10 +790,7 @@ let result_ = ff_core_Option.None();
|
|
|
799
790
|
for(let for_i = 0, for_a = self_, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
800
791
|
const x_ = for_a[for_i];
|
|
801
792
|
if(!((await body_(x_, $task))
|
|
802
|
-
? (
|
|
803
|
-
result_ = ff_core_Option.Some(x_);
|
|
804
|
-
return false
|
|
805
|
-
})())
|
|
793
|
+
? (result_ = ff_core_Option.Some(x_), false)
|
|
806
794
|
: true)) break
|
|
807
795
|
};
|
|
808
796
|
return result_
|
package/package.json
CHANGED