firefly-compiler 0.4.30 → 0.4.31
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 +0 -1
- package/compiler/Inference.ff +31 -1
- package/compiler/Tokenizer.ff +0 -1
- package/compiler/Unification.ff +0 -1
- package/experimental/random/Units.ff +36 -0
- package/lsp/Handler.ff +0 -1
- package/lsp/TestReferences.ff +1 -1
- package/lux/Lux.ff +0 -1
- package/output/js/ff/compiler/Inference.mjs +244 -2
- package/output/js/ff/compiler/Main.mjs +2 -2
- package/output/js/ff/compiler/ModuleCache.mjs +2 -2
- package/output/js/ff/compiler/Patterns.mjs +2 -2
- package/output/js/ff/core/Task.mjs +4 -4
- package/package.json +1 -1
- package/vscode/package.json +1 -1
package/compiler/Builder.ff
CHANGED
package/compiler/Inference.ff
CHANGED
|
@@ -462,9 +462,39 @@ extend self: Inference {
|
|
|
462
462
|
)
|
|
463
463
|
}
|
|
464
464
|
| _ =>
|
|
465
|
+
let unitName = core("Unit")
|
|
466
|
+
function semicolonUnit(body: Term): Term {
|
|
467
|
+
| ECall e {e.target | DynamicCall c} {c.function | EVariable x} {
|
|
468
|
+
x.name == "ff:core/Core.if" || x.name == "ff:core/Core.try"
|
|
469
|
+
} =>
|
|
470
|
+
e.ECall(arguments = e.arguments.map {
|
|
471
|
+
| Argument a {a.value | ELambda l} =>
|
|
472
|
+
a.Argument(value = l.ELambda(lambda =
|
|
473
|
+
l.lambda.Lambda(cases = l.lambda.cases.map {c =>
|
|
474
|
+
c.MatchCase(body =
|
|
475
|
+
ESequential(c.at, c.body, EVariant(c.at, unitName, [], None))
|
|
476
|
+
)
|
|
477
|
+
})
|
|
478
|
+
))
|
|
479
|
+
| a => a
|
|
480
|
+
})
|
|
481
|
+
| ECall e {e.target | DynamicCall c} {c.function | EField f} {
|
|
482
|
+
f.field == "else" || f.field == "elseIf" || f.field == "grab" ||
|
|
483
|
+
f.field == "catch" || f.field == "catchAny" || f.field == "finally"
|
|
484
|
+
} =>
|
|
485
|
+
e.ECall(target = c.DynamicCall(function = f.EField(record = semicolonUnit(f.record))))
|
|
486
|
+
| ESequential e =>
|
|
487
|
+
e.ESequential(after = semicolonUnit(e.after))
|
|
488
|
+
| ELet e =>
|
|
489
|
+
e.ELet(body = semicolonUnit(e.body))
|
|
490
|
+
| EFunctions e =>
|
|
491
|
+
e.EFunctions(body = semicolonUnit(e.body))
|
|
492
|
+
| _ =>
|
|
493
|
+
body
|
|
494
|
+
}
|
|
465
495
|
ESequential(
|
|
466
496
|
at = at
|
|
467
|
-
before = self.inferTerm(environment, newExpected, before)
|
|
497
|
+
before = self.inferTerm(environment, newExpected, semicolonUnit(before))
|
|
468
498
|
after = self.inferTerm(environment, expected, after)
|
|
469
499
|
)
|
|
470
500
|
}
|
package/compiler/Tokenizer.ff
CHANGED
|
@@ -83,7 +83,6 @@ tokenize(file: String, code: String, completionAt: Option[Location], attemptFixe
|
|
|
83
83
|
if(i + 1 < code.size() && code.grab(i) == '_') {i += 1}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
Unit // Think about how to avoid requiring this
|
|
87
86
|
} else {
|
|
88
87
|
while {i < code.size() && (code.grab(i) == ' ' || code.grab(i) == '\t' || code.grab(i) == '\r')} {i += 1}
|
|
89
88
|
}
|
package/compiler/Unification.ff
CHANGED
|
@@ -173,7 +173,6 @@ extend self: Unification {
|
|
|
173
173
|
generics1.dropLast().zip(generics2.dropLast()).each {| Pair(t3, t4) => self.unify(at, t3, t4)}
|
|
174
174
|
generics1.takeLast().zip(generics2.takeLast()).each {| Pair(t3, t4) => self.unify(at, t3, t4)}
|
|
175
175
|
}
|
|
176
|
-
Unit // TODO: Think about how to avoid writing this
|
|
177
176
|
} else {
|
|
178
177
|
generics1.zip(generics2).each {| Pair(t1, t2) => self.unify(at, t1, t2) }
|
|
179
178
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
nodeMain(system: NodeSystem) {
|
|
3
|
+
if(True) {
|
|
4
|
+
1 + 1
|
|
5
|
+
} else {
|
|
6
|
+
"foo"
|
|
7
|
+
}
|
|
8
|
+
if(True) {
|
|
9
|
+
1
|
|
10
|
+
} elseIf {False} {
|
|
11
|
+
'x'
|
|
12
|
+
} else {
|
|
13
|
+
"foo"
|
|
14
|
+
}
|
|
15
|
+
if(True) {
|
|
16
|
+
if(True) {
|
|
17
|
+
1
|
|
18
|
+
} else {
|
|
19
|
+
"foo"
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
"foo"
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
1
|
|
26
|
+
} catchAny {_ =>
|
|
27
|
+
"foo"
|
|
28
|
+
} grab()
|
|
29
|
+
[1, 2, 3].each {_ =>
|
|
30
|
+
try {
|
|
31
|
+
if(False) {1} else {2}
|
|
32
|
+
} catchAny {_ =>
|
|
33
|
+
"foo"
|
|
34
|
+
} grab()
|
|
35
|
+
}
|
|
36
|
+
}
|
package/lsp/Handler.ff
CHANGED
|
@@ -382,7 +382,6 @@ extend self: Handler {
|
|
|
382
382
|
let tokens = Tokenizer.tokenize(cursorAt.file, code, None, True)
|
|
383
383
|
let parser = Parser.make(PackagePair("script", "script"), cursorAt.file, tokens, False, lspHook)
|
|
384
384
|
parser.parseModuleWithPackageInfo()
|
|
385
|
-
Unit // Think of a way to avoid writing this
|
|
386
385
|
} catch {| CompileError(at, message), error =>
|
|
387
386
|
Log.trace("handleSignatureHelp check error: " + message)
|
|
388
387
|
} grab()
|
package/lsp/TestReferences.ff
CHANGED
|
@@ -9,7 +9,7 @@ nodeMain(system: NodeSystem) {
|
|
|
9
9
|
let cache = ModuleCache.empty(0)
|
|
10
10
|
let handler = Handler(fireflyPath, None, Map.empty(), [].toSet(), Map.empty(), Map.empty(), cache)
|
|
11
11
|
let targetAt = Location("/home/werk/projects/firefly-boot/lsp/TestReferencesCase.ff", 7, 5)
|
|
12
|
-
let references = handler.findReferences(system, targetAt, local = False, includeDeclaration = True)
|
|
12
|
+
let references = handler.findReferences(system, targetAt, local = False, includeDeclaration = True, version = 0)
|
|
13
13
|
Log.show(references)
|
|
14
14
|
references.each {_.each {r =>
|
|
15
15
|
Log.show(r)
|
package/lux/Lux.ff
CHANGED
|
@@ -831,7 +831,128 @@ return ff_compiler_Syntax.ESequential(at_, ff_compiler_Inference.Inference_infer
|
|
|
831
831
|
return
|
|
832
832
|
}
|
|
833
833
|
{
|
|
834
|
-
|
|
834
|
+
const unitName_ = ff_compiler_Inference.core_("Unit");
|
|
835
|
+
function semicolonUnit_(body_) {
|
|
836
|
+
const body_a = body_;
|
|
837
|
+
if(body_a.ECall) {
|
|
838
|
+
const e_ = body_a;
|
|
839
|
+
const _guard3 = e_.target_;
|
|
840
|
+
if(_guard3.DynamicCall) {
|
|
841
|
+
const c_ = _guard3;
|
|
842
|
+
const _guard2 = c_.function_;
|
|
843
|
+
if(_guard2.EVariable) {
|
|
844
|
+
const x_ = _guard2;
|
|
845
|
+
if(((x_.name_ === "ff:core/Core.if") || (x_.name_ === "ff:core/Core.try"))) {
|
|
846
|
+
{
|
|
847
|
+
const _1 = e_;
|
|
848
|
+
{
|
|
849
|
+
const _c = _1;
|
|
850
|
+
return ff_compiler_Syntax.ECall(_c.at_, _c.target_, _c.effect_, _c.typeArguments_, ff_core_List.List_map(e_.arguments_, ((_1) => {
|
|
851
|
+
{
|
|
852
|
+
const a_ = _1;
|
|
853
|
+
const _guard1 = a_.value_;
|
|
854
|
+
if(_guard1.ELambda) {
|
|
855
|
+
const l_ = _guard1;
|
|
856
|
+
{
|
|
857
|
+
const _1 = a_;
|
|
858
|
+
{
|
|
859
|
+
const _c = _1;
|
|
860
|
+
return ff_compiler_Syntax.Argument(_c.at_, _c.name_, (((_c) => {
|
|
861
|
+
return ff_compiler_Syntax.ELambda(_c.at_, (((_c) => {
|
|
862
|
+
return ff_compiler_Syntax.Lambda(_c.at_, _c.effect_, ff_core_List.List_map(l_.lambda_.cases_, ((c_) => {
|
|
863
|
+
{
|
|
864
|
+
const _1 = c_;
|
|
865
|
+
{
|
|
866
|
+
const _c = _1;
|
|
867
|
+
return ff_compiler_Syntax.MatchCase(_c.at_, _c.patterns_, _c.guards_, ff_compiler_Syntax.ESequential(c_.at_, c_.body_, ff_compiler_Syntax.EVariant(c_.at_, unitName_, [], ff_core_Option.None())))
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
})))
|
|
871
|
+
}))(l_.lambda_))
|
|
872
|
+
}))(l_))
|
|
873
|
+
return
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
return
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
{
|
|
880
|
+
const a_ = _1;
|
|
881
|
+
return a_
|
|
882
|
+
}
|
|
883
|
+
})), _c.dictionaries_)
|
|
884
|
+
return
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
return
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
if(body_a.ECall) {
|
|
893
|
+
const e_ = body_a;
|
|
894
|
+
const _guard3 = e_.target_;
|
|
895
|
+
if(_guard3.DynamicCall) {
|
|
896
|
+
const c_ = _guard3;
|
|
897
|
+
const _guard2 = c_.function_;
|
|
898
|
+
if(_guard2.EField) {
|
|
899
|
+
const f_ = _guard2;
|
|
900
|
+
if(((((((f_.field_ === "else") || (f_.field_ === "elseIf")) || (f_.field_ === "grab")) || (f_.field_ === "catch")) || (f_.field_ === "catchAny")) || (f_.field_ === "finally"))) {
|
|
901
|
+
{
|
|
902
|
+
const _1 = e_;
|
|
903
|
+
{
|
|
904
|
+
const _c = _1;
|
|
905
|
+
return ff_compiler_Syntax.ECall(_c.at_, (((_c) => {
|
|
906
|
+
return ff_compiler_Syntax.DynamicCall((((_c) => {
|
|
907
|
+
return ff_compiler_Syntax.EField(_c.at_, _c.newtype_, semicolonUnit_(f_.record_), _c.field_)
|
|
908
|
+
}))(f_), _c.tailCall_)
|
|
909
|
+
}))(c_), _c.effect_, _c.typeArguments_, _c.arguments_, _c.dictionaries_)
|
|
910
|
+
return
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
return
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
if(body_a.ESequential) {
|
|
919
|
+
const e_ = body_a;
|
|
920
|
+
{
|
|
921
|
+
const _1 = e_;
|
|
922
|
+
{
|
|
923
|
+
const _c = _1;
|
|
924
|
+
return ff_compiler_Syntax.ESequential(_c.at_, _c.before_, semicolonUnit_(e_.after_))
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
return
|
|
928
|
+
}
|
|
929
|
+
if(body_a.ELet) {
|
|
930
|
+
const e_ = body_a;
|
|
931
|
+
{
|
|
932
|
+
const _1 = e_;
|
|
933
|
+
{
|
|
934
|
+
const _c = _1;
|
|
935
|
+
return ff_compiler_Syntax.ELet(_c.at_, _c.mutable_, _c.name_, _c.valueType_, _c.value_, semicolonUnit_(e_.body_))
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
return
|
|
939
|
+
}
|
|
940
|
+
if(body_a.EFunctions) {
|
|
941
|
+
const e_ = body_a;
|
|
942
|
+
{
|
|
943
|
+
const _1 = e_;
|
|
944
|
+
{
|
|
945
|
+
const _c = _1;
|
|
946
|
+
return ff_compiler_Syntax.EFunctions(_c.at_, _c.functions_, semicolonUnit_(e_.body_))
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
return
|
|
950
|
+
}
|
|
951
|
+
{
|
|
952
|
+
return body_
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
return ff_compiler_Syntax.ESequential(at_, ff_compiler_Inference.Inference_inferTerm(self_, environment_, newExpected_, semicolonUnit_(before_)), ff_compiler_Inference.Inference_inferTerm(self_, environment_, expected_, after_))
|
|
835
956
|
}
|
|
836
957
|
}
|
|
837
958
|
return
|
|
@@ -2508,7 +2629,128 @@ return ff_compiler_Syntax.ESequential(at_, ff_compiler_Inference.Inference_infer
|
|
|
2508
2629
|
return
|
|
2509
2630
|
}
|
|
2510
2631
|
{
|
|
2511
|
-
|
|
2632
|
+
const unitName_ = ff_compiler_Inference.core_("Unit");
|
|
2633
|
+
function semicolonUnit_(body_) {
|
|
2634
|
+
const body_a = body_;
|
|
2635
|
+
if(body_a.ECall) {
|
|
2636
|
+
const e_ = body_a;
|
|
2637
|
+
const _guard3 = e_.target_;
|
|
2638
|
+
if(_guard3.DynamicCall) {
|
|
2639
|
+
const c_ = _guard3;
|
|
2640
|
+
const _guard2 = c_.function_;
|
|
2641
|
+
if(_guard2.EVariable) {
|
|
2642
|
+
const x_ = _guard2;
|
|
2643
|
+
if(((x_.name_ === "ff:core/Core.if") || (x_.name_ === "ff:core/Core.try"))) {
|
|
2644
|
+
{
|
|
2645
|
+
const _1 = e_;
|
|
2646
|
+
{
|
|
2647
|
+
const _c = _1;
|
|
2648
|
+
return ff_compiler_Syntax.ECall(_c.at_, _c.target_, _c.effect_, _c.typeArguments_, ff_core_List.List_map(e_.arguments_, ((_1) => {
|
|
2649
|
+
{
|
|
2650
|
+
const a_ = _1;
|
|
2651
|
+
const _guard1 = a_.value_;
|
|
2652
|
+
if(_guard1.ELambda) {
|
|
2653
|
+
const l_ = _guard1;
|
|
2654
|
+
{
|
|
2655
|
+
const _1 = a_;
|
|
2656
|
+
{
|
|
2657
|
+
const _c = _1;
|
|
2658
|
+
return ff_compiler_Syntax.Argument(_c.at_, _c.name_, (((_c) => {
|
|
2659
|
+
return ff_compiler_Syntax.ELambda(_c.at_, (((_c) => {
|
|
2660
|
+
return ff_compiler_Syntax.Lambda(_c.at_, _c.effect_, ff_core_List.List_map(l_.lambda_.cases_, ((c_) => {
|
|
2661
|
+
{
|
|
2662
|
+
const _1 = c_;
|
|
2663
|
+
{
|
|
2664
|
+
const _c = _1;
|
|
2665
|
+
return ff_compiler_Syntax.MatchCase(_c.at_, _c.patterns_, _c.guards_, ff_compiler_Syntax.ESequential(c_.at_, c_.body_, ff_compiler_Syntax.EVariant(c_.at_, unitName_, [], ff_core_Option.None())))
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
})))
|
|
2669
|
+
}))(l_.lambda_))
|
|
2670
|
+
}))(l_))
|
|
2671
|
+
return
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
return
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
{
|
|
2678
|
+
const a_ = _1;
|
|
2679
|
+
return a_
|
|
2680
|
+
}
|
|
2681
|
+
})), _c.dictionaries_)
|
|
2682
|
+
return
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
return
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
if(body_a.ECall) {
|
|
2691
|
+
const e_ = body_a;
|
|
2692
|
+
const _guard3 = e_.target_;
|
|
2693
|
+
if(_guard3.DynamicCall) {
|
|
2694
|
+
const c_ = _guard3;
|
|
2695
|
+
const _guard2 = c_.function_;
|
|
2696
|
+
if(_guard2.EField) {
|
|
2697
|
+
const f_ = _guard2;
|
|
2698
|
+
if(((((((f_.field_ === "else") || (f_.field_ === "elseIf")) || (f_.field_ === "grab")) || (f_.field_ === "catch")) || (f_.field_ === "catchAny")) || (f_.field_ === "finally"))) {
|
|
2699
|
+
{
|
|
2700
|
+
const _1 = e_;
|
|
2701
|
+
{
|
|
2702
|
+
const _c = _1;
|
|
2703
|
+
return ff_compiler_Syntax.ECall(_c.at_, (((_c) => {
|
|
2704
|
+
return ff_compiler_Syntax.DynamicCall((((_c) => {
|
|
2705
|
+
return ff_compiler_Syntax.EField(_c.at_, _c.newtype_, semicolonUnit_(f_.record_), _c.field_)
|
|
2706
|
+
}))(f_), _c.tailCall_)
|
|
2707
|
+
}))(c_), _c.effect_, _c.typeArguments_, _c.arguments_, _c.dictionaries_)
|
|
2708
|
+
return
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
return
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
if(body_a.ESequential) {
|
|
2717
|
+
const e_ = body_a;
|
|
2718
|
+
{
|
|
2719
|
+
const _1 = e_;
|
|
2720
|
+
{
|
|
2721
|
+
const _c = _1;
|
|
2722
|
+
return ff_compiler_Syntax.ESequential(_c.at_, _c.before_, semicolonUnit_(e_.after_))
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
return
|
|
2726
|
+
}
|
|
2727
|
+
if(body_a.ELet) {
|
|
2728
|
+
const e_ = body_a;
|
|
2729
|
+
{
|
|
2730
|
+
const _1 = e_;
|
|
2731
|
+
{
|
|
2732
|
+
const _c = _1;
|
|
2733
|
+
return ff_compiler_Syntax.ELet(_c.at_, _c.mutable_, _c.name_, _c.valueType_, _c.value_, semicolonUnit_(e_.body_))
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
return
|
|
2737
|
+
}
|
|
2738
|
+
if(body_a.EFunctions) {
|
|
2739
|
+
const e_ = body_a;
|
|
2740
|
+
{
|
|
2741
|
+
const _1 = e_;
|
|
2742
|
+
{
|
|
2743
|
+
const _c = _1;
|
|
2744
|
+
return ff_compiler_Syntax.EFunctions(_c.at_, _c.functions_, semicolonUnit_(e_.body_))
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
return
|
|
2748
|
+
}
|
|
2749
|
+
{
|
|
2750
|
+
return body_
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
return ff_compiler_Syntax.ESequential(at_, ff_compiler_Inference.Inference_inferTerm(self_, environment_, newExpected_, semicolonUnit_(before_)), ff_compiler_Inference.Inference_inferTerm(self_, environment_, expected_, after_))
|
|
2512
2754
|
}
|
|
2513
2755
|
}
|
|
2514
2756
|
return
|
|
@@ -227,7 +227,7 @@ return
|
|
|
227
227
|
}
|
|
228
228
|
ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch(ff_core_Try.Try_catch(ff_core_Core.try_((() => {
|
|
229
229
|
const command_ = ff_compiler_Main.parseCommandLine_(ff_core_NodeSystem.NodeSystem_arguments(system_));
|
|
230
|
-
|
|
230
|
+
runCommand_(command_)
|
|
231
231
|
})), ((_1, _2) => {
|
|
232
232
|
{
|
|
233
233
|
const message_ = _1.problem_;
|
|
@@ -475,7 +475,7 @@ return
|
|
|
475
475
|
}
|
|
476
476
|
ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch(ff_core_Try.Try_catch((await ff_core_Core.try_$((async ($task) => {
|
|
477
477
|
const command_ = ff_compiler_Main.parseCommandLine_((await ff_core_NodeSystem.NodeSystem_arguments$(system_, $task)));
|
|
478
|
-
|
|
478
|
+
(await runCommand_$(command_, $task))
|
|
479
479
|
}), $task)), ((_1, _2) => {
|
|
480
480
|
{
|
|
481
481
|
const message_ = _1.problem_;
|
|
@@ -312,7 +312,7 @@ const path_ = ff_compiler_ModuleCache.modulePath_(packagePaths_, packagePair_, m
|
|
|
312
312
|
if((!ff_core_Map.Map_contains(self_.emittedModules_, ff_core_Path.Path_absolute(path_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))) {
|
|
313
313
|
self_.emittedModules_ = ff_core_Map.Map_add(self_.emittedModules_, ff_core_Path.Path_absolute(path_), self_.version_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
314
314
|
ff_core_Try.Try_grab(ff_core_Try.Try_catchAny(ff_core_Core.try_((() => {
|
|
315
|
-
|
|
315
|
+
body_(path_)
|
|
316
316
|
})), ((error_) => {
|
|
317
317
|
self_.emittedModules_ = ff_core_Map.Map_remove(self_.emittedModules_, ff_core_Path.Path_absolute(path_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
318
318
|
ff_core_Error.Error_rethrow(error_)
|
|
@@ -485,7 +485,7 @@ const path_ = (await ff_compiler_ModuleCache.modulePath_$(packagePaths_, package
|
|
|
485
485
|
if((!ff_core_Map.Map_contains(self_.emittedModules_, (await ff_core_Path.Path_absolute$(path_, $task)), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))) {
|
|
486
486
|
self_.emittedModules_ = ff_core_Map.Map_add(self_.emittedModules_, (await ff_core_Path.Path_absolute$(path_, $task)), self_.version_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
487
487
|
ff_core_Try.Try_grab((await ff_core_Try.Try_catchAny$((await ff_core_Core.try_$((async ($task) => {
|
|
488
|
-
|
|
488
|
+
(await body_(path_, $task))
|
|
489
489
|
}), $task)), (async (error_, $task) => {
|
|
490
490
|
self_.emittedModules_ = ff_core_Map.Map_remove(self_.emittedModules_, (await ff_core_Path.Path_absolute$(path_, $task)), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
491
491
|
ff_core_Error.Error_rethrow(error_)
|
|
@@ -264,7 +264,7 @@ return ff_compiler_Patterns.PatternCaseInfo(fields_, (!exhaustiveGuards_))
|
|
|
264
264
|
export function convertAndCheck_(modules_, cases_) {
|
|
265
265
|
const converted_ = ff_compiler_Patterns.convert_(modules_, cases_);
|
|
266
266
|
ff_core_Try.Try_else(ff_core_Core.try_((() => {
|
|
267
|
-
|
|
267
|
+
ff_compiler_Patterns.check_(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], converted_, false, false)
|
|
268
268
|
})), (() => {
|
|
269
269
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_core_List.List_grab(cases_, 0).at_, "Unexhaustive match"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
270
270
|
}))
|
|
@@ -434,7 +434,7 @@ return ff_compiler_Patterns.PatternCaseInfo(fields_, (!exhaustiveGuards_))
|
|
|
434
434
|
export async function convertAndCheck_$(modules_, cases_, $task) {
|
|
435
435
|
const converted_ = ff_compiler_Patterns.convert_(modules_, cases_);
|
|
436
436
|
ff_core_Try.Try_else(ff_core_Core.try_((() => {
|
|
437
|
-
|
|
437
|
+
ff_compiler_Patterns.check_(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], converted_, false, false)
|
|
438
438
|
})), (() => {
|
|
439
439
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_core_List.List_grab(cases_, 0).at_, "Unexhaustive match"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
440
440
|
}))
|
|
@@ -231,7 +231,7 @@ return _w1.first_
|
|
|
231
231
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), ((_w1) => {
|
|
232
232
|
return _w1.second_
|
|
233
233
|
}));
|
|
234
|
-
|
|
234
|
+
ff_core_Channel.Channel_write(successChannel_, result_)
|
|
235
235
|
})), ((error_) => {
|
|
236
236
|
ff_core_Channel.Channel_write(failureChannel_, error_);
|
|
237
237
|
ff_core_Task.Task_abort(t_)
|
|
@@ -251,7 +251,7 @@ let live_ = ff_core_List.List_size(tasks_);
|
|
|
251
251
|
const started_ = ff_core_List.List_map(tasks_, ((task_) => {
|
|
252
252
|
return ff_core_Task.Task_spawn(self_, ((_) => {
|
|
253
253
|
ff_core_Try.Try_grab(ff_core_Try.Try_catchAny(ff_core_Core.try_((() => {
|
|
254
|
-
|
|
254
|
+
ff_core_Channel.Channel_write(successChannel_, task_())
|
|
255
255
|
})), ((e_) => {
|
|
256
256
|
live_ -= 1;
|
|
257
257
|
if((live_ === 0)) {
|
|
@@ -304,7 +304,7 @@ return _w1.first_
|
|
|
304
304
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), ((_w1) => {
|
|
305
305
|
return _w1.second_
|
|
306
306
|
}));
|
|
307
|
-
|
|
307
|
+
(await ff_core_Channel.Channel_write$(successChannel_, result_, $task))
|
|
308
308
|
}), $task)), (async (error_, $task) => {
|
|
309
309
|
(await ff_core_Channel.Channel_write$(failureChannel_, error_, $task));
|
|
310
310
|
(await ff_core_Task.Task_abort$(t_, $task))
|
|
@@ -324,7 +324,7 @@ let live_ = ff_core_List.List_size(tasks_);
|
|
|
324
324
|
const started_ = (await ff_core_List.List_map$(tasks_, (async (task_, $task) => {
|
|
325
325
|
return (await ff_core_Task.Task_spawn$(self_, (async (_, $task) => {
|
|
326
326
|
ff_core_Try.Try_grab((await ff_core_Try.Try_catchAny$((await ff_core_Core.try_$((async ($task) => {
|
|
327
|
-
|
|
327
|
+
(await ff_core_Channel.Channel_write$(successChannel_, (await task_($task)), $task))
|
|
328
328
|
}), $task)), (async (e_, $task) => {
|
|
329
329
|
live_ -= 1;
|
|
330
330
|
if((live_ === 0)) {
|
package/package.json
CHANGED