firefly-compiler 0.5.77 → 0.5.78
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/bin/firefly.mjs +1 -1
- package/compiler/Compiler.ff +7 -3
- package/compiler/JsEmitter.ff +1564 -623
- package/compiler/Main.ff +1 -1
- package/compiler/SourceMap.ff +149 -0
- package/core/Buffer.ff +2 -1
- package/core/BuildSystem.ff +3 -1
- package/core/Js.ff +6 -0
- package/firefly.sh +1 -1
- package/fireflysite/Main.ff +2 -1
- package/output/js/ff/compiler/Builder.mjs +4 -44
- package/output/js/ff/compiler/Builder.mjs.map +181 -0
- package/output/js/ff/compiler/Compiler.mjs +23 -16
- package/output/js/ff/compiler/Compiler.mjs.map +155 -0
- package/output/js/ff/compiler/Dependencies.mjs +12 -14
- package/output/js/ff/compiler/Dependencies.mjs.map +128 -0
- package/output/js/ff/compiler/DependencyLock.mjs +1 -4
- package/output/js/ff/compiler/DependencyLock.mjs.map +22 -0
- package/output/js/ff/compiler/Deriver.mjs +10 -11
- package/output/js/ff/compiler/Deriver.mjs.map +204 -0
- package/output/js/ff/compiler/Dictionaries.mjs +12 -13
- package/output/js/ff/compiler/Dictionaries.mjs.map +183 -0
- package/output/js/ff/compiler/Environment.mjs +24 -27
- package/output/js/ff/compiler/Environment.mjs.map +141 -0
- package/output/js/ff/compiler/Inference.mjs +83 -92
- package/output/js/ff/compiler/Inference.mjs.map +355 -0
- package/output/js/ff/compiler/JsEmitter.mjs +3689 -1687
- package/output/js/ff/compiler/JsEmitter.mjs.map +423 -0
- package/output/js/ff/compiler/JsImporter.mjs +9 -12
- package/output/js/ff/compiler/JsImporter.mjs.map +52 -0
- package/output/js/ff/compiler/LspHook.mjs +17 -18
- package/output/js/ff/compiler/LspHook.mjs.map +140 -0
- package/output/js/ff/compiler/Main.mjs +57 -67
- package/output/js/ff/compiler/Main.mjs.map +226 -0
- package/output/js/ff/compiler/ModuleCache.mjs +1 -4
- package/output/js/ff/compiler/ModuleCache.mjs.map +82 -0
- package/output/js/ff/compiler/Parser.mjs +54 -57
- package/output/js/ff/compiler/Parser.mjs.map +406 -0
- package/output/js/ff/compiler/Patterns.mjs +19 -22
- package/output/js/ff/compiler/Patterns.mjs.map +119 -0
- package/output/js/ff/compiler/Resolver.mjs +40 -39
- package/output/js/ff/compiler/Resolver.mjs.map +294 -0
- package/output/js/ff/compiler/SourceMap.mjs +402 -0
- package/output/js/ff/compiler/SourceMap.mjs.map +83 -0
- package/output/js/ff/compiler/Substitution.mjs +1 -4
- package/output/js/ff/compiler/Substitution.mjs.map +138 -0
- package/output/js/ff/compiler/Syntax.mjs +250 -249
- package/output/js/ff/compiler/Syntax.mjs.map +351 -0
- package/output/js/ff/compiler/Token.mjs +17 -22
- package/output/js/ff/compiler/Token.mjs.map +113 -0
- package/output/js/ff/compiler/Tokenizer.mjs +5 -12
- package/output/js/ff/compiler/Tokenizer.mjs.map +101 -0
- package/output/js/ff/compiler/Unification.mjs +32 -33
- package/output/js/ff/compiler/Unification.mjs.map +135 -0
- package/output/js/ff/compiler/Wildcards.mjs +1 -4
- package/output/js/ff/compiler/Wildcards.mjs.map +69 -0
- package/output/js/ff/compiler/Workspace.mjs +17 -16
- package/output/js/ff/compiler/Workspace.mjs.map +96 -0
- package/output/js/ff/core/Any.mjs +1 -4
- package/output/js/ff/core/Any.mjs.map +21 -0
- package/output/js/ff/core/Array.mjs +14 -15
- package/output/js/ff/core/Array.mjs.map +90 -0
- package/output/js/ff/core/AssetSystem.mjs +1 -4
- package/output/js/ff/core/AssetSystem.mjs.map +56 -0
- package/output/js/ff/core/Atomic.mjs +1 -4
- package/output/js/ff/core/Atomic.mjs.map +24 -0
- package/output/js/ff/core/Bool.mjs +4 -9
- package/output/js/ff/core/Bool.mjs.map +19 -0
- package/output/js/ff/core/BrowserSystem.mjs +1 -8
- package/output/js/ff/core/BrowserSystem.mjs.map +47 -0
- package/output/js/ff/core/Buffer.mjs +18 -17
- package/output/js/ff/core/Buffer.mjs.map +123 -0
- package/output/js/ff/core/BuildSystem.mjs +7 -10
- package/output/js/ff/core/BuildSystem.mjs.map +87 -0
- package/output/js/ff/core/Channel.mjs +1 -4
- package/output/js/ff/core/Channel.mjs.map +67 -0
- package/output/js/ff/core/Char.mjs +1 -8
- package/output/js/ff/core/Char.mjs.map +21 -0
- package/output/js/ff/core/Core.mjs +5 -8
- package/output/js/ff/core/Core.mjs.map +40 -0
- package/output/js/ff/core/Crypto.mjs +1 -4
- package/output/js/ff/core/Crypto.mjs.map +65 -0
- package/output/js/ff/core/Date.mjs +8 -7
- package/output/js/ff/core/Date.mjs.map +168 -0
- package/output/js/ff/core/Duration.mjs +4 -9
- package/output/js/ff/core/Duration.mjs.map +18 -0
- package/output/js/ff/core/Equal.mjs +9 -14
- package/output/js/ff/core/Equal.mjs.map +22 -0
- package/output/js/ff/core/Error.mjs +1 -8
- package/output/js/ff/core/Error.mjs.map +21 -0
- package/output/js/ff/core/FileHandle.mjs +1 -8
- package/output/js/ff/core/FileHandle.mjs.map +32 -0
- package/output/js/ff/core/Float.mjs +4 -5
- package/output/js/ff/core/Float.mjs.map +93 -0
- package/output/js/ff/core/HttpClient.mjs +1 -4
- package/output/js/ff/core/HttpClient.mjs.map +62 -0
- package/output/js/ff/core/Int.mjs +4 -9
- package/output/js/ff/core/Int.mjs.map +49 -0
- package/output/js/ff/core/IntMap.mjs +3 -6
- package/output/js/ff/core/IntMap.mjs.map +52 -0
- package/output/js/ff/core/Js.mjs +13 -8
- package/output/js/ff/core/Js.mjs.map +121 -0
- package/output/js/ff/core/JsSystem.mjs +1 -8
- package/output/js/ff/core/JsSystem.mjs.map +59 -0
- package/output/js/ff/core/JsValue.mjs +23 -42
- package/output/js/ff/core/JsValue.mjs.map +155 -0
- package/output/js/ff/core/Json.mjs +25 -26
- package/output/js/ff/core/Json.mjs.map +134 -0
- package/output/js/ff/core/List.mjs +11 -12
- package/output/js/ff/core/List.mjs.map +123 -0
- package/output/js/ff/core/Lock.mjs +7 -14
- package/output/js/ff/core/Lock.mjs.map +52 -0
- package/output/js/ff/core/Log.mjs +1 -8
- package/output/js/ff/core/Log.mjs.map +26 -0
- package/output/js/ff/core/Map.mjs +6 -7
- package/output/js/ff/core/Map.mjs.map +67 -0
- package/output/js/ff/core/NodeSystem.mjs +11 -14
- package/output/js/ff/core/NodeSystem.mjs.map +137 -0
- package/output/js/ff/core/Nothing.mjs +1 -10
- package/output/js/ff/core/Nothing.mjs.map +11 -0
- package/output/js/ff/core/Option.mjs +10 -15
- package/output/js/ff/core/Option.mjs.map +67 -0
- package/output/js/ff/core/Ordering.mjs +12 -13
- package/output/js/ff/core/Ordering.mjs.map +48 -0
- package/output/js/ff/core/Pair.mjs +8 -13
- package/output/js/ff/core/Pair.mjs.map +48 -0
- package/output/js/ff/core/Path.mjs +5 -14
- package/output/js/ff/core/Path.mjs.map +178 -0
- package/output/js/ff/core/Queue.mjs +1 -4
- package/output/js/ff/core/Queue.mjs.map +45 -0
- package/output/js/ff/core/Random.mjs +1 -4
- package/output/js/ff/core/Random.mjs.map +79 -0
- package/output/js/ff/core/RbMap.mjs +1 -16
- package/output/js/ff/core/RbMap.mjs.map +92 -0
- package/output/js/ff/core/Serializable.mjs +17 -22
- package/output/js/ff/core/Serializable.mjs.map +73 -0
- package/output/js/ff/core/Set.mjs +6 -7
- package/output/js/ff/core/Set.mjs.map +45 -0
- package/output/js/ff/core/Show.mjs +11 -20
- package/output/js/ff/core/Show.mjs.map +29 -0
- package/output/js/ff/core/SourceLocation.mjs +7 -8
- package/output/js/ff/core/SourceLocation.mjs.map +41 -0
- package/output/js/ff/core/Stream.mjs +1 -4
- package/output/js/ff/core/Stream.mjs.map +92 -0
- package/output/js/ff/core/String.mjs +14 -19
- package/output/js/ff/core/String.mjs.map +106 -0
- package/output/js/ff/core/StringMap.mjs +3 -6
- package/output/js/ff/core/StringMap.mjs.map +52 -0
- package/output/js/ff/core/Task.mjs +1 -8
- package/output/js/ff/core/Task.mjs.map +79 -0
- package/output/js/ff/core/Try.mjs +3 -6
- package/output/js/ff/core/Try.mjs.map +41 -0
- package/output/js/ff/core/Unit.mjs +5 -12
- package/output/js/ff/core/Unit.mjs.map +18 -0
- package/package.json +1 -1
- package/vscode/package.json +1 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
import * as ff_compiler_Resolver from "../../ff/compiler/Resolver.mjs"
|
|
4
2
|
|
|
5
3
|
import * as ff_compiler_LspHook from "../../ff/compiler/LspHook.mjs"
|
|
@@ -115,8 +113,6 @@ export function CaseVariable(at_, name_, asBound_) {
|
|
|
115
113
|
return {at_, name_, asBound_};
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
|
|
119
|
-
|
|
120
116
|
export function new_(lspHook_) {
|
|
121
117
|
return ff_compiler_Resolver.Resolver(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Resolver.ResolverState(2), lspHook_)
|
|
122
118
|
}
|
|
@@ -126,7 +122,7 @@ let seen_ = ff_core_Map.new_();
|
|
|
126
122
|
ff_core_List.List_map(items_, ((item_) => {
|
|
127
123
|
const n_ = name_(item_);
|
|
128
124
|
if(ff_core_Map.Map_contains(seen_, n_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
129
|
-
|
|
125
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(at_(item_), ("Duplicate definition: " + n_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
130
126
|
};
|
|
131
127
|
seen_ = ff_core_Map.Map_add(seen_, n_, item_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
132
128
|
}));
|
|
@@ -142,7 +138,7 @@ let seen_ = ff_core_Map.new_();
|
|
|
142
138
|
(await ff_core_List.List_map$(items_, (async (item_, $task) => {
|
|
143
139
|
const n_ = (await name_(item_, $task));
|
|
144
140
|
if(ff_core_Map.Map_contains(seen_, n_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
145
|
-
|
|
141
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError((await at_(item_, $task)), ("Duplicate definition: " + n_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
146
142
|
};
|
|
147
143
|
seen_ = ff_core_Map.Map_add(seen_, n_, item_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
148
144
|
}), $task));
|
|
@@ -187,7 +183,7 @@ break
|
|
|
187
183
|
}
|
|
188
184
|
{
|
|
189
185
|
const allErrors_ = _1;
|
|
190
|
-
|
|
186
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileErrors(ff_core_List.List_map(allErrors_, ((_w1) => {
|
|
191
187
|
return _w1.first_
|
|
192
188
|
}))), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileErrors)
|
|
193
189
|
}
|
|
@@ -243,7 +239,7 @@ if(_1.TConstructor) {
|
|
|
243
239
|
const name_ = _1.name_;
|
|
244
240
|
const typeArguments_ = _1.generics_;
|
|
245
241
|
if(ff_core_Set.Set_contains(self_.asyncTypes_, name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
246
|
-
|
|
242
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(type_.at_, "Traits must not be instantiated for capability types"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
247
243
|
};
|
|
248
244
|
for(let for_a = typeArguments_, for_i = 0, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
249
245
|
const _w1 = for_a[for_i];
|
|
@@ -272,7 +268,7 @@ resolver_ = ff_compiler_Resolver.Resolver_processDefinitions(resolver_, module_,
|
|
|
272
268
|
break
|
|
273
269
|
}
|
|
274
270
|
{
|
|
275
|
-
|
|
271
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(import_.at_, ("No such module: " + ff_compiler_Syntax.ModuleKey_importName(import_.moduleKey_))), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
276
272
|
}
|
|
277
273
|
} while(false)
|
|
278
274
|
};
|
|
@@ -400,7 +396,7 @@ return _w1.fields_
|
|
|
400
396
|
}))], for_i = 0, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
401
397
|
const f_ = for_a[for_i];
|
|
402
398
|
if(ff_compiler_Resolver.Resolver_containsAsyncType(self2_, f_.valueType_)) {
|
|
403
|
-
|
|
399
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(f_.at_, "Only capabilities can contain fields of concrete capability types"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
404
400
|
}
|
|
405
401
|
}
|
|
406
402
|
};
|
|
@@ -524,7 +520,7 @@ const self2_ = (((_c) => {
|
|
|
524
520
|
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.variants_, ff_core_Map.Map_addAll(self_.types_, generics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.typeGenerics_, _c.typeLocations_, ff_core_Set.Set_removeAll(self_.asyncTypes_, ff_core_List.List_toSet(definition_.generics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Set.Set_addAll(self_.typeParameters_, ff_core_List.List_toSet(definition_.generics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
525
521
|
}))(self_);
|
|
526
522
|
const traitName_ = ff_core_Option.Option_else(ff_core_Map.Map_get(self2_.traits_, definition_.traitName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
527
|
-
|
|
523
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(definition_.at_, ("No such trait: " + definition_.traitName_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
528
524
|
}));
|
|
529
525
|
{
|
|
530
526
|
const _1 = definition_;
|
|
@@ -657,7 +653,7 @@ const at_ = _1.at_;
|
|
|
657
653
|
const name_ = _1.name_;
|
|
658
654
|
const typeArguments_ = _1.typeArguments_;
|
|
659
655
|
return ff_compiler_Syntax.EVariantIs(at_, ff_core_Option.Option_else(ff_core_Map.Map_get(self_.variants_, name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
660
|
-
|
|
656
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(at_, ("No such variant: " + name_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
661
657
|
})), ff_core_List.List_map(typeArguments_, ((_w1) => {
|
|
662
658
|
return ff_compiler_Resolver.Resolver_resolveType(self_, _w1, topLevel_)
|
|
663
659
|
})))
|
|
@@ -732,7 +728,8 @@ return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Resolver.Resolv
|
|
|
732
728
|
return
|
|
733
729
|
}
|
|
734
730
|
if(_1.ECall && _1.target_.StaticCall) {
|
|
735
|
-
|
|
731
|
+
const at_ = _1.at_;
|
|
732
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(at_, "Internal error: Static calls not expected in the Resolver phase"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
736
733
|
}
|
|
737
734
|
if(_1.ERecord) {
|
|
738
735
|
const at_ = _1.at_;
|
|
@@ -751,7 +748,7 @@ return
|
|
|
751
748
|
if(_1.EWildcard) {
|
|
752
749
|
const e_ = _1;
|
|
753
750
|
if((e_.index_ === 0)) {
|
|
754
|
-
|
|
751
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(e_.at_, "Unbound wildcard"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
755
752
|
};
|
|
756
753
|
{
|
|
757
754
|
const _1 = e_;
|
|
@@ -815,7 +812,7 @@ const operator_ = _1.operator_;
|
|
|
815
812
|
const variable_ = _1.variable_;
|
|
816
813
|
const value_ = _1.value_;
|
|
817
814
|
return ff_compiler_Syntax.EAssign(at_, operator_, ff_core_Option.Option_else(ff_core_Map.Map_get(self_.variables_, variable_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
818
|
-
|
|
815
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(at_, ("No such variable: " + variable_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
819
816
|
})), ff_compiler_Resolver.Resolver_resolveTerm(self_, value_, topLevel_, false))
|
|
820
817
|
return
|
|
821
818
|
}
|
|
@@ -851,7 +848,7 @@ const name_ = (ff_core_String.String_contains(constructor_.name_, "$")
|
|
|
851
848
|
? constructor_.name_
|
|
852
849
|
: ff_core_Option.Option_else(ff_core_Map.Map_get(self_.types_, constructor_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
853
850
|
if((!ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_))) {
|
|
854
|
-
|
|
851
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(constructor_.at_, ("No such type: " + constructor_.name_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
855
852
|
} else {
|
|
856
853
|
return constructor_.name_
|
|
857
854
|
}
|
|
@@ -906,7 +903,7 @@ if((ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, constraint_.at_) || ff_comp
|
|
|
906
903
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ResolveConstraintHook(ff_compiler_LspHook.SymbolHook(constraint_.name_, constraint_.at_, traitDefinedAt_), constraint_))
|
|
907
904
|
};
|
|
908
905
|
const name_ = ff_core_Option.Option_else(ff_core_Map.Map_get(self_.traits_, constraint_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
909
|
-
|
|
906
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(constraint_.at_, ("No such trait: " + constraint_.name_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
910
907
|
}));
|
|
911
908
|
{
|
|
912
909
|
const _1 = constraint_;
|
|
@@ -948,7 +945,7 @@ return ff_core_Set.Set_contains(self_.typeParameters_, name_, ff_core_Ordering.f
|
|
|
948
945
|
}))
|
|
949
946
|
if(if_o.Some) {
|
|
950
947
|
const name_ = if_o.value_;
|
|
951
|
-
|
|
948
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(signature_.at_, (("Type parameter " + name_) + " is already in scope")), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
952
949
|
}
|
|
953
950
|
};
|
|
954
951
|
const self2_ = ff_compiler_Resolver.Resolver_withSignature(self_, newSignature_);
|
|
@@ -1134,7 +1131,7 @@ const name_ = (ff_core_String.String_contains(constructor_.name_, "$")
|
|
|
1134
1131
|
if(ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) {
|
|
1135
1132
|
return constructor_.name_
|
|
1136
1133
|
} else {
|
|
1137
|
-
|
|
1134
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(constructor_.at_, ("No such type: " + constructor_.name_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1138
1135
|
}
|
|
1139
1136
|
})));
|
|
1140
1137
|
const isFunctionType_ = ff_core_String.String_startsWith(name_, "Function$", 0);
|
|
@@ -1183,7 +1180,7 @@ break
|
|
|
1183
1180
|
}
|
|
1184
1181
|
{
|
|
1185
1182
|
const allErrors_ = _1;
|
|
1186
|
-
|
|
1183
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileErrors(ff_core_List.List_map(allErrors_, ((_w1) => {
|
|
1187
1184
|
return _w1.first_
|
|
1188
1185
|
}))), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileErrors)
|
|
1189
1186
|
}
|
|
@@ -1239,7 +1236,7 @@ if(_1.TConstructor) {
|
|
|
1239
1236
|
const name_ = _1.name_;
|
|
1240
1237
|
const typeArguments_ = _1.generics_;
|
|
1241
1238
|
if(ff_core_Set.Set_contains(self_.asyncTypes_, name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
1242
|
-
|
|
1239
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(type_.at_, "Traits must not be instantiated for capability types"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1243
1240
|
};
|
|
1244
1241
|
for(let for_a = typeArguments_, for_i = 0, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
1245
1242
|
const _w1 = for_a[for_i];
|
|
@@ -1268,7 +1265,7 @@ resolver_ = ff_compiler_Resolver.Resolver_processDefinitions(resolver_, module_,
|
|
|
1268
1265
|
break
|
|
1269
1266
|
}
|
|
1270
1267
|
{
|
|
1271
|
-
|
|
1268
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(import_.at_, ("No such module: " + ff_compiler_Syntax.ModuleKey_importName(import_.moduleKey_))), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1272
1269
|
}
|
|
1273
1270
|
} while(false)
|
|
1274
1271
|
};
|
|
@@ -1396,7 +1393,7 @@ return _w1.fields_
|
|
|
1396
1393
|
}))], for_i = 0, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
1397
1394
|
const f_ = for_a[for_i];
|
|
1398
1395
|
if(ff_compiler_Resolver.Resolver_containsAsyncType(self2_, f_.valueType_)) {
|
|
1399
|
-
|
|
1396
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(f_.at_, "Only capabilities can contain fields of concrete capability types"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1400
1397
|
}
|
|
1401
1398
|
}
|
|
1402
1399
|
};
|
|
@@ -1520,7 +1517,7 @@ const self2_ = (((_c) => {
|
|
|
1520
1517
|
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.variants_, ff_core_Map.Map_addAll(self_.types_, generics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.typeGenerics_, _c.typeLocations_, ff_core_Set.Set_removeAll(self_.asyncTypes_, ff_core_List.List_toSet(definition_.generics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Set.Set_addAll(self_.typeParameters_, ff_core_List.List_toSet(definition_.generics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
1521
1518
|
}))(self_);
|
|
1522
1519
|
const traitName_ = ff_core_Option.Option_else(ff_core_Map.Map_get(self2_.traits_, definition_.traitName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
1523
|
-
|
|
1520
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(definition_.at_, ("No such trait: " + definition_.traitName_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1524
1521
|
}));
|
|
1525
1522
|
{
|
|
1526
1523
|
const _1 = definition_;
|
|
@@ -1653,7 +1650,7 @@ const at_ = _1.at_;
|
|
|
1653
1650
|
const name_ = _1.name_;
|
|
1654
1651
|
const typeArguments_ = _1.typeArguments_;
|
|
1655
1652
|
return ff_compiler_Syntax.EVariantIs(at_, ff_core_Option.Option_else(ff_core_Map.Map_get(self_.variants_, name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
1656
|
-
|
|
1653
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(at_, ("No such variant: " + name_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1657
1654
|
})), ff_core_List.List_map(typeArguments_, ((_w1) => {
|
|
1658
1655
|
return ff_compiler_Resolver.Resolver_resolveType(self_, _w1, topLevel_)
|
|
1659
1656
|
})))
|
|
@@ -1728,7 +1725,8 @@ return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Resolver.Resolv
|
|
|
1728
1725
|
return
|
|
1729
1726
|
}
|
|
1730
1727
|
if(_1.ECall && _1.target_.StaticCall) {
|
|
1731
|
-
|
|
1728
|
+
const at_ = _1.at_;
|
|
1729
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(at_, "Internal error: Static calls not expected in the Resolver phase"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1732
1730
|
}
|
|
1733
1731
|
if(_1.ERecord) {
|
|
1734
1732
|
const at_ = _1.at_;
|
|
@@ -1747,7 +1745,7 @@ return
|
|
|
1747
1745
|
if(_1.EWildcard) {
|
|
1748
1746
|
const e_ = _1;
|
|
1749
1747
|
if((e_.index_ === 0)) {
|
|
1750
|
-
|
|
1748
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(e_.at_, "Unbound wildcard"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1751
1749
|
};
|
|
1752
1750
|
{
|
|
1753
1751
|
const _1 = e_;
|
|
@@ -1811,7 +1809,7 @@ const operator_ = _1.operator_;
|
|
|
1811
1809
|
const variable_ = _1.variable_;
|
|
1812
1810
|
const value_ = _1.value_;
|
|
1813
1811
|
return ff_compiler_Syntax.EAssign(at_, operator_, ff_core_Option.Option_else(ff_core_Map.Map_get(self_.variables_, variable_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
1814
|
-
|
|
1812
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(at_, ("No such variable: " + variable_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1815
1813
|
})), ff_compiler_Resolver.Resolver_resolveTerm(self_, value_, topLevel_, false))
|
|
1816
1814
|
return
|
|
1817
1815
|
}
|
|
@@ -1847,7 +1845,7 @@ const name_ = (ff_core_String.String_contains(constructor_.name_, "$")
|
|
|
1847
1845
|
? constructor_.name_
|
|
1848
1846
|
: ff_core_Option.Option_else(ff_core_Map.Map_get(self_.types_, constructor_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
1849
1847
|
if((!ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_))) {
|
|
1850
|
-
|
|
1848
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(constructor_.at_, ("No such type: " + constructor_.name_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1851
1849
|
} else {
|
|
1852
1850
|
return constructor_.name_
|
|
1853
1851
|
}
|
|
@@ -1902,7 +1900,7 @@ if((ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, constraint_.at_) || ff_comp
|
|
|
1902
1900
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ResolveConstraintHook(ff_compiler_LspHook.SymbolHook(constraint_.name_, constraint_.at_, traitDefinedAt_), constraint_))
|
|
1903
1901
|
};
|
|
1904
1902
|
const name_ = ff_core_Option.Option_else(ff_core_Map.Map_get(self_.traits_, constraint_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
|
|
1905
|
-
|
|
1903
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(constraint_.at_, ("No such trait: " + constraint_.name_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1906
1904
|
}));
|
|
1907
1905
|
{
|
|
1908
1906
|
const _1 = constraint_;
|
|
@@ -1944,7 +1942,7 @@ return ff_core_Set.Set_contains(self_.typeParameters_, name_, ff_core_Ordering.f
|
|
|
1944
1942
|
}))
|
|
1945
1943
|
if(if_o.Some) {
|
|
1946
1944
|
const name_ = if_o.value_;
|
|
1947
|
-
|
|
1945
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(signature_.at_, (("Type parameter " + name_) + " is already in scope")), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
1948
1946
|
}
|
|
1949
1947
|
};
|
|
1950
1948
|
const self2_ = ff_compiler_Resolver.Resolver_withSignature(self_, newSignature_);
|
|
@@ -2130,7 +2128,7 @@ const name_ = (ff_core_String.String_contains(constructor_.name_, "$")
|
|
|
2130
2128
|
if(ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) {
|
|
2131
2129
|
return constructor_.name_
|
|
2132
2130
|
} else {
|
|
2133
|
-
|
|
2131
|
+
throw ff_core_Js.initializeError_(new Error(), ff_compiler_Syntax.CompileError(constructor_.at_, ("No such type: " + constructor_.name_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_CompileError)
|
|
2134
2132
|
}
|
|
2135
2133
|
})));
|
|
2136
2134
|
const isFunctionType_ = ff_core_String.String_startsWith(name_, "Function$", 0);
|
|
@@ -2147,7 +2145,7 @@ return ff_core_Any.internalAnyTag_((("ff:compiler/Resolver.CaseVariable" + "[")
|
|
|
2147
2145
|
},
|
|
2148
2146
|
async anyTag_$($task) {
|
|
2149
2147
|
return ff_core_Any.internalAnyTag_((("ff:compiler/Resolver.CaseVariable" + "[") + "]"))
|
|
2150
|
-
}
|
|
2148
|
+
},
|
|
2151
2149
|
};
|
|
2152
2150
|
|
|
2153
2151
|
export const ff_core_Show_Show$ff_compiler_Resolver_CaseVariable = {
|
|
@@ -2164,7 +2162,7 @@ const value_a = value_;
|
|
|
2164
2162
|
const z_ = value_a;
|
|
2165
2163
|
return ((((((("CaseVariable" + "(") + ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Location.show_(z_.at_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.name_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.asBound_)) + ")")
|
|
2166
2164
|
}
|
|
2167
|
-
}
|
|
2165
|
+
},
|
|
2168
2166
|
};
|
|
2169
2167
|
|
|
2170
2168
|
export const ff_core_Equal_Equal$ff_compiler_Resolver_CaseVariable = {
|
|
@@ -2187,7 +2185,7 @@ return true
|
|
|
2187
2185
|
{
|
|
2188
2186
|
return (ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Location.equals_(x_.at_, y_.at_) && ((x_.name_ === y_.name_) && ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.asBound_, y_.asBound_)))
|
|
2189
2187
|
}
|
|
2190
|
-
}
|
|
2188
|
+
},
|
|
2191
2189
|
};
|
|
2192
2190
|
|
|
2193
2191
|
export const ff_core_Ordering_Order$ff_compiler_Resolver_CaseVariable = {
|
|
@@ -2242,7 +2240,7 @@ return ff_core_Ordering.OrderingSame()
|
|
|
2242
2240
|
}
|
|
2243
2241
|
return
|
|
2244
2242
|
}
|
|
2245
|
-
}
|
|
2243
|
+
},
|
|
2246
2244
|
};
|
|
2247
2245
|
|
|
2248
2246
|
export const ff_core_Serializable_Serializable$ff_compiler_Resolver_CaseVariable = {
|
|
@@ -2271,7 +2269,7 @@ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_
|
|
|
2271
2269
|
return ff_compiler_Resolver.CaseVariable(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Location.deserializeUsing_(serialization_), 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_))
|
|
2272
2270
|
}
|
|
2273
2271
|
{
|
|
2274
|
-
|
|
2272
|
+
throw ff_core_Js.initializeError_(new Error(), ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException, ff_core_Serializable.ff_core_Show_Show$ff_core_Serializable_DeserializationChecksumException)
|
|
2275
2273
|
}
|
|
2276
2274
|
}
|
|
2277
2275
|
},
|
|
@@ -2300,8 +2298,11 @@ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_
|
|
|
2300
2298
|
return ff_compiler_Resolver.CaseVariable(ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Location.deserializeUsing_(serialization_), 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_))
|
|
2301
2299
|
}
|
|
2302
2300
|
{
|
|
2303
|
-
|
|
2304
|
-
}
|
|
2301
|
+
throw ff_core_Js.initializeError_(new Error(), ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException, ff_core_Serializable.ff_core_Show_Show$ff_core_Serializable_DeserializationChecksumException)
|
|
2305
2302
|
}
|
|
2306
2303
|
}
|
|
2304
|
+
},
|
|
2307
2305
|
};
|
|
2306
|
+
|
|
2307
|
+
|
|
2308
|
+
//# sourceMappingURL=Resolver.mjs.map
|