firefly-compiler 0.4.17 → 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 +45 -34
- 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
|
@@ -84,8 +84,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
84
84
|
|
|
85
85
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
86
86
|
|
|
87
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
88
|
-
|
|
89
87
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
90
88
|
|
|
91
89
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -146,7 +144,7 @@ return
|
|
|
146
144
|
}))(ff_core_List.List_grabFirst(definition_.typeArguments_));
|
|
147
145
|
return ff_core_Pair.Pair(ff_compiler_Unification.InstanceKey(definition_.traitName_, typeName_), ff_compiler_Unification.InstanceValue(definition_.generics_, definition_.constraints_, module_.packagePair_, moduleName_, definition_.traitName_, definition_.typeArguments_))
|
|
148
146
|
}))
|
|
149
|
-
})), ff_compiler_Unification.ff_core_Ordering_Order$ff_compiler_Unification_InstanceKey), ff_core_List.List_toMap(
|
|
147
|
+
})), ff_compiler_Unification.ff_core_Ordering_Order$ff_compiler_Unification_InstanceKey), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), attemptFixes_)
|
|
150
148
|
}
|
|
151
149
|
|
|
152
150
|
export async function fail_$(at_, message_, $task) {
|
|
@@ -175,7 +173,7 @@ return
|
|
|
175
173
|
}))(ff_core_List.List_grabFirst(definition_.typeArguments_));
|
|
176
174
|
return ff_core_Pair.Pair(ff_compiler_Unification.InstanceKey(definition_.traitName_, typeName_), ff_compiler_Unification.InstanceValue(definition_.generics_, definition_.constraints_, module_.packagePair_, moduleName_, definition_.traitName_, definition_.typeArguments_))
|
|
177
175
|
}))
|
|
178
|
-
})), ff_compiler_Unification.ff_core_Ordering_Order$ff_compiler_Unification_InstanceKey), ff_core_List.List_toMap(
|
|
176
|
+
})), ff_compiler_Unification.ff_core_Ordering_Order$ff_compiler_Unification_InstanceKey), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), attemptFixes_)
|
|
179
177
|
}
|
|
180
178
|
|
|
181
179
|
export function Unification_withLocalInstances(self_, instances_, body_) {
|
|
@@ -203,7 +201,7 @@ const type_a = type_;
|
|
|
203
201
|
if(type_a.TConstructor) {
|
|
204
202
|
const at_ = type_a.at_;
|
|
205
203
|
const name_ = type_a.name_;
|
|
206
|
-
if(type_a.generics_.
|
|
204
|
+
if(type_a.generics_.length === 0) {
|
|
207
205
|
{
|
|
208
206
|
const _1 = ff_core_Map.Map_get(instantiation_, name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
209
207
|
{
|
|
@@ -294,7 +292,7 @@ const i_ = _1.index_;
|
|
|
294
292
|
const _1 = ff_core_Map.Map_get(self_.constraints_, i_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
295
293
|
{
|
|
296
294
|
if(_1.None) {
|
|
297
|
-
self_.constraints_ = ff_core_Map.Map_add(self_.constraints_, i_, ff_core_List.List_toMap(
|
|
295
|
+
self_.constraints_ = ff_core_Map.Map_add(self_.constraints_, i_, ff_core_List.List_toMap([ff_core_Pair.Pair(constraintName_, ff_compiler_Unification.ConstraintGenerics(at_, generics_))], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int)
|
|
298
296
|
return
|
|
299
297
|
}
|
|
300
298
|
}
|
|
@@ -360,7 +358,7 @@ return ff_compiler_Unification.Unification_freshUnificationVariable(self_, at_)
|
|
|
360
358
|
}));
|
|
361
359
|
const instantiation_ = ff_core_List.List_toMap(ff_core_List.List_zip(definition_.generics_, unificationVariables_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
362
360
|
const traitType1_ = ff_compiler_Unification.Unification_instantiate(self_, instantiation_, ff_compiler_Syntax.TConstructor(at_, definition_.traitName_, definition_.typeArguments_));
|
|
363
|
-
const traitType2_ = ff_compiler_Syntax.TConstructor(at_, constraintName_,
|
|
361
|
+
const traitType2_ = ff_compiler_Syntax.TConstructor(at_, constraintName_, [type_, ...generics_]);
|
|
364
362
|
ff_compiler_Unification.Unification_unify(self_, at_, traitType1_, traitType2_);
|
|
365
363
|
ff_core_List.List_each(definition_.constraints_, ((constraint_) => {
|
|
366
364
|
{
|
|
@@ -511,7 +509,7 @@ if(((name1_ !== name2_) || (ff_core_List.List_size(generics1_) !== ff_core_List.
|
|
|
511
509
|
if((!self_.attemptFixes_)) {
|
|
512
510
|
const t3_ = ff_compiler_Unification.Unification_substitute(self_, t1_);
|
|
513
511
|
const t4_ = ff_compiler_Unification.Unification_substitute(self_, t2_);
|
|
514
|
-
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, ((("Type mismatch: " + ff_compiler_Syntax.Type_show(t3_,
|
|
512
|
+
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, ((("Type mismatch: " + ff_compiler_Syntax.Type_show(t3_, [t3_, t4_])) + " vs. ") + ff_compiler_Syntax.Type_show(t4_, [t3_, t4_]))), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
515
513
|
} else if((ff_core_String.String_startsWith(name1_, "Function$", 0) && ff_core_String.String_startsWith(name2_, "Function$", 0))) {
|
|
516
514
|
ff_core_List.List_each(ff_core_List.List_zip(ff_core_List.List_dropLast(generics1_, 1), ff_core_List.List_dropLast(generics2_, 1)), ((_1) => {
|
|
517
515
|
{
|
|
@@ -550,7 +548,7 @@ return
|
|
|
550
548
|
export function Unification_bind(self_, at_, index_, type_) {
|
|
551
549
|
if(ff_compiler_Unification.Unification_occursIn(self_, index_, type_)) {
|
|
552
550
|
const t_ = ff_compiler_Unification.Unification_substitute(self_, type_);
|
|
553
|
-
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, ((("Infinite type: " + ff_compiler_Syntax.Type_show(ff_compiler_Syntax.TVariable(at_, index_),
|
|
551
|
+
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, ((("Infinite type: " + ff_compiler_Syntax.Type_show(ff_compiler_Syntax.TVariable(at_, index_), [t_])) + " = ") + ff_compiler_Syntax.Type_show(t_, []))), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
554
552
|
};
|
|
555
553
|
self_.substitution_ = ff_core_Map.Map_add(self_.substitution_, index_, type_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
556
554
|
ff_core_Option.Option_each(ff_core_Map.Map_get(self_.constraints_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), ((map_) => {
|
|
@@ -582,7 +580,7 @@ const i1_ = _1.first_.index_;
|
|
|
582
580
|
if(_1.second_.TVariable) {
|
|
583
581
|
const i2_ = _1.second_.index_;
|
|
584
582
|
const is_ = ff_core_Option.Option_else(ff_core_Map.Map_get(self_.affects_, i1_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), (() => {
|
|
585
|
-
return ff_core_List.List_toSet(
|
|
583
|
+
return ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int)
|
|
586
584
|
}));
|
|
587
585
|
self_.affects_ = ff_core_Map.Map_add(self_.affects_, i1_, ff_core_Set.Set_add(is_, i2_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int)
|
|
588
586
|
return
|
|
@@ -591,7 +589,7 @@ return
|
|
|
591
589
|
}
|
|
592
590
|
{
|
|
593
591
|
if(_1.second_.TConstructor) {
|
|
594
|
-
if(_1.second_.name_
|
|
592
|
+
if(_1.second_.name_ === "Q$") {
|
|
595
593
|
|
|
596
594
|
return
|
|
597
595
|
}
|
|
@@ -599,7 +597,7 @@ return
|
|
|
599
597
|
}
|
|
600
598
|
{
|
|
601
599
|
if(_1.first_.TConstructor) {
|
|
602
|
-
if(_1.first_.name_
|
|
600
|
+
if(_1.first_.name_ === "ff:core/Nothing.Nothing") {
|
|
603
601
|
|
|
604
602
|
return
|
|
605
603
|
}
|
|
@@ -674,7 +672,7 @@ const type_a = type_;
|
|
|
674
672
|
if(type_a.TConstructor) {
|
|
675
673
|
const at_ = type_a.at_;
|
|
676
674
|
const name_ = type_a.name_;
|
|
677
|
-
if(type_a.generics_.
|
|
675
|
+
if(type_a.generics_.length === 0) {
|
|
678
676
|
{
|
|
679
677
|
const _1 = ff_core_Map.Map_get(instantiation_, name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
680
678
|
{
|
|
@@ -765,7 +763,7 @@ const i_ = _1.index_;
|
|
|
765
763
|
const _1 = ff_core_Map.Map_get(self_.constraints_, i_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
766
764
|
{
|
|
767
765
|
if(_1.None) {
|
|
768
|
-
self_.constraints_ = ff_core_Map.Map_add(self_.constraints_, i_, ff_core_List.List_toMap(
|
|
766
|
+
self_.constraints_ = ff_core_Map.Map_add(self_.constraints_, i_, ff_core_List.List_toMap([ff_core_Pair.Pair(constraintName_, ff_compiler_Unification.ConstraintGenerics(at_, generics_))], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int)
|
|
769
767
|
return
|
|
770
768
|
}
|
|
771
769
|
}
|
|
@@ -831,7 +829,7 @@ return ff_compiler_Unification.Unification_freshUnificationVariable(self_, at_)
|
|
|
831
829
|
}));
|
|
832
830
|
const instantiation_ = ff_core_List.List_toMap(ff_core_List.List_zip(definition_.generics_, unificationVariables_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
833
831
|
const traitType1_ = ff_compiler_Unification.Unification_instantiate(self_, instantiation_, ff_compiler_Syntax.TConstructor(at_, definition_.traitName_, definition_.typeArguments_));
|
|
834
|
-
const traitType2_ = ff_compiler_Syntax.TConstructor(at_, constraintName_,
|
|
832
|
+
const traitType2_ = ff_compiler_Syntax.TConstructor(at_, constraintName_, [type_, ...generics_]);
|
|
835
833
|
ff_compiler_Unification.Unification_unify(self_, at_, traitType1_, traitType2_);
|
|
836
834
|
ff_core_List.List_each(definition_.constraints_, ((constraint_) => {
|
|
837
835
|
{
|
|
@@ -982,7 +980,7 @@ if(((name1_ !== name2_) || (ff_core_List.List_size(generics1_) !== ff_core_List.
|
|
|
982
980
|
if((!self_.attemptFixes_)) {
|
|
983
981
|
const t3_ = ff_compiler_Unification.Unification_substitute(self_, t1_);
|
|
984
982
|
const t4_ = ff_compiler_Unification.Unification_substitute(self_, t2_);
|
|
985
|
-
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, ((("Type mismatch: " + ff_compiler_Syntax.Type_show(t3_,
|
|
983
|
+
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, ((("Type mismatch: " + ff_compiler_Syntax.Type_show(t3_, [t3_, t4_])) + " vs. ") + ff_compiler_Syntax.Type_show(t4_, [t3_, t4_]))), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
986
984
|
} else if((ff_core_String.String_startsWith(name1_, "Function$", 0) && ff_core_String.String_startsWith(name2_, "Function$", 0))) {
|
|
987
985
|
ff_core_List.List_each(ff_core_List.List_zip(ff_core_List.List_dropLast(generics1_, 1), ff_core_List.List_dropLast(generics2_, 1)), ((_1) => {
|
|
988
986
|
{
|
|
@@ -1021,7 +1019,7 @@ return
|
|
|
1021
1019
|
export async function Unification_bind$(self_, at_, index_, type_, $task) {
|
|
1022
1020
|
if(ff_compiler_Unification.Unification_occursIn(self_, index_, type_)) {
|
|
1023
1021
|
const t_ = ff_compiler_Unification.Unification_substitute(self_, type_);
|
|
1024
|
-
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, ((("Infinite type: " + ff_compiler_Syntax.Type_show(ff_compiler_Syntax.TVariable(at_, index_),
|
|
1022
|
+
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, ((("Infinite type: " + ff_compiler_Syntax.Type_show(ff_compiler_Syntax.TVariable(at_, index_), [t_])) + " = ") + ff_compiler_Syntax.Type_show(t_, []))), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
1025
1023
|
};
|
|
1026
1024
|
self_.substitution_ = ff_core_Map.Map_add(self_.substitution_, index_, type_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
1027
1025
|
ff_core_Option.Option_each(ff_core_Map.Map_get(self_.constraints_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), ((map_) => {
|
|
@@ -1053,7 +1051,7 @@ const i1_ = _1.first_.index_;
|
|
|
1053
1051
|
if(_1.second_.TVariable) {
|
|
1054
1052
|
const i2_ = _1.second_.index_;
|
|
1055
1053
|
const is_ = ff_core_Option.Option_else(ff_core_Map.Map_get(self_.affects_, i1_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), (() => {
|
|
1056
|
-
return ff_core_List.List_toSet(
|
|
1054
|
+
return ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int)
|
|
1057
1055
|
}));
|
|
1058
1056
|
self_.affects_ = ff_core_Map.Map_add(self_.affects_, i1_, ff_core_Set.Set_add(is_, i2_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int)
|
|
1059
1057
|
return
|
|
@@ -1062,7 +1060,7 @@ return
|
|
|
1062
1060
|
}
|
|
1063
1061
|
{
|
|
1064
1062
|
if(_1.second_.TConstructor) {
|
|
1065
|
-
if(_1.second_.name_
|
|
1063
|
+
if(_1.second_.name_ === "Q$") {
|
|
1066
1064
|
|
|
1067
1065
|
return
|
|
1068
1066
|
}
|
|
@@ -1070,7 +1068,7 @@ return
|
|
|
1070
1068
|
}
|
|
1071
1069
|
{
|
|
1072
1070
|
if(_1.first_.TConstructor) {
|
|
1073
|
-
if(_1.first_.name_
|
|
1071
|
+
if(_1.first_.name_ === "ff:core/Nothing.Nothing") {
|
|
1074
1072
|
|
|
1075
1073
|
return
|
|
1076
1074
|
}
|
|
@@ -1561,7 +1559,7 @@ serialization_.offset_ += 1;
|
|
|
1561
1559
|
{
|
|
1562
1560
|
const _1 = variantIndex_;
|
|
1563
1561
|
{
|
|
1564
|
-
if(_1
|
|
1562
|
+
if(_1 === 0) {
|
|
1565
1563
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 42), 0);
|
|
1566
1564
|
return ff_compiler_Unification.ConstraintGenerics(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Location.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type).deserializeUsing_(serialization_))
|
|
1567
1565
|
return
|
|
@@ -1595,7 +1593,7 @@ serialization_.offset_ += 1;
|
|
|
1595
1593
|
{
|
|
1596
1594
|
const _1 = variantIndex_;
|
|
1597
1595
|
{
|
|
1598
|
-
if(_1
|
|
1596
|
+
if(_1 === 0) {
|
|
1599
1597
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 42), 0);
|
|
1600
1598
|
return ff_compiler_Unification.ConstraintGenerics(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Location.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type).deserializeUsing_(serialization_))
|
|
1601
1599
|
return
|
|
@@ -1632,7 +1630,7 @@ serialization_.offset_ += 1;
|
|
|
1632
1630
|
{
|
|
1633
1631
|
const _1 = variantIndex_;
|
|
1634
1632
|
{
|
|
1635
|
-
if(_1
|
|
1633
|
+
if(_1 === 0) {
|
|
1636
1634
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
|
|
1637
1635
|
return ff_compiler_Unification.InstanceKey(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_))
|
|
1638
1636
|
return
|
|
@@ -1666,7 +1664,7 @@ serialization_.offset_ += 1;
|
|
|
1666
1664
|
{
|
|
1667
1665
|
const _1 = variantIndex_;
|
|
1668
1666
|
{
|
|
1669
|
-
if(_1
|
|
1667
|
+
if(_1 === 0) {
|
|
1670
1668
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
|
|
1671
1669
|
return ff_compiler_Unification.InstanceKey(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_))
|
|
1672
1670
|
return
|
|
@@ -1707,7 +1705,7 @@ serialization_.offset_ += 1;
|
|
|
1707
1705
|
{
|
|
1708
1706
|
const _1 = variantIndex_;
|
|
1709
1707
|
{
|
|
1710
|
-
if(_1
|
|
1708
|
+
if(_1 === 0) {
|
|
1711
1709
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 37), 0);
|
|
1712
1710
|
return ff_compiler_Unification.InstanceValue(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_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_PackagePair.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_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type).deserializeUsing_(serialization_))
|
|
1713
1711
|
return
|
|
@@ -1745,7 +1743,7 @@ serialization_.offset_ += 1;
|
|
|
1745
1743
|
{
|
|
1746
1744
|
const _1 = variantIndex_;
|
|
1747
1745
|
{
|
|
1748
|
-
if(_1
|
|
1746
|
+
if(_1 === 0) {
|
|
1749
1747
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 37), 0);
|
|
1750
1748
|
return ff_compiler_Unification.InstanceValue(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_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_PackagePair.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_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type).deserializeUsing_(serialization_))
|
|
1751
1749
|
return
|
|
@@ -82,8 +82,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
82
82
|
|
|
83
83
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
84
84
|
|
|
85
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
86
|
-
|
|
87
85
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
88
86
|
|
|
89
87
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -82,8 +82,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
82
82
|
|
|
83
83
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
84
84
|
|
|
85
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
86
|
-
|
|
87
85
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
88
86
|
|
|
89
87
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -118,14 +116,14 @@ return ff_compiler_Workspace.parseWorkspaceFile_(workspaceFile_, packageDirector
|
|
|
118
116
|
} else if((!ff_core_Option.Option_isEmpty(ff_core_Path.Path_parent(packageDirectory_)))) {
|
|
119
117
|
return ff_compiler_Workspace.loadWorkspace_(ff_core_Option.Option_grab(ff_core_Path.Path_parent(packageDirectory_)))
|
|
120
118
|
} else {
|
|
121
|
-
return ff_compiler_Workspace.Workspace(
|
|
119
|
+
return ff_compiler_Workspace.Workspace([], ff_compiler_Workspace.centralLocation_, ".")
|
|
122
120
|
}
|
|
123
121
|
}
|
|
124
122
|
|
|
125
123
|
export function parseWorkspaceFile_(path_, packageDirectory_) {
|
|
126
124
|
const text_ = ff_core_Path.Path_readText(path_);
|
|
127
125
|
let defaultLocation_ = ff_core_Option.None();
|
|
128
|
-
const lines_ = ff_core_List.List_filter(ff_core_List.List_map(
|
|
126
|
+
const lines_ = ff_core_List.List_filter(ff_core_List.List_map(ff_core_String.String_split(text_, 10), ((_w1) => {
|
|
129
127
|
return ff_core_String.String_takeWhile(ff_core_String.String_replace(_w1, "\r", ""), ((_w1) => {
|
|
130
128
|
return (_w1 !== 35)
|
|
131
129
|
}))
|
|
@@ -133,7 +131,7 @@ return (_w1 !== 35)
|
|
|
133
131
|
return (ff_core_String.String_size(_w1) !== 0)
|
|
134
132
|
}));
|
|
135
133
|
const rules_ = ff_core_List.List_collect(lines_, ((line_) => {
|
|
136
|
-
const columns_ = ff_core_List.List_filter(
|
|
134
|
+
const columns_ = ff_core_List.List_filter(ff_core_String.String_split(ff_core_String.String_replace(line_, "\t", " "), 32), ((_w1) => {
|
|
137
135
|
return (ff_core_String.String_size(_w1) !== 0)
|
|
138
136
|
}));
|
|
139
137
|
ff_core_Option.Option_each(defaultLocation_, ((_) => {
|
|
@@ -152,14 +150,14 @@ defaultLocation_ = ff_core_Option.Some(fixedLocation_);
|
|
|
152
150
|
return ff_core_Option.None()
|
|
153
151
|
} else {
|
|
154
152
|
const packageParts_ = ff_core_String.String_split(package_, 58);
|
|
155
|
-
if((
|
|
153
|
+
if((ff_core_List.List_size(packageParts_) !== 2)) {
|
|
156
154
|
ff_core_Core.panic_(("Could not parse workspace package: " + package_))
|
|
157
155
|
};
|
|
158
|
-
if((
|
|
156
|
+
if((ff_core_List.List_grab(packageParts_, 0) === "*")) {
|
|
159
157
|
ff_core_Core.panic_(("Unexpected wildcard: " + package_))
|
|
160
158
|
};
|
|
161
|
-
return ff_core_Option.Some(ff_compiler_Workspace.WorkspaceRule(
|
|
162
|
-
? ff_core_Option.Some(
|
|
159
|
+
return ff_core_Option.Some(ff_compiler_Workspace.WorkspaceRule(ff_core_List.List_grab(packageParts_, 0), ((ff_core_List.List_grab(packageParts_, 1) !== "*")
|
|
160
|
+
? ff_core_Option.Some(ff_core_List.List_grab(packageParts_, 1))
|
|
163
161
|
: ff_core_Option.None()), fixedLocation_))
|
|
164
162
|
}
|
|
165
163
|
}));
|
|
@@ -182,14 +180,14 @@ return (await ff_compiler_Workspace.parseWorkspaceFile_$(workspaceFile_, package
|
|
|
182
180
|
} else if((!ff_core_Option.Option_isEmpty((await ff_core_Path.Path_parent$(packageDirectory_, $task))))) {
|
|
183
181
|
return (await ff_compiler_Workspace.loadWorkspace_$(ff_core_Option.Option_grab((await ff_core_Path.Path_parent$(packageDirectory_, $task))), $task))
|
|
184
182
|
} else {
|
|
185
|
-
return ff_compiler_Workspace.Workspace(
|
|
183
|
+
return ff_compiler_Workspace.Workspace([], ff_compiler_Workspace.centralLocation_, ".")
|
|
186
184
|
}
|
|
187
185
|
}
|
|
188
186
|
|
|
189
187
|
export async function parseWorkspaceFile_$(path_, packageDirectory_, $task) {
|
|
190
188
|
const text_ = (await ff_core_Path.Path_readText$(path_, $task));
|
|
191
189
|
let defaultLocation_ = ff_core_Option.None();
|
|
192
|
-
const lines_ = ff_core_List.List_filter(ff_core_List.List_map(
|
|
190
|
+
const lines_ = ff_core_List.List_filter(ff_core_List.List_map(ff_core_String.String_split(text_, 10), ((_w1) => {
|
|
193
191
|
return ff_core_String.String_takeWhile(ff_core_String.String_replace(_w1, "\r", ""), ((_w1) => {
|
|
194
192
|
return (_w1 !== 35)
|
|
195
193
|
}))
|
|
@@ -197,7 +195,7 @@ return (_w1 !== 35)
|
|
|
197
195
|
return (ff_core_String.String_size(_w1) !== 0)
|
|
198
196
|
}));
|
|
199
197
|
const rules_ = ff_core_List.List_collect(lines_, ((line_) => {
|
|
200
|
-
const columns_ = ff_core_List.List_filter(
|
|
198
|
+
const columns_ = ff_core_List.List_filter(ff_core_String.String_split(ff_core_String.String_replace(line_, "\t", " "), 32), ((_w1) => {
|
|
201
199
|
return (ff_core_String.String_size(_w1) !== 0)
|
|
202
200
|
}));
|
|
203
201
|
ff_core_Option.Option_each(defaultLocation_, ((_) => {
|
|
@@ -216,14 +214,14 @@ defaultLocation_ = ff_core_Option.Some(fixedLocation_);
|
|
|
216
214
|
return ff_core_Option.None()
|
|
217
215
|
} else {
|
|
218
216
|
const packageParts_ = ff_core_String.String_split(package_, 58);
|
|
219
|
-
if((
|
|
217
|
+
if((ff_core_List.List_size(packageParts_) !== 2)) {
|
|
220
218
|
ff_core_Core.panic_(("Could not parse workspace package: " + package_))
|
|
221
219
|
};
|
|
222
|
-
if((
|
|
220
|
+
if((ff_core_List.List_grab(packageParts_, 0) === "*")) {
|
|
223
221
|
ff_core_Core.panic_(("Unexpected wildcard: " + package_))
|
|
224
222
|
};
|
|
225
|
-
return ff_core_Option.Some(ff_compiler_Workspace.WorkspaceRule(
|
|
226
|
-
? ff_core_Option.Some(
|
|
223
|
+
return ff_core_Option.Some(ff_compiler_Workspace.WorkspaceRule(ff_core_List.List_grab(packageParts_, 0), ((ff_core_List.List_grab(packageParts_, 1) !== "*")
|
|
224
|
+
? ff_core_Option.Some(ff_core_List.List_grab(packageParts_, 1))
|
|
227
225
|
: ff_core_Option.None()), fixedLocation_))
|
|
228
226
|
}
|
|
229
227
|
}));
|
|
@@ -570,7 +568,7 @@ serialization_.offset_ += 1;
|
|
|
570
568
|
{
|
|
571
569
|
const _1 = variantIndex_;
|
|
572
570
|
{
|
|
573
|
-
if(_1
|
|
571
|
+
if(_1 === 0) {
|
|
574
572
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
|
|
575
573
|
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_))
|
|
576
574
|
return
|
|
@@ -605,7 +603,7 @@ serialization_.offset_ += 1;
|
|
|
605
603
|
{
|
|
606
604
|
const _1 = variantIndex_;
|
|
607
605
|
{
|
|
608
|
-
if(_1
|
|
606
|
+
if(_1 === 0) {
|
|
609
607
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
|
|
610
608
|
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_))
|
|
611
609
|
return
|
|
@@ -643,7 +641,7 @@ serialization_.offset_ += 1;
|
|
|
643
641
|
{
|
|
644
642
|
const _1 = variantIndex_;
|
|
645
643
|
{
|
|
646
|
-
if(_1
|
|
644
|
+
if(_1 === 0) {
|
|
647
645
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
|
|
648
646
|
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_))
|
|
649
647
|
return
|
|
@@ -678,7 +676,7 @@ serialization_.offset_ += 1;
|
|
|
678
676
|
{
|
|
679
677
|
const _1 = variantIndex_;
|
|
680
678
|
{
|
|
681
|
-
if(_1
|
|
679
|
+
if(_1 === 0) {
|
|
682
680
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
|
|
683
681
|
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_))
|
|
684
682
|
return
|
|
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
78
78
|
|
|
79
79
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
80
|
|
|
81
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
|
-
|
|
83
81
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
84
82
|
|
|
85
83
|
import * as ff_core_String from "../../ff/core/String.mjs"
|