firefly-compiler 0.4.19 → 0.4.21

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.
Files changed (68) hide show
  1. package/compiler/Builder.ff +23 -13
  2. package/compiler/JsEmitter.ff +120 -76
  3. package/compiler/LspHook.ff +17 -3
  4. package/compiler/Main.ff +13 -7
  5. package/compiler/Parser.ff +11 -13
  6. package/compiler/Resolver.ff +15 -15
  7. package/compiler/Syntax.ff +1 -0
  8. package/core/Array.ff +6 -4
  9. package/core/Int.ff +12 -12
  10. package/core/Json.ff +2 -2
  11. package/core/List.ff +6 -4
  12. package/experimental/benchmarks/ListGrab.ff +23 -0
  13. package/experimental/benchmarks/ListGrab.java +55 -0
  14. package/experimental/benchmarks/Pyrotek45.ff +30 -0
  15. package/experimental/benchmarks/Pyrotek45.java +64 -0
  16. package/experimental/tests/TestJson.ff +26 -0
  17. package/lsp/CompletionHandler.ff +14 -14
  18. package/lsp/Handler.ff +56 -60
  19. package/lsp/SignatureHelpHandler.ff +5 -4
  20. package/lsp/SymbolHandler.ff +18 -4
  21. package/lsp/TestReferences.ff +15 -0
  22. package/lsp/TestReferencesCase.ff +8 -0
  23. package/output/js/ff/compiler/Builder.mjs +50 -44
  24. package/output/js/ff/compiler/Dependencies.mjs +0 -2
  25. package/output/js/ff/compiler/Deriver.mjs +16 -140
  26. package/output/js/ff/compiler/Dictionaries.mjs +8 -222
  27. package/output/js/ff/compiler/Environment.mjs +12 -154
  28. package/output/js/ff/compiler/Inference.mjs +127 -1013
  29. package/output/js/ff/compiler/JsEmitter.mjs +434 -2344
  30. package/output/js/ff/compiler/JsImporter.mjs +0 -12
  31. package/output/js/ff/compiler/LspHook.mjs +548 -151
  32. package/output/js/ff/compiler/Main.mjs +96 -550
  33. package/output/js/ff/compiler/Parser.mjs +58 -390
  34. package/output/js/ff/compiler/Patterns.mjs +20 -200
  35. package/output/js/ff/compiler/Resolver.mjs +26 -340
  36. package/output/js/ff/compiler/Substitution.mjs +2 -160
  37. package/output/js/ff/compiler/Syntax.mjs +449 -3293
  38. package/output/js/ff/compiler/Token.mjs +9 -1095
  39. package/output/js/ff/compiler/Tokenizer.mjs +4 -2
  40. package/output/js/ff/compiler/Unification.mjs +26 -360
  41. package/output/js/ff/compiler/Wildcards.mjs +0 -86
  42. package/output/js/ff/compiler/Workspace.mjs +8 -96
  43. package/output/js/ff/core/Array.mjs +15 -8
  44. package/output/js/ff/core/AssetSystem.mjs +4 -14
  45. package/output/js/ff/core/Bool.mjs +0 -12
  46. package/output/js/ff/core/Core.mjs +0 -30
  47. package/output/js/ff/core/Int.mjs +24 -24
  48. package/output/js/ff/core/IntMap.mjs +0 -8
  49. package/output/js/ff/core/Json.mjs +2 -42
  50. package/output/js/ff/core/List.mjs +23 -32
  51. package/output/js/ff/core/Lock.mjs +0 -10
  52. package/output/js/ff/core/Map.mjs +0 -24
  53. package/output/js/ff/core/Option.mjs +10 -286
  54. package/output/js/ff/core/Ordering.mjs +16 -158
  55. package/output/js/ff/core/Pair.mjs +2 -34
  56. package/output/js/ff/core/Path.mjs +2 -28
  57. package/output/js/ff/core/Random.mjs +4 -4
  58. package/output/js/ff/core/RbMap.mjs +56 -644
  59. package/output/js/ff/core/Show.mjs +0 -16
  60. package/output/js/ff/core/Stream.mjs +14 -144
  61. package/output/js/ff/core/StringMap.mjs +0 -8
  62. package/output/js/ff/core/Try.mjs +4 -108
  63. package/output/js/ff/core/Unit.mjs +2 -16
  64. package/package.json +1 -1
  65. package/postgresql/Pg.ff +23 -23
  66. package/vscode/client/src/extension.ts +30 -2
  67. package/vscode/package.json +17 -1
  68. package/core/Stack.ff +0 -250
