@magnusopera/fscript 0.92.5 → 0.93.0
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/dist/FScript.Language/Ast.js +27 -24
- package/dist/FScript.Language/BuiltinFunctions.js +273 -234
- package/dist/FScript.Language/BuiltinSignatures.js +1 -1
- package/dist/FScript.Language/BuiltinTypes.js +3 -5
- package/dist/FScript.Language/Eval.js +583 -532
- package/dist/FScript.Language/ExportSignatures.js +1 -1
- package/dist/FScript.Language/HostInterop.js +194 -116
- package/dist/FScript.Language/IncludeResolver.js +65 -55
- package/dist/FScript.Language/Lexer.js +175 -147
- package/dist/FScript.Language/MatchCoverage.js +12 -18
- package/dist/FScript.Language/Parser.js +561 -419
- package/dist/FScript.Language/Pretty.js +1 -1
- package/dist/FScript.Language/SupportLibrary.js +1 -1
- package/dist/FScript.Language/TaskFunctions.js +1 -1
- package/dist/FScript.Language/TaskSharingAnalysis.js +228 -202
- package/dist/FScript.Language/Token.js +55 -55
- package/dist/FScript.Language/TypeInfer.js +2767 -2027
- package/dist/FScript.Language/Types.js +312 -42
- package/dist/Library.js +8 -8
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { Union, Record } from "../fable_modules/fable-library-js.5.27.0/Types.js";
|
|
3
|
-
import { float64_type, int64_type, union_type, option_type,
|
|
3
|
+
import { int32_type, float64_type, int64_type, union_type, option_type, tuple_type, bool_type, list_type, record_type, string_type } from "../fable_modules/fable-library-js.5.27.0/Reflection.js";
|
|
4
4
|
import { Span_$reflection } from "./Span.js";
|
|
5
5
|
|
|
6
6
|
export class BackendImport extends Record {
|
|
@@ -17,9 +17,10 @@ export function BackendImport_$reflection() {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export class TypeDef extends Record {
|
|
20
|
-
constructor(Name, IsRecursive, Fields, Cases, Import, Span) {
|
|
20
|
+
constructor(Name, TypeParameters, IsRecursive, Fields, Cases, Import, Span) {
|
|
21
21
|
super();
|
|
22
22
|
this.Name = Name;
|
|
23
|
+
this.TypeParameters = TypeParameters;
|
|
23
24
|
this.IsRecursive = IsRecursive;
|
|
24
25
|
this.Fields = Fields;
|
|
25
26
|
this.Cases = Cases;
|
|
@@ -29,7 +30,7 @@ export class TypeDef extends Record {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
export function TypeDef_$reflection() {
|
|
32
|
-
return record_type("FScript.Language.TypeDef", [], TypeDef, () => [["Name", string_type], ["IsRecursive", bool_type], ["Fields", list_type(tuple_type(string_type, TypeRef_$reflection()))], ["Cases", list_type(tuple_type(string_type, option_type(TypeRef_$reflection())))], ["Import", option_type(BackendImport_$reflection())], ["Span", Span_$reflection()]]);
|
|
33
|
+
return record_type("FScript.Language.TypeDef", [], TypeDef, () => [["Name", string_type], ["TypeParameters", list_type(string_type)], ["IsRecursive", bool_type], ["Fields", list_type(tuple_type(string_type, TypeRef_$reflection()))], ["Cases", list_type(tuple_type(string_type, option_type(TypeRef_$reflection())))], ["Import", option_type(BackendImport_$reflection())], ["Span", Span_$reflection()]]);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export class TypeRef extends Union {
|
|
@@ -39,12 +40,12 @@ export class TypeRef extends Union {
|
|
|
39
40
|
this.fields = fields;
|
|
40
41
|
}
|
|
41
42
|
cases() {
|
|
42
|
-
return ["TRName", "TRTuple", "TRFun", "TRPostfix", "TRMap", "TRRecord", "TRStructuralRecord"];
|
|
43
|
+
return ["TRName", "TRVariable", "TRApplied", "TRForall", "TRTuple", "TRFun", "TRPostfix", "TRMap", "TRRecord", "TRStructuralRecord"];
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
export function TypeRef_$reflection() {
|
|
47
|
-
return union_type("FScript.Language.TypeRef", [], TypeRef, () => [[["Item", string_type]], [["Item", list_type(TypeRef_$reflection())]], [["Item1", TypeRef_$reflection()], ["Item2", TypeRef_$reflection()]], [["Item1", TypeRef_$reflection()], ["Item2", string_type]], [["Item1", TypeRef_$reflection()], ["Item2", TypeRef_$reflection()]], [["Item", list_type(tuple_type(string_type, TypeRef_$reflection()))]], [["Item", list_type(tuple_type(string_type, TypeRef_$reflection()))]]]);
|
|
48
|
+
return union_type("FScript.Language.TypeRef", [], TypeRef, () => [[["Item", string_type]], [["Item", string_type]], [["Item1", string_type], ["Item2", list_type(TypeRef_$reflection())]], [["parameters", list_type(string_type)], ["result", option_type(TypeRef_$reflection())]], [["Item", list_type(TypeRef_$reflection())]], [["Item1", TypeRef_$reflection()], ["Item2", TypeRef_$reflection()]], [["Item1", TypeRef_$reflection()], ["Item2", string_type]], [["Item1", TypeRef_$reflection()], ["Item2", TypeRef_$reflection()]], [["Item", list_type(tuple_type(string_type, TypeRef_$reflection()))]], [["Item", list_type(tuple_type(string_type, TypeRef_$reflection()))]]]);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
export class Param extends Record {
|
|
@@ -110,12 +111,12 @@ export class Expr extends Union {
|
|
|
110
111
|
this.fields = fields;
|
|
111
112
|
}
|
|
112
113
|
cases() {
|
|
113
|
-
return ["EUnit", "ELiteral", "EVar", "EParen", "ELambda", "EApply", "EIf", "ERaise", "EFor", "EMatch", "ELet", "ELetPattern", "ELetRecGroup", "EList", "ERange", "ETuple", "ERecord", "EStructuralRecord", "EMap", "ERecordUpdate", "EStructuralRecordUpdate", "EFieldGet", "EIndexGet", "ECons", "EAppend", "EBinOp", "ESome", "ENone", "ETypeOf", "ENameOf", "EInterpolatedString"];
|
|
114
|
+
return ["EUnit", "ELiteral", "EVar", "ETypeApply", "EParen", "ELambda", "EApply", "EIf", "ERaise", "EFor", "EMatch", "ELet", "ELetPattern", "ELetRecGroup", "EList", "ERange", "ETuple", "ERecord", "EStructuralRecord", "EMap", "ERecordUpdate", "EStructuralRecordUpdate", "EFieldGet", "EIndexGet", "ECons", "EAppend", "EBinOp", "ESome", "ENone", "ETypeOf", "ENameOf", "EInterpolatedString"];
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
export function Expr_$reflection() {
|
|
118
|
-
return union_type("FScript.Language.Expr", [], Expr, () => [[["Item", Span_$reflection()]], [["Item1", Literal_$reflection()], ["Item2", Span_$reflection()]], [["Item1", string_type], ["Item2", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Span_$reflection()]], [["Item1", Param_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Expr_$reflection()], ["Item4", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Span_$reflection()]], [["Item1", string_type], ["Item2", Expr_$reflection()], ["Item3", Expr_$reflection()], ["Item4", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", list_type(tuple_type(Pattern_$reflection(), option_type(Expr_$reflection()), Expr_$reflection(), Span_$reflection()))], ["Item3", Span_$reflection()]], [["Item1", string_type], ["Item2", Expr_$reflection()], ["Item3", Expr_$reflection()], ["Item4", bool_type], ["Item5", option_type(TypeRef_$reflection())], ["
|
|
119
|
+
return union_type("FScript.Language.Expr", [], Expr, () => [[["Item", Span_$reflection()]], [["Item1", Literal_$reflection()], ["Item2", Span_$reflection()]], [["Item1", string_type], ["Item2", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", list_type(TypeRef_$reflection())], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Span_$reflection()]], [["Item1", Param_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Expr_$reflection()], ["Item4", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Span_$reflection()]], [["Item1", string_type], ["Item2", Expr_$reflection()], ["Item3", Expr_$reflection()], ["Item4", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", list_type(tuple_type(Pattern_$reflection(), option_type(Expr_$reflection()), Expr_$reflection(), Span_$reflection()))], ["Item3", Span_$reflection()]], [["Item1", string_type], ["Item2", Expr_$reflection()], ["Item3", Expr_$reflection()], ["Item4", bool_type], ["Item5", option_type(TypeRef_$reflection())], ["parameterCount", int32_type], ["Item7", Span_$reflection()]], [["Item1", Pattern_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Expr_$reflection()], ["Item4", Span_$reflection()]], [["Item1", list_type(tuple_type(string_type, list_type(Param_$reflection()), option_type(TypeRef_$reflection()), Expr_$reflection(), Span_$reflection()))], ["Item2", Expr_$reflection()], ["Item3", Span_$reflection()]], [["Item1", list_type(Expr_$reflection())], ["Item2", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Span_$reflection()]], [["Item1", list_type(Expr_$reflection())], ["Item2", Span_$reflection()]], [["Item1", list_type(tuple_type(string_type, Expr_$reflection()))], ["Item2", Span_$reflection()]], [["Item1", list_type(tuple_type(string_type, Expr_$reflection()))], ["Item2", Span_$reflection()]], [["Item1", list_type(MapEntry_$reflection())], ["Item2", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", list_type(tuple_type(string_type, Expr_$reflection()))], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", list_type(tuple_type(string_type, Expr_$reflection()))], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", string_type], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Expr_$reflection()], ["Item3", Span_$reflection()]], [["Item1", string_type], ["Item2", Expr_$reflection()], ["Item3", Expr_$reflection()], ["Item4", Span_$reflection()]], [["Item1", Expr_$reflection()], ["Item2", Span_$reflection()]], [["Item", Span_$reflection()]], [["Item1", string_type], ["Item2", Span_$reflection()]], [["Item1", string_type], ["Item2", Span_$reflection()]], [["Item1", list_type(InterpolatedPart_$reflection())], ["Item2", Span_$reflection()]]]);
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
export class InterpolatedPart extends Union {
|
|
@@ -199,31 +200,31 @@ export function Ast_spanOfExpr(expr) {
|
|
|
199
200
|
case 2:
|
|
200
201
|
return expr.fields[1];
|
|
201
202
|
case 3:
|
|
202
|
-
return expr.fields[1];
|
|
203
|
-
case 4:
|
|
204
203
|
return expr.fields[2];
|
|
204
|
+
case 4:
|
|
205
|
+
return expr.fields[1];
|
|
205
206
|
case 5:
|
|
206
207
|
return expr.fields[2];
|
|
207
208
|
case 6:
|
|
208
|
-
return expr.fields[
|
|
209
|
+
return expr.fields[2];
|
|
209
210
|
case 7:
|
|
210
|
-
return expr.fields[1];
|
|
211
|
-
case 8:
|
|
212
211
|
return expr.fields[3];
|
|
212
|
+
case 8:
|
|
213
|
+
return expr.fields[1];
|
|
213
214
|
case 9:
|
|
214
|
-
return expr.fields[
|
|
215
|
+
return expr.fields[3];
|
|
215
216
|
case 10:
|
|
216
|
-
return expr.fields[
|
|
217
|
+
return expr.fields[2];
|
|
217
218
|
case 11:
|
|
218
|
-
return expr.fields[
|
|
219
|
+
return expr.fields[6];
|
|
219
220
|
case 12:
|
|
220
|
-
return expr.fields[
|
|
221
|
+
return expr.fields[3];
|
|
221
222
|
case 13:
|
|
222
|
-
return expr.fields[1];
|
|
223
|
-
case 14:
|
|
224
223
|
return expr.fields[2];
|
|
225
|
-
case
|
|
224
|
+
case 14:
|
|
226
225
|
return expr.fields[1];
|
|
226
|
+
case 15:
|
|
227
|
+
return expr.fields[2];
|
|
227
228
|
case 16:
|
|
228
229
|
return expr.fields[1];
|
|
229
230
|
case 17:
|
|
@@ -231,7 +232,7 @@ export function Ast_spanOfExpr(expr) {
|
|
|
231
232
|
case 18:
|
|
232
233
|
return expr.fields[1];
|
|
233
234
|
case 19:
|
|
234
|
-
return expr.fields[
|
|
235
|
+
return expr.fields[1];
|
|
235
236
|
case 20:
|
|
236
237
|
return expr.fields[2];
|
|
237
238
|
case 21:
|
|
@@ -243,17 +244,19 @@ export function Ast_spanOfExpr(expr) {
|
|
|
243
244
|
case 24:
|
|
244
245
|
return expr.fields[2];
|
|
245
246
|
case 25:
|
|
246
|
-
return expr.fields[
|
|
247
|
+
return expr.fields[2];
|
|
247
248
|
case 26:
|
|
248
|
-
return expr.fields[
|
|
249
|
+
return expr.fields[3];
|
|
249
250
|
case 27:
|
|
250
|
-
return expr.fields[0];
|
|
251
|
-
case 28:
|
|
252
251
|
return expr.fields[1];
|
|
252
|
+
case 28:
|
|
253
|
+
return expr.fields[0];
|
|
253
254
|
case 29:
|
|
254
255
|
return expr.fields[1];
|
|
255
256
|
case 30:
|
|
256
257
|
return expr.fields[1];
|
|
258
|
+
case 31:
|
|
259
|
+
return expr.fields[1];
|
|
257
260
|
default:
|
|
258
261
|
return expr.fields[0];
|
|
259
262
|
}
|