firefly-compiler 0.5.15 → 0.5.17
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 +15 -1
- package/compiler/Compiler.ff +8 -3
- package/compiler/JsEmitter.ff +6 -6
- package/output/js/ff/compiler/Builder.mjs +34 -2
- package/output/js/ff/compiler/Compiler.mjs +8 -4
- package/output/js/ff/compiler/Inference.mjs +10 -10
- package/output/js/ff/compiler/JsEmitter.mjs +274 -274
- package/output/js/ff/compiler/Parser.mjs +4 -4
- package/output/js/ff/compiler/Resolver.mjs +2 -2
- package/output/js/ff/compiler/Unification.mjs +4 -4
- package/output/js/ff/compiler/Workspace.mjs +2 -2
- package/output/js/ff/core/List.mjs +2 -2
- package/package.json +1 -1
- package/vscode/package.json +1 -1
|
@@ -324,7 +324,7 @@ return ff_compiler_Parser.Parser_skip(self_, kind_)
|
|
|
324
324
|
|
|
325
325
|
export function Parser_parseModuleWithoutPackageInfo(self_) {
|
|
326
326
|
const moduleWithPackageInfo_ = ff_compiler_Parser.Parser_parseModuleWithPackageInfo(self_);
|
|
327
|
-
for(
|
|
327
|
+
for(const for_o = moduleWithPackageInfo_.packageInfo_; for_o.Some;) {
|
|
328
328
|
const info_ = for_o.value_;
|
|
329
329
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(info_.package_.at_, "Package and dependencies already declared in package.ff"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
330
330
|
break
|
|
@@ -1573,7 +1573,7 @@ const member_ = ff_compiler_Syntax.EString(ff_compiler_Token.Token_at(token_), (
|
|
|
1573
1573
|
: (("\"" + ff_compiler_Token.Token_raw(token_)) + "\"")));
|
|
1574
1574
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
1575
1575
|
const arguments_ = ff_compiler_Parser.Parser_parseFunctionArguments(self_, record_.at_, false);
|
|
1576
|
-
for(
|
|
1576
|
+
for(const for_o = ff_core_List.List_find(arguments_.first_, ((_w1) => {
|
|
1577
1577
|
return (!ff_core_Option.Option_isEmpty(_w1.name_))
|
|
1578
1578
|
})); for_o.Some;) {
|
|
1579
1579
|
const argument_ = for_o.value_;
|
|
@@ -1910,7 +1910,7 @@ return ff_compiler_Parser.Parser_skip(self_, kind_)
|
|
|
1910
1910
|
|
|
1911
1911
|
export async function Parser_parseModuleWithoutPackageInfo$(self_, $task) {
|
|
1912
1912
|
const moduleWithPackageInfo_ = ff_compiler_Parser.Parser_parseModuleWithPackageInfo(self_);
|
|
1913
|
-
for(
|
|
1913
|
+
for(const for_o = moduleWithPackageInfo_.packageInfo_; for_o.Some;) {
|
|
1914
1914
|
const info_ = for_o.value_;
|
|
1915
1915
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(info_.package_.at_, "Package and dependencies already declared in package.ff"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
1916
1916
|
break
|
|
@@ -3159,7 +3159,7 @@ const member_ = ff_compiler_Syntax.EString(ff_compiler_Token.Token_at(token_), (
|
|
|
3159
3159
|
: (("\"" + ff_compiler_Token.Token_raw(token_)) + "\"")));
|
|
3160
3160
|
if(ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "(")) {
|
|
3161
3161
|
const arguments_ = ff_compiler_Parser.Parser_parseFunctionArguments(self_, record_.at_, false);
|
|
3162
|
-
for(
|
|
3162
|
+
for(const for_o = ff_core_List.List_find(arguments_.first_, ((_w1) => {
|
|
3163
3163
|
return (!ff_core_Option.Option_isEmpty(_w1.name_))
|
|
3164
3164
|
})); for_o.Some;) {
|
|
3165
3165
|
const argument_ = for_o.value_;
|
|
@@ -867,7 +867,7 @@ return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ["Q$", ...sign
|
|
|
867
867
|
: (((_c) => {
|
|
868
868
|
return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, _c.generics_, _c.constraints_, _c.parameters_, _c.returnType_, ff_compiler_Resolver.Resolver_freshUnificationVariable(self_, signature_.at_))
|
|
869
869
|
}))(signature_));
|
|
870
|
-
for(
|
|
870
|
+
for(const for_o = ff_core_List.List_find(newSignature_.generics_, ((name_) => {
|
|
871
871
|
return ff_core_Set.Set_contains(self_.typeParameters_, name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
872
872
|
})); for_o.Some;) {
|
|
873
873
|
const name_ = for_o.value_;
|
|
@@ -1812,7 +1812,7 @@ return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ["Q$", ...sign
|
|
|
1812
1812
|
: (((_c) => {
|
|
1813
1813
|
return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, _c.generics_, _c.constraints_, _c.parameters_, _c.returnType_, ff_compiler_Resolver.Resolver_freshUnificationVariable(self_, signature_.at_))
|
|
1814
1814
|
}))(signature_));
|
|
1815
|
-
for(
|
|
1815
|
+
for(const for_o = ff_core_List.List_find(newSignature_.generics_, ((name_) => {
|
|
1816
1816
|
return ff_core_Set.Set_contains(self_.typeParameters_, name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
1817
1817
|
})); for_o.Some;) {
|
|
1818
1818
|
const name_ = for_o.value_;
|
|
@@ -469,7 +469,7 @@ const t_ = ff_compiler_Unification.Unification_substitute(self_, type_);
|
|
|
469
469
|
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)})
|
|
470
470
|
};
|
|
471
471
|
self_.substitution_ = ff_core_Map.Map_add(self_.substitution_, index_, type_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
472
|
-
for(
|
|
472
|
+
for(const for_o = ff_core_Map.Map_get(self_.constraints_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int); for_o.Some;) {
|
|
473
473
|
const map_ = for_o.value_;
|
|
474
474
|
self_.constraints_ = ff_core_Map.Map_remove(self_.constraints_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
475
475
|
ff_core_List.List_each(ff_core_Map.Map_pairs(map_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_1) => {
|
|
@@ -483,7 +483,7 @@ return
|
|
|
483
483
|
}))
|
|
484
484
|
break
|
|
485
485
|
};
|
|
486
|
-
for(
|
|
486
|
+
for(const for_o = ff_core_Map.Map_get(self_.affects_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int); for_o.Some;) {
|
|
487
487
|
const affected_ = for_o.value_;
|
|
488
488
|
ff_core_Map.Map_remove(self_.affects_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
489
489
|
ff_core_Set.Set_each(affected_, ((i_) => {
|
|
@@ -850,7 +850,7 @@ const t_ = ff_compiler_Unification.Unification_substitute(self_, type_);
|
|
|
850
850
|
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)})
|
|
851
851
|
};
|
|
852
852
|
self_.substitution_ = ff_core_Map.Map_add(self_.substitution_, index_, type_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
853
|
-
for(
|
|
853
|
+
for(const for_o = ff_core_Map.Map_get(self_.constraints_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int); for_o.Some;) {
|
|
854
854
|
const map_ = for_o.value_;
|
|
855
855
|
self_.constraints_ = ff_core_Map.Map_remove(self_.constraints_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
856
856
|
ff_core_List.List_each(ff_core_Map.Map_pairs(map_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_1) => {
|
|
@@ -864,7 +864,7 @@ return
|
|
|
864
864
|
}))
|
|
865
865
|
break
|
|
866
866
|
};
|
|
867
|
-
for(
|
|
867
|
+
for(const for_o = ff_core_Map.Map_get(self_.affects_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int); for_o.Some;) {
|
|
868
868
|
const affected_ = for_o.value_;
|
|
869
869
|
ff_core_Map.Map_remove(self_.affects_, index_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int);
|
|
870
870
|
ff_core_Set.Set_each(affected_, ((i_) => {
|
|
@@ -136,7 +136,7 @@ const rules_ = ff_core_List.List_collect(lines_, ((line_) => {
|
|
|
136
136
|
const columns_ = ff_core_List.List_filter(ff_core_String.String_split(ff_core_String.String_replace(line_, "\t", " "), 32), ((_w1) => {
|
|
137
137
|
return (ff_core_String.String_size(_w1) !== 0)
|
|
138
138
|
}));
|
|
139
|
-
for(
|
|
139
|
+
for(const for_o = defaultLocation_; for_o.Some;) {
|
|
140
140
|
ff_core_Core.panic_(("Unexpected rule after the * rule: " + line_))
|
|
141
141
|
break
|
|
142
142
|
};
|
|
@@ -201,7 +201,7 @@ const rules_ = ff_core_List.List_collect(lines_, ((line_) => {
|
|
|
201
201
|
const columns_ = ff_core_List.List_filter(ff_core_String.String_split(ff_core_String.String_replace(line_, "\t", " "), 32), ((_w1) => {
|
|
202
202
|
return (ff_core_String.String_size(_w1) !== 0)
|
|
203
203
|
}));
|
|
204
|
-
for(
|
|
204
|
+
for(const for_o = defaultLocation_; for_o.Some;) {
|
|
205
205
|
ff_core_Core.panic_(("Unexpected rule after the * rule: " + line_))
|
|
206
206
|
break
|
|
207
207
|
};
|
|
@@ -466,7 +466,7 @@ export function List_collect(self_, body_) {
|
|
|
466
466
|
let result_ = ff_core_Array.new_();
|
|
467
467
|
for(let for_i = 0, for_a = self_, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
468
468
|
const x_ = for_a[for_i];
|
|
469
|
-
for(
|
|
469
|
+
for(const for_o = body_(x_); for_o.Some;) {
|
|
470
470
|
const _w1 = for_o.value_;
|
|
471
471
|
result_.array.push(_w1)
|
|
472
472
|
break
|
|
@@ -832,7 +832,7 @@ export async function List_collect$(self_, body_, $task) {
|
|
|
832
832
|
let result_ = ff_core_Array.new_();
|
|
833
833
|
for(let for_i = 0, for_a = self_, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
834
834
|
const x_ = for_a[for_i];
|
|
835
|
-
for(
|
|
835
|
+
for(const for_o = (await body_(x_, $task)); for_o.Some;) {
|
|
836
836
|
const _w1 = for_o.value_;
|
|
837
837
|
result_.array.push(_w1)
|
|
838
838
|
break
|
package/package.json
CHANGED