@@ -292,135 +292,90 @@ return ff_core_Any.internalAnyTag_((("ff:compiler/Workspace.WorkspaceRule" + "["
292
292
 
293
293
  export const ff_core_Show_Show$ff_compiler_Workspace_Workspace = {
294
294
  show_(value_) {
295
- {
296
295
  const value_a = value_;
297
296
  {
298
297
  const z_ = value_a;
299
298
  return ((((((("Workspace" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_compiler_Workspace.ff_core_Show_Show$ff_compiler_Workspace_WorkspaceRule).show_(z_.rules_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.defaultLocation_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageDirectory_)) + ")")
300
- return
301
- }
302
299
  }
303
300
  },
304
301
  async show_$(value_, $task) {
305
- {
306
302
  const value_a = value_;
307
303
  {
308
304
  const z_ = value_a;
309
305
  return ((((((("Workspace" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_compiler_Workspace.ff_core_Show_Show$ff_compiler_Workspace_WorkspaceRule).show_(z_.rules_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.defaultLocation_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageDirectory_)) + ")")
310
- return
311
- }
312
306
  }
313
307
  }
314
308
  };
315
309
 
316
310
  export const ff_core_Show_Show$ff_compiler_Workspace_WorkspaceRule = {
317
311
  show_(value_) {
318
- {
319
312
  const value_a = value_;
320
313
  {
321
314
  const z_ = value_a;
322
315
  return ((((((("WorkspaceRule" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageGroup_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.packageName_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.location_)) + ")")
323
- return
324
- }
325
316
  }
326
317
  },
327
318
  async show_$(value_, $task) {
328
- {
329
319
  const value_a = value_;
330
320
  {
331
321
  const z_ = value_a;
332
322
  return ((((((("WorkspaceRule" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageGroup_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.packageName_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.location_)) + ")")
333
- return
334
- }
335
323
  }
336
324
  }
337
325
  };
338
326
 
339
327
  export const ff_core_Equal_Equal$ff_compiler_Workspace_Workspace = {
340
328
  equals_(x_, y_) {
341
- {
342
329
  const x_a = x_;
343
330
  const y_a = y_;
344
- {
345
- const _guard1 = (x_ === y_);
346
- if(_guard1) {
331
+ if((x_ === y_)) {
347
332
  return true
348
- return
349
- }
350
333
  }
351
334
  {
352
335
  return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_compiler_Workspace.ff_core_Equal_Equal$ff_compiler_Workspace_WorkspaceRule).equals_(x_.rules_, y_.rules_) && ((x_.defaultLocation_ === y_.defaultLocation_) && (x_.packageDirectory_ === y_.packageDirectory_)))
353
- return
354
- }
355
336
  }
356
337
  },
357
338
  async equals_$(x_, y_, $task) {
358
- {
359
339
  const x_a = x_;
360
340
  const y_a = y_;
361
- {
362
- const _guard1 = (x_ === y_);
363
- if(_guard1) {
341
+ if((x_ === y_)) {
364
342
  return true
365
- return
366
- }
367
343
  }
368
344
  {
369
345
  return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_compiler_Workspace.ff_core_Equal_Equal$ff_compiler_Workspace_WorkspaceRule).equals_(x_.rules_, y_.rules_) && ((x_.defaultLocation_ === y_.defaultLocation_) && (x_.packageDirectory_ === y_.packageDirectory_)))
370
- return
371
- }
372
346
  }
373
347
  }
374
348
  };
375
349
 
376
350
  export const ff_core_Equal_Equal$ff_compiler_Workspace_WorkspaceRule = {
377
351
  equals_(x_, y_) {
378
- {
379
352
  const x_a = x_;
380
353
  const y_a = y_;
381
- {
382
- const _guard1 = (x_ === y_);
383
- if(_guard1) {
354
+ if((x_ === y_)) {
384
355
  return true
385
- return
386
- }
387
356
  }
388
357
  {
389
358
  return ((x_.packageGroup_ === y_.packageGroup_) && (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.packageName_, y_.packageName_) && (x_.location_ === y_.location_)))
390
- return
391
- }
392
359
  }
393
360
  },
394
361
  async equals_$(x_, y_, $task) {
395
- {
396
362
  const x_a = x_;
397
363
  const y_a = y_;
398
- {
399
- const _guard1 = (x_ === y_);
400
- if(_guard1) {
364
+ if((x_ === y_)) {
401
365
  return true
402
- return
403
- }
404
366
  }
405
367
  {
406
368
  return ((x_.packageGroup_ === y_.packageGroup_) && (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.packageName_, y_.packageName_) && (x_.location_ === y_.location_)))
407
- return
408
- }
409
369
  }
410
370
  }
411
371
  };
412
372
 
413
373
  export const ff_core_Ordering_Order$ff_compiler_Workspace_Workspace = {
414
374
  compare_(x_, y_) {
415
- {
416
375
  const x_a = x_;
417
376
  const y_a = y_;
418
- {
419
- const _guard1 = (x_ === y_);
420
- if(_guard1) {
377
+ if((x_ === y_)) {
421
378
  return ff_core_Ordering.OrderingSame()
422
- return
423
- }
424
379
  }
425
380
  {
426
381
  const rulesOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_compiler_Workspace.ff_core_Ordering_Order$ff_compiler_Workspace_WorkspaceRule).compare_(x_.rules_, y_.rules_);
@@ -441,18 +396,12 @@ return ff_core_Ordering.OrderingSame()
441
396
  }
442
397
  return
443
398
  }
444
- }
445
399
  },
446
400
  async compare_$(x_, y_, $task) {
447
- {
448
401
  const x_a = x_;
449
402
  const y_a = y_;
450
- {
451
- const _guard1 = (x_ === y_);
452
- if(_guard1) {
403
+ if((x_ === y_)) {
453
404
  return ff_core_Ordering.OrderingSame()
454
- return
455
- }
456
405
  }
457
406
  {
458
407
  const rulesOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_compiler_Workspace.ff_core_Ordering_Order$ff_compiler_Workspace_WorkspaceRule).compare_(x_.rules_, y_.rules_);
@@ -474,20 +423,14 @@ return ff_core_Ordering.OrderingSame()
474
423
  return
475
424
  }
476
425
  }
477
- }
478
426
  };
479
427
 
480
428
  export const ff_core_Ordering_Order$ff_compiler_Workspace_WorkspaceRule = {
481
429
  compare_(x_, y_) {
482
- {
483
430
  const x_a = x_;
484
431
  const y_a = y_;
485
- {
486
- const _guard1 = (x_ === y_);
487
- if(_guard1) {
432
+ if((x_ === y_)) {
488
433
  return ff_core_Ordering.OrderingSame()
489
- return
490
- }
491
434
  }
492
435
  {
493
436
  const packageGroupOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageGroup_, y_.packageGroup_);
@@ -508,18 +451,12 @@ return ff_core_Ordering.OrderingSame()
508
451
  }
509
452
  return
510
453
  }
511
- }
512
454
  },
513
455
  async compare_$(x_, y_, $task) {
514
- {
515
456
  const x_a = x_;
516
457
  const y_a = y_;
517
- {
518
- const _guard1 = (x_ === y_);
519
- if(_guard1) {
458
+ if((x_ === y_)) {
520
459
  return ff_core_Ordering.OrderingSame()
521
- return
522
- }
523
460
  }
524
461
  {
525
462
  const packageGroupOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageGroup_, y_.packageGroup_);
@@ -541,12 +478,10 @@ return ff_core_Ordering.OrderingSame()
541
478
  return
542
479
  }
543
480
  }
544
- }
545
481
  };
546
482
 
547
483
  export const ff_core_Serializable_Serializable$ff_compiler_Workspace_Workspace = {
548
484
  serializeUsing_(serialization_, value_) {
549
- {
550
485
  const serialization_a = serialization_;
551
486
  const value_a = value_;
552
487
  {
@@ -560,28 +495,22 @@ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.ser
560
495
  ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageDirectory_)
561
496
  return
562
497
  }
563
- }
564
498
  },
565
499
  deserializeUsing_(serialization_) {
566
500
  const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
567
501
  serialization_.offset_ += 1;
568
502
  {
569
503
  const _1 = variantIndex_;
570
- {
571
504
  if(_1 === 0) {
572
505
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
573
506
  return ff_compiler_Workspace.Workspace(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
574
- return
575
- }
576
507
  }
577
508
  {
578
509
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
579
- return
580
510
  }
581
511
  }
582
512
  },
583
513
  async serializeUsing_$(serialization_, value_, $task) {
584
- {
585
514
  const serialization_a = serialization_;
586
515
  const value_a = value_;
587
516
  {
@@ -595,23 +524,18 @@ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.ser
595
524
  ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageDirectory_)
596
525
  return
597
526
  }
598
- }
599
527
  },
600
528
  async deserializeUsing_$(serialization_, $task) {
601
529
  const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
602
530
  serialization_.offset_ += 1;
603
531
  {
604
532
  const _1 = variantIndex_;
605
- {
606
533
  if(_1 === 0) {
607
534
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
608
535
  return ff_compiler_Workspace.Workspace(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
609
- return
610
- }
611
536
  }
612
537
  {
613
538
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
614
- return
615
539
  }
616
540
  }
617
541
  }
@@ -619,7 +543,6 @@ return
619
543
 
620
544
  export const ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule = {
621
545
  serializeUsing_(serialization_, value_) {
622
- {
623
546
  const serialization_a = serialization_;
624
547
  const value_a = value_;
625
548
  {
@@ -633,28 +556,22 @@ ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_S
633
556
  ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.location_)
634
557
  return
635
558
  }
636
- }
637
559
  },
638
560
  deserializeUsing_(serialization_) {
639
561
  const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
640
562
  serialization_.offset_ += 1;
641
563
  {
642
564
  const _1 = variantIndex_;
643
- {
644
565
  if(_1 === 0) {
645
566
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
646
567
  return ff_compiler_Workspace.WorkspaceRule(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_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
647
- return
648
- }
649
568
  }
650
569
  {
651
570
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
652
- return
653
571
  }
654
572
  }
655
573
  },
656
574
  async serializeUsing_$(serialization_, value_, $task) {
657
- {
658
575
  const serialization_a = serialization_;
659
576
  const value_a = value_;
660
577
  {
@@ -668,23 +585,18 @@ ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_S
668
585
  ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.location_)
669
586
  return
670
587
  }
671
- }
672
588
  },
673
589
  async deserializeUsing_$(serialization_, $task) {
674
590
  const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
675
591
  serialization_.offset_ += 1;
676
592
  {
677
593
  const _1 = variantIndex_;
678
- {
679
594
  if(_1 === 0) {
680
595
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
681
596
  return ff_compiler_Workspace.WorkspaceRule(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_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
682
- return
683
- }
684
597
  }
685
598
  {
686
599
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
687
- return
688
600
  }
689
601
  }
690
602
  }
@@ -127,10 +127,10 @@ ff_core_Array.sortRange_(array_, compare_, middle_, end_);
127
127
  let i_ = start_;
128
128
  let j_ = middle_;
129
129
  while(((i_ < middle_) && (j_ < end_))) {
130
- if((compare_(ff_core_Array.Array_grab(array_, i_), ff_core_Array.Array_grab(array_, j_)) !== ff_core_Ordering.OrderingAfter())) {
130
+ if((compare_((array_.array[i_] ?? ff_core_Array.internalGrab_(array_, i_)), (array_.array[j_] ?? ff_core_Array.internalGrab_(array_, j_))) !== ff_core_Ordering.OrderingAfter())) {
131
131
  i_ += 1
132
132
  } else {
133
- const value_ = ff_core_Array.Array_grab(array_, j_);
133
+ const value_ = (array_.array[j_] ?? ff_core_Array.internalGrab_(array_, j_));
134
134
  let k_ = j_;
135
135
  while((k_ > i_)) {
136
136
  ff_core_Array.Array_set(array_, k_, ff_core_Array.Array_grab(array_, (k_ - 1)));
@@ -145,6 +145,12 @@ j_ += 1
145
145
  }
146
146
  }
147
147
 
148
+ export function internalGrab_(self_, index_) {
149
+
150
+ return index_ < 0 || index_ >= self_.array.length ? ff_core_Try.internalThrowGrabException_() : self_.array[index_];
151
+
152
+ }
153
+
148
154
  export async function make_$($task) {
149
155
  throw new Error('Function make is missing on this target in async context.');
150
156
  }
@@ -171,10 +177,10 @@ let middle_ = (start_ + ((end_ - start_) / 2));
171
177
  let i_ = start_;
172
178
  let j_ = middle_;
173
179
  while(((i_ < middle_) && (j_ < end_))) {
174
- if(((await compare_(ff_core_Array.Array_grab(array_, i_), ff_core_Array.Array_grab(array_, j_), $task)) !== ff_core_Ordering.OrderingAfter())) {
180
+ if(((await compare_((array_.array[i_] ?? ff_core_Array.internalGrab_(array_, i_)), (array_.array[j_] ?? ff_core_Array.internalGrab_(array_, j_)), $task)) !== ff_core_Ordering.OrderingAfter())) {
175
181
  i_ += 1
176
182
  } else {
177
- const value_ = ff_core_Array.Array_grab(array_, j_);
183
+ const value_ = (array_.array[j_] ?? ff_core_Array.internalGrab_(array_, j_));
178
184
  let k_ = j_;
179
185
  while((k_ > i_)) {
180
186
  ff_core_Array.Array_set(array_, k_, ff_core_Array.Array_grab(array_, (k_ - 1)));
@@ -189,6 +195,10 @@ j_ += 1
189
195
  }
190
196
  }
191
197
 
198
+ export async function internalGrab_$(self_, index_, $task) {
199
+ throw new Error('Function internalGrab is missing on this target in async context.');
200
+ }
201
+
192
202
  export function Array_isEmpty(self_) {
193
203
  return self_.array.length === 0
194
204
  }
@@ -207,10 +217,7 @@ export function Array_get(self_, index_) {
207
217
 
208
218
  export function Array_grab(self_, index_) {
209
219
 
210
- if(index_ < 0 || index_ >= self_.array.length) {
211
- ff_core_Try.internalThrowGrabException_()
212
- }
213
- return self_.array[index_]
220
+ return self_.array[index_] ?? internalGrab_(self_, index_);
214
221
 
215
222
  }
216
223
 
@@ -122,15 +122,12 @@ const streams_ = ff_core_List.List_collect(ff_core_Map.Map_pairs(self_.files_, f
122
122
  {
123
123
  const p_ = _1.first_;
124
124
  const s_ = _1.second_;
125
- const _guard1 = ff_core_String.String_startsWith(p_, prefix_, 0);
126
- if(_guard1) {
125
+ if(ff_core_String.String_startsWith(p_, prefix_, 0)) {
127
126
  return ff_core_Option.Some(ff_core_Pair.Pair(ff_core_String.String_dropFirst(p_, (ff_core_String.String_size(prefix_) - 1)), s_))
128
- return
129
127
  }
130
128
  }
131
129
  {
132
130
  return ff_core_Option.None()
133
- return
134
131
  }
135
132
  }));
136
133
  return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(streams_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
@@ -153,8 +150,7 @@ const prefix_ = (ff_core_String.String_endsWith(path_, "/")
153
150
  return ff_core_List.List_distinct(ff_core_List.List_collect(ff_core_Map.Map_pairs(self_.files_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_1) => {
154
151
  {
155
152
  const p_ = _1.first_;
156
- const _guard1 = ff_core_String.String_startsWith(p_, prefix_, 0);
157
- if(_guard1) {
153
+ if(ff_core_String.String_startsWith(p_, prefix_, 0)) {
158
154
  return ff_core_Option.Some(ff_core_String.String_takeWhile(ff_core_String.String_dropFirst(p_, ff_core_String.String_size(prefix_)), ((_w1) => {
159
155
  return (_w1 !== 47)
160
156
  })))
@@ -163,7 +159,6 @@ return
163
159
  }
164
160
  {
165
161
  return ff_core_Option.None()
166
- return
167
162
  }
168
163
  })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
169
164
  }
@@ -205,15 +200,12 @@ const streams_ = ff_core_List.List_collect(ff_core_Map.Map_pairs(self_.files_, f
205
200
  {
206
201
  const p_ = _1.first_;
207
202
  const s_ = _1.second_;
208
- const _guard1 = ff_core_String.String_startsWith(p_, prefix_, 0);
209
- if(_guard1) {
203
+ if(ff_core_String.String_startsWith(p_, prefix_, 0)) {
210
204
  return ff_core_Option.Some(ff_core_Pair.Pair(ff_core_String.String_dropFirst(p_, (ff_core_String.String_size(prefix_) - 1)), s_))
211
- return
212
205
  }
213
206
  }
214
207
  {
215
208
  return ff_core_Option.None()
216
- return
217
209
  }
218
210
  }));
219
211
  return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(streams_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
@@ -236,8 +228,7 @@ const prefix_ = (ff_core_String.String_endsWith(path_, "/")
236
228
  return ff_core_List.List_distinct(ff_core_List.List_collect(ff_core_Map.Map_pairs(self_.files_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_1) => {
237
229
  {
238
230
  const p_ = _1.first_;
239
- const _guard1 = ff_core_String.String_startsWith(p_, prefix_, 0);
240
- if(_guard1) {
231
+ if(ff_core_String.String_startsWith(p_, prefix_, 0)) {
241
232
  return ff_core_Option.Some(ff_core_String.String_takeWhile(ff_core_String.String_dropFirst(p_, ff_core_String.String_size(prefix_)), ((_w1) => {
242
233
  return (_w1 !== 47)
243
234
  })))
@@ -246,7 +237,6 @@ return
246
237
  }
247
238
  {
248
239
  return ff_core_Option.None()
249
- return
250
240
  }
251
241
  })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
252
242
  }
@@ -109,17 +109,11 @@ return True$;
109
109
  export function Bool_toInt(self_) {
110
110
  {
111
111
  const _1 = self_;
112
- {
113
112
  if(!_1) {
114
113
  return 0
115
- return
116
- }
117
114
  }
118
- {
119
115
  if(_1) {
120
116
  return 1
121
- return
122
- }
123
117
  }
124
118
  }
125
119
  }
@@ -127,17 +121,11 @@ return
127
121
  export async function Bool_toInt$(self_, $task) {
128
122
  {
129
123
  const _1 = self_;
130
- {
131
124
  if(!_1) {
132
125
  return 0
133
- return
134
- }
135
126
  }
136
- {
137
127
  if(_1) {
138
128
  return 1
139
- return
140
- }
141
129
  }
142
130
  }
143
131
  }
@@ -101,17 +101,11 @@ return GrabException$;
101
101
  export function if_(condition_, body_) {
102
102
  {
103
103
  const _1 = condition_;
104
- {
105
104
  if(!_1) {
106
105
  return ff_core_Option.None()
107
- return
108
106
  }
109
- }
110
- {
111
107
  if(_1) {
112
108
  return ff_core_Option.Some(body_())
113
- return
114
- }
115
109
  }
116
110
  }
117
111
  }
@@ -119,13 +113,10 @@ return
119
113
  export function while_(condition_, body_) {
120
114
  {
121
115
  const _1 = condition_();
122
- {
123
116
  if(!_1) {
124
117
 
125
118
  return
126
119
  }
127
- }
128
- {
129
120
  if(_1) {
130
121
  body_();
131
122
  while(condition_()) {
@@ -135,7 +126,6 @@ return
135
126
  }
136
127
  }
137
128
  }
138
- }
139
129
 
140
130
  export function doWhile_(body_) {
141
131
  while(body_()) {
@@ -147,14 +137,10 @@ export function doUntil_(body_) {
147
137
  _tailcall: for(;;) {
148
138
  {
149
139
  const _1 = body_();
150
- {
151
140
  if(_1.Some) {
152
141
  const v_ = _1.value_;
153
142
  return v_
154
- return
155
143
  }
156
- }
157
- {
158
144
  if(_1.None) {
159
145
  {
160
146
  const body_r_ = body_;
@@ -164,7 +150,6 @@ continue _tailcall
164
150
  return
165
151
  }
166
152
  }
167
- }
168
153
  return
169
154
  }
170
155
  }
@@ -202,17 +187,11 @@ return x_ === y_
202
187
  export async function if_$(condition_, body_, $task) {
203
188
  {
204
189
  const _1 = condition_;
205
- {
206
190
  if(!_1) {
207
191
  return ff_core_Option.None()
208
- return
209
192
  }
210
- }
211
- {
212
193
  if(_1) {
213
194
  return ff_core_Option.Some((await body_($task)))
214
- return
215
- }
216
195
  }
217
196
  }
218
197
  }
@@ -220,13 +199,10 @@ return
220
199
  export async function while_$(condition_, body_, $task) {
221
200
  {
222
201
  const _1 = (await condition_($task));
223
- {
224
202
  if(!_1) {
225
203
 
226
204
  return
227
205
  }
228
- }
229
- {
230
206
  if(_1) {
231
207
  (await body_($task));
232
208
  while((await condition_($task))) {
@@ -236,7 +212,6 @@ return
236
212
  }
237
213
  }
238
214
  }
239
- }
240
215
 
241
216
  export async function doWhile_$(body_, $task) {
242
217
  while((await body_($task))) {
@@ -248,14 +223,10 @@ export async function doUntil_$(body_, $task) {
248
223
  _tailcall: for(;;) {
249
224
  {
250
225
  const _1 = (await body_($task));
251
- {
252
226
  if(_1.Some) {
253
227
  const v_ = _1.value_;
254
228
  return v_
255
- return
256
229
  }
257
- }
258
- {
259
230
  if(_1.None) {
260
231
  {
261
232
  const body_r_ = body_;
@@ -265,7 +236,6 @@ continue _tailcall
265
236
  return
266
237
  }
267
238
  }
268
- }
269
239
  return
270
240
  }
271
241
  }
@@ -132,23 +132,23 @@ return signed_ ? self_ >> bits_ : self_ >>> bits_;
132
132
  }
133
133
 
134
134
  export function Int_to(self_, inclusiveEnd_) {
135
- let result_ = [];
136
- let n_ = inclusiveEnd_;
137
- while((self_ <= n_)) {
138
- result_ = [n_, ...result_];
139
- n_ -= 1
135
+ const result_ = ff_core_Array.make_();
136
+ let n_ = self_;
137
+ while((n_ <= inclusiveEnd_)) {
138
+ ff_core_Array.Array_push(result_, n_);
139
+ n_ += 1
140
140
  };
141
- return result_
141
+ return ff_core_Array.Array_drain(result_)
142
142
  }
143
143
 
144
144
  export function Int_until(self_, exclusiveEnd_) {
145
- let result_ = [];
146
- let n_ = exclusiveEnd_;
147
- while((self_ < n_)) {
148
- result_ = [(n_ - 1), ...result_];
149
- n_ -= 1
145
+ const result_ = ff_core_Array.make_();
146
+ let n_ = self_;
147
+ while((n_ < exclusiveEnd_)) {
148
+ ff_core_Array.Array_push(result_, n_);
149
+ n_ += 1
150
150
  };
151
- return result_
151
+ return ff_core_Array.Array_drain(result_)
152
152
  }
153
153
 
154
154
  export function Int_min(self_, that_) {
@@ -214,23 +214,23 @@ throw new Error('Function Int_bitRight is missing on this target in async contex
214
214
  }
215
215
 
216
216
  export async function Int_to$(self_, inclusiveEnd_, $task) {
217
- let result_ = [];
218
- let n_ = inclusiveEnd_;
219
- while((self_ <= n_)) {
220
- result_ = [n_, ...result_];
221
- n_ -= 1
217
+ const result_ = ff_core_Array.make_();
218
+ let n_ = self_;
219
+ while((n_ <= inclusiveEnd_)) {
220
+ ff_core_Array.Array_push(result_, n_);
221
+ n_ += 1
222
222
  };
223
- return result_
223
+ return ff_core_Array.Array_drain(result_)
224
224
  }
225
225
 
226
226
  export async function Int_until$(self_, exclusiveEnd_, $task) {
227
- let result_ = [];
228
- let n_ = exclusiveEnd_;
229
- while((self_ < n_)) {
230
- result_ = [(n_ - 1), ...result_];
231
- n_ -= 1
227
+ const result_ = ff_core_Array.make_();
228
+ let n_ = self_;
229
+ while((n_ < exclusiveEnd_)) {
230
+ ff_core_Array.Array_push(result_, n_);
231
+ n_ += 1
232
232
  };
233
- return result_
233
+ return ff_core_Array.Array_drain(result_)
234
234
  }
235
235
 
236
236
  export async function Int_min$(self_, that_, $task) {