firefly-compiler 0.4.22 → 0.4.24
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
ADDED
|
@@ -541,11 +541,36 @@ ff_compiler_Unification.Unification_unify(self_.unification_, at_, expected_, in
|
|
|
541
541
|
const parameters_ = ff_core_List.List_sortBy(instantiated_.scheme_.signature_.parameters_, ((_w1) => {
|
|
542
542
|
return _w1.name_
|
|
543
543
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
544
|
+
const paramtersWithFieldAt_ = ff_core_List.List_map(parameters_, ((p_) => {
|
|
545
|
+
{
|
|
546
|
+
const _1 = p_.valueType_;
|
|
547
|
+
if(_1.TConstructor) {
|
|
548
|
+
const t_ = _1;
|
|
549
|
+
{
|
|
550
|
+
const _1 = t_;
|
|
551
|
+
{
|
|
552
|
+
const _c = _1;
|
|
553
|
+
return ff_compiler_Syntax.TConstructor(p_.at_, _c.name_, _c.generics_)
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
return
|
|
557
|
+
}
|
|
558
|
+
if(_1.TVariable) {
|
|
559
|
+
const t_ = _1;
|
|
560
|
+
{
|
|
561
|
+
const _1 = t_;
|
|
562
|
+
{
|
|
563
|
+
const _c = _1;
|
|
564
|
+
return ff_compiler_Syntax.TVariable(p_.at_, _c.index_)
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}));
|
|
544
571
|
const recordType_ = ff_compiler_Syntax.TConstructor(at_, ("Record$" + ff_core_List.List_join(ff_core_List.List_map(parameters_, ((_w1) => {
|
|
545
572
|
return _w1.name_
|
|
546
|
-
})), "$")),
|
|
547
|
-
return _w1.valueType_
|
|
548
|
-
})));
|
|
573
|
+
})), "$")), paramtersWithFieldAt_);
|
|
549
574
|
return ff_core_List.List_toMap(ff_core_List.List_map(ff_core_Option.Option_toList(variableOption_), ((_w1) => {
|
|
550
575
|
return ff_core_Pair.Pair(_w1, ff_core_Pair.Pair(variableAt_, recordType_))
|
|
551
576
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
@@ -650,12 +675,22 @@ const t_ = _1;
|
|
|
650
675
|
const name_ = _1.name_;
|
|
651
676
|
const typeArguments_ = _1.generics_;
|
|
652
677
|
if(ff_core_String.String_startsWith(name_, "Record$", 0)) {
|
|
653
|
-
if(ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, e_.at_)) {
|
|
654
|
-
const symbolHook_ = ff_compiler_LspHook.SymbolHook(e_.field_, e_.at_, e_.at_);
|
|
655
|
-
const noEffect_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
656
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.InferRecordFieldHook(self_.unification_, environment_, expected_, t_, e_.field_))
|
|
657
|
-
};
|
|
658
678
|
const fieldNames_ = ff_core_List.List_dropFirst(ff_core_String.String_split(name_, 36), 1);
|
|
679
|
+
if(ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) {
|
|
680
|
+
ff_core_List.List_each(ff_core_List.List_zip(fieldNames_, typeArguments_), ((_1) => {
|
|
681
|
+
{
|
|
682
|
+
const fieldName_ = _1.first_;
|
|
683
|
+
const fieldType_ = _1.second_;
|
|
684
|
+
if((e_.field_ === fieldName_)) {
|
|
685
|
+
const definedAt_ = ff_compiler_Unification.Unification_substitute(self_.unification_, fieldType_).at_;
|
|
686
|
+
if((ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, e_.at_) || ff_compiler_LspHook.LspHook_isDefinedAt(self_.lspHook_, definedAt_))) {
|
|
687
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.InferRecordFieldHook(e_.at_, self_.unification_, environment_, expected_, t_, e_.field_))
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
return
|
|
691
|
+
}
|
|
692
|
+
}))
|
|
693
|
+
};
|
|
659
694
|
return ff_core_Option.Option_else(ff_core_Option.Option_elseIf(ff_core_Option.Option_map(ff_core_Option.Option_map(ff_core_List.List_find(ff_core_List.List_pairs(fieldNames_), ((_w1) => {
|
|
660
695
|
return (_w1.second_ === e_.field_)
|
|
661
696
|
})), ((_w1) => {
|
|
@@ -2181,11 +2216,36 @@ ff_compiler_Unification.Unification_unify(self_.unification_, at_, expected_, in
|
|
|
2181
2216
|
const parameters_ = ff_core_List.List_sortBy(instantiated_.scheme_.signature_.parameters_, ((_w1) => {
|
|
2182
2217
|
return _w1.name_
|
|
2183
2218
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
2219
|
+
const paramtersWithFieldAt_ = ff_core_List.List_map(parameters_, ((p_) => {
|
|
2220
|
+
{
|
|
2221
|
+
const _1 = p_.valueType_;
|
|
2222
|
+
if(_1.TConstructor) {
|
|
2223
|
+
const t_ = _1;
|
|
2224
|
+
{
|
|
2225
|
+
const _1 = t_;
|
|
2226
|
+
{
|
|
2227
|
+
const _c = _1;
|
|
2228
|
+
return ff_compiler_Syntax.TConstructor(p_.at_, _c.name_, _c.generics_)
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
return
|
|
2232
|
+
}
|
|
2233
|
+
if(_1.TVariable) {
|
|
2234
|
+
const t_ = _1;
|
|
2235
|
+
{
|
|
2236
|
+
const _1 = t_;
|
|
2237
|
+
{
|
|
2238
|
+
const _c = _1;
|
|
2239
|
+
return ff_compiler_Syntax.TVariable(p_.at_, _c.index_)
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
return
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
}));
|
|
2184
2246
|
const recordType_ = ff_compiler_Syntax.TConstructor(at_, ("Record$" + ff_core_List.List_join(ff_core_List.List_map(parameters_, ((_w1) => {
|
|
2185
2247
|
return _w1.name_
|
|
2186
|
-
})), "$")),
|
|
2187
|
-
return _w1.valueType_
|
|
2188
|
-
})));
|
|
2248
|
+
})), "$")), paramtersWithFieldAt_);
|
|
2189
2249
|
return ff_core_List.List_toMap(ff_core_List.List_map(ff_core_Option.Option_toList(variableOption_), ((_w1) => {
|
|
2190
2250
|
return ff_core_Pair.Pair(_w1, ff_core_Pair.Pair(variableAt_, recordType_))
|
|
2191
2251
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
@@ -2290,12 +2350,22 @@ const t_ = _1;
|
|
|
2290
2350
|
const name_ = _1.name_;
|
|
2291
2351
|
const typeArguments_ = _1.generics_;
|
|
2292
2352
|
if(ff_core_String.String_startsWith(name_, "Record$", 0)) {
|
|
2293
|
-
if(ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, e_.at_)) {
|
|
2294
|
-
const symbolHook_ = ff_compiler_LspHook.SymbolHook(e_.field_, e_.at_, e_.at_);
|
|
2295
|
-
const noEffect_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
2296
|
-
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.InferRecordFieldHook(self_.unification_, environment_, expected_, t_, e_.field_))
|
|
2297
|
-
};
|
|
2298
2353
|
const fieldNames_ = ff_core_List.List_dropFirst(ff_core_String.String_split(name_, 36), 1);
|
|
2354
|
+
if(ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) {
|
|
2355
|
+
ff_core_List.List_each(ff_core_List.List_zip(fieldNames_, typeArguments_), ((_1) => {
|
|
2356
|
+
{
|
|
2357
|
+
const fieldName_ = _1.first_;
|
|
2358
|
+
const fieldType_ = _1.second_;
|
|
2359
|
+
if((e_.field_ === fieldName_)) {
|
|
2360
|
+
const definedAt_ = ff_compiler_Unification.Unification_substitute(self_.unification_, fieldType_).at_;
|
|
2361
|
+
if((ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, e_.at_) || ff_compiler_LspHook.LspHook_isDefinedAt(self_.lspHook_, definedAt_))) {
|
|
2362
|
+
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.InferRecordFieldHook(e_.at_, self_.unification_, environment_, expected_, t_, e_.field_))
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
return
|
|
2366
|
+
}
|
|
2367
|
+
}))
|
|
2368
|
+
};
|
|
2299
2369
|
return ff_core_Option.Option_else(ff_core_Option.Option_elseIf(ff_core_Option.Option_map(ff_core_Option.Option_map(ff_core_List.List_find(ff_core_List.List_pairs(fieldNames_), ((_w1) => {
|
|
2300
2370
|
return (_w1.second_ === e_.field_)
|
|
2301
2371
|
})), ((_w1) => {
|
|
@@ -199,8 +199,8 @@ return {InferArgumentHook: true, unification_, environment_, isCopy_, callAt_, c
|
|
|
199
199
|
export function InferLookupHook(unification_, environment_, expected_, selfVariable_, symbol_, instantiated_) {
|
|
200
200
|
return {InferLookupHook: true, unification_, environment_, expected_, selfVariable_, symbol_, instantiated_};
|
|
201
201
|
}
|
|
202
|
-
export function InferRecordFieldHook(unification_, environment_, expected_, recordType_, fieldName_) {
|
|
203
|
-
return {InferRecordFieldHook: true, unification_, environment_, expected_, recordType_, fieldName_};
|
|
202
|
+
export function InferRecordFieldHook(usageAt_, unification_, environment_, expected_, recordType_, fieldName_) {
|
|
203
|
+
return {InferRecordFieldHook: true, usageAt_, unification_, environment_, expected_, recordType_, fieldName_};
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
|
|
@@ -271,6 +271,7 @@ const pattern_ = hook_a.pattern_;
|
|
|
271
271
|
return "InferPatternHook(...)"
|
|
272
272
|
}
|
|
273
273
|
if(hook_a.InferRecordFieldHook) {
|
|
274
|
+
const usageAt_ = hook_a.usageAt_;
|
|
274
275
|
const unification_ = hook_a.unification_;
|
|
275
276
|
const environment_ = hook_a.environment_;
|
|
276
277
|
const expected_ = hook_a.expected_;
|
|
@@ -406,6 +407,7 @@ const pattern_ = hook_a.pattern_;
|
|
|
406
407
|
return "InferPatternHook(...)"
|
|
407
408
|
}
|
|
408
409
|
if(hook_a.InferRecordFieldHook) {
|
|
410
|
+
const usageAt_ = hook_a.usageAt_;
|
|
409
411
|
const unification_ = hook_a.unification_;
|
|
410
412
|
const environment_ = hook_a.environment_;
|
|
411
413
|
const expected_ = hook_a.expected_;
|
|
@@ -97,8 +97,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
97
97
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
98
98
|
|
|
99
99
|
// type Resolver
|
|
100
|
-
export function Resolver(variables_, variableLocations_,
|
|
101
|
-
return {variables_, variableLocations_,
|
|
100
|
+
export function Resolver(variables_, variableLocations_, variants_, types_, typeGenerics_, typeLocations_, asyncTypes_, typeParameters_, traits_, traitLocations_, state_, lspHook_) {
|
|
101
|
+
return {variables_, variableLocations_, variants_, types_, typeGenerics_, typeLocations_, asyncTypes_, typeParameters_, traits_, traitLocations_, state_, lspHook_};
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// type ResolverState
|
|
@@ -114,11 +114,11 @@ return {at_, name_, asBound_};
|
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
export function make_(packagePair_, moduleName_, lspHook_) {
|
|
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.
|
|
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_)
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
export async function make_$(packagePair_, moduleName_, lspHook_, $task) {
|
|
121
|
-
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.
|
|
121
|
+
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
122
|
}
|
|
123
123
|
|
|
124
124
|
export function Resolver_freshUnificationVariable(self_, at_) {
|
|
@@ -297,7 +297,7 @@ return entry_(_w1.name_, true)
|
|
|
297
297
|
const _1 = self_;
|
|
298
298
|
{
|
|
299
299
|
const _c = _1;
|
|
300
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variables_, lets_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functions_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethods_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variableLocations_, letLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functionLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethodLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String),
|
|
300
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variables_, lets_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functions_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethods_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variableLocations_, letLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functionLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethodLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variants_, variants_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.types_, types_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeGenerics_, typeGenerics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeLocations_, typeLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Set.Set_addAll(self_.asyncTypes_, asyncTypes_, 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_Map.Map_addAll(self_.traits_, traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traitLocations_, traitLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), self_.state_, _c.lspHook_)
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
}
|
|
@@ -310,7 +310,7 @@ const generics_ = ff_core_List.List_toMap(ff_core_List.List_map(definition_.gene
|
|
|
310
310
|
return ff_core_Pair.Pair(g_, g_)
|
|
311
311
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
312
312
|
const self2_ = (((_c) => {
|
|
313
|
-
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.
|
|
313
|
+
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_)
|
|
314
314
|
}))(self_);
|
|
315
315
|
if((!ff_core_Option.Option_any(ff_core_List.List_first(definition_.generics_), ((_w1) => {
|
|
316
316
|
return (_w1 === "Q$")
|
|
@@ -385,7 +385,7 @@ const generics_ = ff_core_List.List_toMap(ff_core_List.List_map(definition_.gene
|
|
|
385
385
|
return ff_core_Pair.Pair(g_, g_)
|
|
386
386
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
387
387
|
const self2_ = (((_c) => {
|
|
388
|
-
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.
|
|
388
|
+
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_)
|
|
389
389
|
}))(self_);
|
|
390
390
|
{
|
|
391
391
|
const _1 = definition_;
|
|
@@ -432,7 +432,7 @@ const generics_ = ff_core_List.List_toMap(ff_core_List.List_map(definition_.gene
|
|
|
432
432
|
return ff_core_Pair.Pair(g_, g_)
|
|
433
433
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
434
434
|
const self2_ = (((_c) => {
|
|
435
|
-
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.
|
|
435
|
+
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_)
|
|
436
436
|
}))(self_);
|
|
437
437
|
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), (() => {
|
|
438
438
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(definition_.at_, ("No such trait: " + definition_.traitName_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
@@ -458,10 +458,10 @@ const generics_ = ff_core_List.List_toMap(ff_core_List.List_map(definition_.gene
|
|
|
458
458
|
return ff_core_Pair.Pair(g_, g_)
|
|
459
459
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
460
460
|
const selfWithNoQ_ = (((_c) => {
|
|
461
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_add(self_.variables_, definition_.name_, definition_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_add(self_.variableLocations_, definition_.name_, definition_.at_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.
|
|
461
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_add(self_.variables_, definition_.name_, definition_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_add(self_.variableLocations_, definition_.name_, definition_.at_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _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_)
|
|
462
462
|
}))(self_);
|
|
463
463
|
const selfWithQ_ = (((_c) => {
|
|
464
|
-
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.
|
|
464
|
+
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.variants_, ff_core_Map.Map_add(selfWithNoQ_.types_, "Q$", "Q$", ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, ff_core_Set.Set_add(selfWithNoQ_.typeParameters_, "Q$", ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
465
465
|
}))(selfWithNoQ_);
|
|
466
466
|
{
|
|
467
467
|
const _1 = definition_;
|
|
@@ -515,11 +515,6 @@ if((ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, e_.at_) || ff_compiler_LspH
|
|
|
515
515
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ResolveSymbolHook(ff_compiler_LspHook.SymbolHook(e_.name_, e_.at_, at_), ff_core_Option.None(), true))
|
|
516
516
|
}
|
|
517
517
|
};
|
|
518
|
-
if(((!inField_) && ff_core_Option.Option_any(ff_core_Map.Map_get(self_.asVariables_, e_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_w1) => {
|
|
519
|
-
return (!ff_core_Option.Option_isEmpty(_w1))
|
|
520
|
-
})))) {
|
|
521
|
-
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(e_.at_, "Only field access is allowed on as-bound variables"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
522
|
-
};
|
|
523
518
|
return ff_core_Option.Option_else(ff_core_Option.Option_map(ff_core_Map.Map_get(self_.variables_, e_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_w1) => {
|
|
524
519
|
{
|
|
525
520
|
const _1 = e_;
|
|
@@ -693,7 +688,7 @@ return _w1.signature_
|
|
|
693
688
|
return ff_core_Pair.Pair(s_.name_, s_.at_)
|
|
694
689
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
695
690
|
const self2_ = (((_c) => {
|
|
696
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, functionMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, locationMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.
|
|
691
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, functionMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, locationMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, _c.types_, _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, _c.typeParameters_, _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
697
692
|
}))(self_);
|
|
698
693
|
return ff_compiler_Syntax.EFunctions(at_, ff_core_List.List_map(functions_, ((_w1) => {
|
|
699
694
|
return ff_compiler_Resolver.Resolver_resolveFunctionDefinition(self2_, _w1, topLevel_, false)
|
|
@@ -703,7 +698,7 @@ return
|
|
|
703
698
|
if(_1.ELet) {
|
|
704
699
|
const e_ = _1;
|
|
705
700
|
const self2_ = (((_c) => {
|
|
706
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_add(self_.variables_, e_.name_, e_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_add(self_.variableLocations_, e_.name_, e_.at_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.
|
|
701
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_add(self_.variables_, e_.name_, e_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_add(self_.variableLocations_, e_.name_, e_.at_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, _c.types_, _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, _c.typeParameters_, _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
707
702
|
}))(self_);
|
|
708
703
|
if(ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) {
|
|
709
704
|
if((ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, e_.at_) || ff_compiler_LspHook.LspHook_isDefinedAt(self_.lspHook_, e_.at_))) {
|
|
@@ -910,7 +905,7 @@ return ff_core_Pair.Pair(name_, name_)
|
|
|
910
905
|
const _1 = self_;
|
|
911
906
|
{
|
|
912
907
|
const _c = _1;
|
|
913
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, variableMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, variableLocationMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.
|
|
908
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, variableMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, variableLocationMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, ff_core_Map.Map_addAll(self_.types_, typeMap_, 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(signature_.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(signature_.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_)
|
|
914
909
|
}
|
|
915
910
|
}
|
|
916
911
|
}
|
|
@@ -973,8 +968,6 @@ return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, ff
|
|
|
973
968
|
return p_.name_
|
|
974
969
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, ff_core_Map.Map_mapValues(variableMap1_, ((_, p_) => {
|
|
975
970
|
return p_.at_
|
|
976
|
-
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.asVariables_, ff_core_Map.Map_mapValues(variableMap1_, ((_, p_) => {
|
|
977
|
-
return p_.asBound_
|
|
978
971
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, _c.types_, _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, _c.typeParameters_, _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
979
972
|
}))(self_);
|
|
980
973
|
const guard_ = (((_c) => {
|
|
@@ -988,8 +981,6 @@ return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, ff
|
|
|
988
981
|
return p_.name_
|
|
989
982
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, ff_core_Map.Map_mapValues(variableMap2_, ((_, p_) => {
|
|
990
983
|
return p_.at_
|
|
991
|
-
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.asVariables_, ff_core_Map.Map_mapValues(variableMap2_, ((_, p_) => {
|
|
992
|
-
return p_.asBound_
|
|
993
984
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, _c.types_, _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, _c.typeParameters_, _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
994
985
|
}))(self_);
|
|
995
986
|
return ff_compiler_Syntax.MatchCase(case_.at_, ff_core_List.List_map(case_.patterns_, ((_w1) => {
|
|
@@ -1244,7 +1235,7 @@ return entry_(_w1.name_, true)
|
|
|
1244
1235
|
const _1 = self_;
|
|
1245
1236
|
{
|
|
1246
1237
|
const _c = _1;
|
|
1247
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variables_, lets_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functions_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethods_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variableLocations_, letLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functionLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethodLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String),
|
|
1238
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variables_, lets_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functions_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethods_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variableLocations_, letLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functionLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethodLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variants_, variants_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.types_, types_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeGenerics_, typeGenerics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeLocations_, typeLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Set.Set_addAll(self_.asyncTypes_, asyncTypes_, 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_Map.Map_addAll(self_.traits_, traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traitLocations_, traitLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), self_.state_, _c.lspHook_)
|
|
1248
1239
|
}
|
|
1249
1240
|
}
|
|
1250
1241
|
}
|
|
@@ -1257,7 +1248,7 @@ const generics_ = ff_core_List.List_toMap(ff_core_List.List_map(definition_.gene
|
|
|
1257
1248
|
return ff_core_Pair.Pair(g_, g_)
|
|
1258
1249
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
1259
1250
|
const self2_ = (((_c) => {
|
|
1260
|
-
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.
|
|
1251
|
+
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_)
|
|
1261
1252
|
}))(self_);
|
|
1262
1253
|
if((!ff_core_Option.Option_any(ff_core_List.List_first(definition_.generics_), ((_w1) => {
|
|
1263
1254
|
return (_w1 === "Q$")
|
|
@@ -1332,7 +1323,7 @@ const generics_ = ff_core_List.List_toMap(ff_core_List.List_map(definition_.gene
|
|
|
1332
1323
|
return ff_core_Pair.Pair(g_, g_)
|
|
1333
1324
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
1334
1325
|
const self2_ = (((_c) => {
|
|
1335
|
-
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.
|
|
1326
|
+
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_)
|
|
1336
1327
|
}))(self_);
|
|
1337
1328
|
{
|
|
1338
1329
|
const _1 = definition_;
|
|
@@ -1379,7 +1370,7 @@ const generics_ = ff_core_List.List_toMap(ff_core_List.List_map(definition_.gene
|
|
|
1379
1370
|
return ff_core_Pair.Pair(g_, g_)
|
|
1380
1371
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
1381
1372
|
const self2_ = (((_c) => {
|
|
1382
|
-
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.
|
|
1373
|
+
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_)
|
|
1383
1374
|
}))(self_);
|
|
1384
1375
|
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), (() => {
|
|
1385
1376
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(definition_.at_, ("No such trait: " + definition_.traitName_)), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
@@ -1405,10 +1396,10 @@ const generics_ = ff_core_List.List_toMap(ff_core_List.List_map(definition_.gene
|
|
|
1405
1396
|
return ff_core_Pair.Pair(g_, g_)
|
|
1406
1397
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
1407
1398
|
const selfWithNoQ_ = (((_c) => {
|
|
1408
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_add(self_.variables_, definition_.name_, definition_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_add(self_.variableLocations_, definition_.name_, definition_.at_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.
|
|
1399
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_add(self_.variables_, definition_.name_, definition_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_add(self_.variableLocations_, definition_.name_, definition_.at_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _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_)
|
|
1409
1400
|
}))(self_);
|
|
1410
1401
|
const selfWithQ_ = (((_c) => {
|
|
1411
|
-
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.
|
|
1402
|
+
return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.variants_, ff_core_Map.Map_add(selfWithNoQ_.types_, "Q$", "Q$", ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, ff_core_Set.Set_add(selfWithNoQ_.typeParameters_, "Q$", ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
1412
1403
|
}))(selfWithNoQ_);
|
|
1413
1404
|
{
|
|
1414
1405
|
const _1 = definition_;
|
|
@@ -1462,11 +1453,6 @@ if((ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, e_.at_) || ff_compiler_LspH
|
|
|
1462
1453
|
ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ResolveSymbolHook(ff_compiler_LspHook.SymbolHook(e_.name_, e_.at_, at_), ff_core_Option.None(), true))
|
|
1463
1454
|
}
|
|
1464
1455
|
};
|
|
1465
|
-
if(((!inField_) && ff_core_Option.Option_any(ff_core_Map.Map_get(self_.asVariables_, e_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_w1) => {
|
|
1466
|
-
return (!ff_core_Option.Option_isEmpty(_w1))
|
|
1467
|
-
})))) {
|
|
1468
|
-
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(e_.at_, "Only field access is allowed on as-bound variables"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
1469
|
-
};
|
|
1470
1456
|
return ff_core_Option.Option_else(ff_core_Option.Option_map(ff_core_Map.Map_get(self_.variables_, e_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_w1) => {
|
|
1471
1457
|
{
|
|
1472
1458
|
const _1 = e_;
|
|
@@ -1640,7 +1626,7 @@ return _w1.signature_
|
|
|
1640
1626
|
return ff_core_Pair.Pair(s_.name_, s_.at_)
|
|
1641
1627
|
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
1642
1628
|
const self2_ = (((_c) => {
|
|
1643
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, functionMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, locationMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.
|
|
1629
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, functionMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, locationMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, _c.types_, _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, _c.typeParameters_, _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
1644
1630
|
}))(self_);
|
|
1645
1631
|
return ff_compiler_Syntax.EFunctions(at_, ff_core_List.List_map(functions_, ((_w1) => {
|
|
1646
1632
|
return ff_compiler_Resolver.Resolver_resolveFunctionDefinition(self2_, _w1, topLevel_, false)
|
|
@@ -1650,7 +1636,7 @@ return
|
|
|
1650
1636
|
if(_1.ELet) {
|
|
1651
1637
|
const e_ = _1;
|
|
1652
1638
|
const self2_ = (((_c) => {
|
|
1653
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_add(self_.variables_, e_.name_, e_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_add(self_.variableLocations_, e_.name_, e_.at_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.
|
|
1639
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_add(self_.variables_, e_.name_, e_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_add(self_.variableLocations_, e_.name_, e_.at_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, _c.types_, _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, _c.typeParameters_, _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
1654
1640
|
}))(self_);
|
|
1655
1641
|
if(ff_compiler_LspHook.LspHook_isEnabled(self_.lspHook_)) {
|
|
1656
1642
|
if((ff_compiler_LspHook.LspHook_isAt(self_.lspHook_, e_.at_) || ff_compiler_LspHook.LspHook_isDefinedAt(self_.lspHook_, e_.at_))) {
|
|
@@ -1857,7 +1843,7 @@ return ff_core_Pair.Pair(name_, name_)
|
|
|
1857
1843
|
const _1 = self_;
|
|
1858
1844
|
{
|
|
1859
1845
|
const _c = _1;
|
|
1860
|
-
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, variableMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, variableLocationMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.
|
|
1846
|
+
return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, variableMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, variableLocationMap_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, ff_core_Map.Map_addAll(self_.types_, typeMap_, 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(signature_.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(signature_.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_)
|
|
1861
1847
|
}
|
|
1862
1848
|
}
|
|
1863
1849
|
}
|
|
@@ -1920,8 +1906,6 @@ return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, ff
|
|
|
1920
1906
|
return p_.name_
|
|
1921
1907
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, ff_core_Map.Map_mapValues(variableMap1_, ((_, p_) => {
|
|
1922
1908
|
return p_.at_
|
|
1923
|
-
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.asVariables_, ff_core_Map.Map_mapValues(variableMap1_, ((_, p_) => {
|
|
1924
|
-
return p_.asBound_
|
|
1925
1909
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, _c.types_, _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, _c.typeParameters_, _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
1926
1910
|
}))(self_);
|
|
1927
1911
|
const guard_ = (((_c) => {
|
|
@@ -1935,8 +1919,6 @@ return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, ff
|
|
|
1935
1919
|
return p_.name_
|
|
1936
1920
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variableLocations_, ff_core_Map.Map_mapValues(variableMap2_, ((_, p_) => {
|
|
1937
1921
|
return p_.at_
|
|
1938
|
-
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.asVariables_, ff_core_Map.Map_mapValues(variableMap2_, ((_, p_) => {
|
|
1939
|
-
return p_.asBound_
|
|
1940
1922
|
}), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), _c.variants_, _c.types_, _c.typeGenerics_, _c.typeLocations_, _c.asyncTypes_, _c.typeParameters_, _c.traits_, _c.traitLocations_, _c.state_, _c.lspHook_)
|
|
1941
1923
|
}))(self_);
|
|
1942
1924
|
return ff_compiler_Syntax.MatchCase(case_.at_, ff_core_List.List_map(case_.patterns_, ((_w1) => {
|
package/package.json
CHANGED
package/vscode/README.md
CHANGED
|
@@ -10,5 +10,7 @@ This extension adds support for the Firefly programming language (`.ff` files).
|
|
|
10
10
|
- Document and workspace symbols
|
|
11
11
|
- Show type on hover
|
|
12
12
|
- Diagnostics
|
|
13
|
+
- Run in terminal
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
To install the Firefly compiler, run the following command in the terminal:
|
|
16
|
+
```npm install -g firefly-compiler```
|