@magnusopera/fscript 0.75.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.
Files changed (79) hide show
  1. package/README.md +5 -0
  2. package/dist/FScript.Language/Ast.js +234 -0
  3. package/dist/FScript.Language/BuiltinFunctions.js +2039 -0
  4. package/dist/FScript.Language/BuiltinSignatures.js +24 -0
  5. package/dist/FScript.Language/BuiltinTypes.js +13 -0
  6. package/dist/FScript.Language/Error.js +74 -0
  7. package/dist/FScript.Language/Eval.js +2404 -0
  8. package/dist/FScript.Language/IncludeResolver.js +806 -0
  9. package/dist/FScript.Language/Lexer.js +1067 -0
  10. package/dist/FScript.Language/Library.js +28 -0
  11. package/dist/FScript.Language/Parser.js +2368 -0
  12. package/dist/FScript.Language/Pretty.js +115 -0
  13. package/dist/FScript.Language/Span.js +33 -0
  14. package/dist/FScript.Language/Token.js +32 -0
  15. package/dist/FScript.Language/TypeInfer.js +2561 -0
  16. package/dist/FScript.Language/Types.js +205 -0
  17. package/dist/FScript.Language/Value.js +91 -0
  18. package/dist/Library.js +732 -0
  19. package/dist/fable_modules/fable-library-js.5.2.0/Array.js +1347 -0
  20. package/dist/fable_modules/fable-library-js.5.2.0/Async.js +134 -0
  21. package/dist/fable_modules/fable-library-js.5.2.0/AsyncBuilder.js +183 -0
  22. package/dist/fable_modules/fable-library-js.5.2.0/BigInt.js +306 -0
  23. package/dist/fable_modules/fable-library-js.5.2.0/BitConverter.js +138 -0
  24. package/dist/fable_modules/fable-library-js.5.2.0/Boolean.js +22 -0
  25. package/dist/fable_modules/fable-library-js.5.2.0/CHANGELOG.md +234 -0
  26. package/dist/fable_modules/fable-library-js.5.2.0/Char.js +202 -0
  27. package/dist/fable_modules/fable-library-js.5.2.0/Choice.js +184 -0
  28. package/dist/fable_modules/fable-library-js.5.2.0/CollectionUtil.js +182 -0
  29. package/dist/fable_modules/fable-library-js.5.2.0/ConditionalWeakTable.js +21 -0
  30. package/dist/fable_modules/fable-library-js.5.2.0/Date.js +841 -0
  31. package/dist/fable_modules/fable-library-js.5.2.0/DateOffset.js +261 -0
  32. package/dist/fable_modules/fable-library-js.5.2.0/DateOnly.js +124 -0
  33. package/dist/fable_modules/fable-library-js.5.2.0/Decimal.js +238 -0
  34. package/dist/fable_modules/fable-library-js.5.2.0/Double.js +47 -0
  35. package/dist/fable_modules/fable-library-js.5.2.0/Encoding.js +185 -0
  36. package/dist/fable_modules/fable-library-js.5.2.0/Event.js +93 -0
  37. package/dist/fable_modules/fable-library-js.5.2.0/FSharp.Collections.js +45 -0
  38. package/dist/fable_modules/fable-library-js.5.2.0/FSharp.Core.CompilerServices.js +27 -0
  39. package/dist/fable_modules/fable-library-js.5.2.0/FSharp.Core.js +156 -0
  40. package/dist/fable_modules/fable-library-js.5.2.0/Global.js +29 -0
  41. package/dist/fable_modules/fable-library-js.5.2.0/Guid.js +161 -0
  42. package/dist/fable_modules/fable-library-js.5.2.0/Int32.js +135 -0
  43. package/dist/fable_modules/fable-library-js.5.2.0/List.js +1323 -0
  44. package/dist/fable_modules/fable-library-js.5.2.0/Long.js +47 -0
  45. package/dist/fable_modules/fable-library-js.5.2.0/MailboxProcessor.js +94 -0
  46. package/dist/fable_modules/fable-library-js.5.2.0/Map.js +1396 -0
  47. package/dist/fable_modules/fable-library-js.5.2.0/MapUtil.js +130 -0
  48. package/dist/fable_modules/fable-library-js.5.2.0/MutableMap.js +339 -0
  49. package/dist/fable_modules/fable-library-js.5.2.0/MutableSet.js +233 -0
  50. package/dist/fable_modules/fable-library-js.5.2.0/Native.js +14 -0
  51. package/dist/fable_modules/fable-library-js.5.2.0/Numeric.js +75 -0
  52. package/dist/fable_modules/fable-library-js.5.2.0/Observable.js +113 -0
  53. package/dist/fable_modules/fable-library-js.5.2.0/Option.js +104 -0
  54. package/dist/fable_modules/fable-library-js.5.2.0/README.md +3 -0
  55. package/dist/fable_modules/fable-library-js.5.2.0/Random.js +172 -0
  56. package/dist/fable_modules/fable-library-js.5.2.0/Range.js +45 -0
  57. package/dist/fable_modules/fable-library-js.5.2.0/Reflection.js +479 -0
  58. package/dist/fable_modules/fable-library-js.5.2.0/RegExp.js +141 -0
  59. package/dist/fable_modules/fable-library-js.5.2.0/Result.js +165 -0
  60. package/dist/fable_modules/fable-library-js.5.2.0/Seq.js +1417 -0
  61. package/dist/fable_modules/fable-library-js.5.2.0/Seq2.js +111 -0
  62. package/dist/fable_modules/fable-library-js.5.2.0/Set.js +1816 -0
  63. package/dist/fable_modules/fable-library-js.5.2.0/String.js +674 -0
  64. package/dist/fable_modules/fable-library-js.5.2.0/System.Collections.Generic.js +333 -0
  65. package/dist/fable_modules/fable-library-js.5.2.0/System.Text.js +200 -0
  66. package/dist/fable_modules/fable-library-js.5.2.0/System.js +283 -0
  67. package/dist/fable_modules/fable-library-js.5.2.0/TimeOnly.js +122 -0
  68. package/dist/fable_modules/fable-library-js.5.2.0/TimeSpan.js +180 -0
  69. package/dist/fable_modules/fable-library-js.5.2.0/Timer.js +67 -0
  70. package/dist/fable_modules/fable-library-js.5.2.0/Types.js +198 -0
  71. package/dist/fable_modules/fable-library-js.5.2.0/Unicode.13.0.0.js +4 -0
  72. package/dist/fable_modules/fable-library-js.5.2.0/Uri.js +165 -0
  73. package/dist/fable_modules/fable-library-js.5.2.0/Util.js +795 -0
  74. package/dist/fable_modules/fable-library-js.5.2.0/big.d.ts +338 -0
  75. package/dist/fable_modules/fable-library-js.5.2.0/lib/big.js +825 -0
  76. package/dist/fable_modules/fable-library-js.5.2.0/package.json +24 -0
  77. package/dist/fable_modules/fable-library-js.5.2.0/quotation.js +618 -0
  78. package/dist/fable_modules/project_cracked.json +1 -0
  79. package/package.json +36 -0
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @magnusopera/fscript
2
+
3
+ Embeddable FScript language engine: parser, type inference, and evaluator.
4
+
5
+ This package exposes parser, inference, evaluation, exported-function invocation, REPL-like sessions, virtual imports, and JS-provided externs for Node and browser-compatible ESM hosts.
@@ -0,0 +1,234 @@
1
+
2
+ import { Union, Record } from "../fable_modules/fable-library-js.5.2.0/Types.js";
3
+ import { float64_type, int64_type, union_type, record_type, option_type, list_type, tuple_type, bool_type, string_type } from "../fable_modules/fable-library-js.5.2.0/Reflection.js";
4
+ import { Span_$reflection } from "./Span.js";
5
+
6
+ export class TypeDef extends Record {
7
+ constructor(Name, IsRecursive, Fields, Cases, Span) {
8
+ super();
9
+ this.Name = Name;
10
+ this.IsRecursive = IsRecursive;
11
+ this.Fields = Fields;
12
+ this.Cases = Cases;
13
+ this.Span = Span;
14
+ }
15
+ }
16
+
17
+ export function TypeDef_$reflection() {
18
+ 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())))], ["Span", Span_$reflection()]]);
19
+ }
20
+
21
+ export class TypeRef extends Union {
22
+ constructor(tag, fields) {
23
+ super();
24
+ this.tag = tag;
25
+ this.fields = fields;
26
+ }
27
+ cases() {
28
+ return ["TRName", "TRTuple", "TRFun", "TRPostfix", "TRRecord", "TRStructuralRecord"];
29
+ }
30
+ }
31
+
32
+ export function TypeRef_$reflection() {
33
+ 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]], [["Item", list_type(tuple_type(string_type, TypeRef_$reflection()))]], [["Item", list_type(tuple_type(string_type, TypeRef_$reflection()))]]]);
34
+ }
35
+
36
+ export class Param extends Record {
37
+ constructor(Name, Annotation, Span) {
38
+ super();
39
+ this.Name = Name;
40
+ this.Annotation = Annotation;
41
+ this.Span = Span;
42
+ }
43
+ }
44
+
45
+ export function Param_$reflection() {
46
+ return record_type("FScript.Language.Param", [], Param, () => [["Name", string_type], ["Annotation", option_type(TypeRef_$reflection())], ["Span", Span_$reflection()]]);
47
+ }
48
+
49
+ export class Literal extends Union {
50
+ constructor(tag, fields) {
51
+ super();
52
+ this.tag = tag;
53
+ this.fields = fields;
54
+ }
55
+ cases() {
56
+ return ["LInt", "LFloat", "LBool", "LString"];
57
+ }
58
+ }
59
+
60
+ export function Literal_$reflection() {
61
+ return union_type("FScript.Language.Literal", [], Literal, () => [[["Item", int64_type]], [["Item", float64_type]], [["Item", bool_type]], [["Item", string_type]]]);
62
+ }
63
+
64
+ export class Pattern extends Union {
65
+ constructor(tag, fields) {
66
+ super();
67
+ this.tag = tag;
68
+ this.fields = fields;
69
+ }
70
+ cases() {
71
+ return ["PWildcard", "PVar", "PLiteral", "PNil", "PCons", "PTuple", "PRecord", "PMap", "PSome", "PNone", "PUnionCase", "PTypeRef"];
72
+ }
73
+ }
74
+
75
+ export function Pattern_$reflection() {
76
+ return union_type("FScript.Language.Pattern", [], Pattern, () => [[["Item", Span_$reflection()]], [["Item1", string_type], ["Item2", Span_$reflection()]], [["Item1", Literal_$reflection()], ["Item2", Span_$reflection()]], [["Item", Span_$reflection()]], [["Item1", Pattern_$reflection()], ["Item2", Pattern_$reflection()], ["Item3", Span_$reflection()]], [["Item1", list_type(Pattern_$reflection())], ["Item2", Span_$reflection()]], [["Item1", list_type(tuple_type(string_type, Pattern_$reflection()))], ["Item2", Span_$reflection()]], [["Item1", list_type(tuple_type(Pattern_$reflection(), Pattern_$reflection()))], ["Item2", option_type(Pattern_$reflection())], ["Item3", Span_$reflection()]], [["Item1", Pattern_$reflection()], ["Item2", Span_$reflection()]], [["Item", Span_$reflection()]], [["Item1", option_type(string_type)], ["Item2", string_type], ["Item3", option_type(Pattern_$reflection())], ["Item4", Span_$reflection()]], [["Item1", TypeRef_$reflection()], ["Item2", Span_$reflection()]]]);
77
+ }
78
+
79
+ export class Expr extends Union {
80
+ constructor(tag, fields) {
81
+ super();
82
+ this.tag = tag;
83
+ this.fields = fields;
84
+ }
85
+ cases() {
86
+ 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"];
87
+ }
88
+ }
89
+
90
+ export function Expr_$reflection() {
91
+ 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())], ["Item6", 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()]]]);
92
+ }
93
+
94
+ export class InterpolatedPart extends Union {
95
+ constructor(tag, fields) {
96
+ super();
97
+ this.tag = tag;
98
+ this.fields = fields;
99
+ }
100
+ cases() {
101
+ return ["IPText", "IPExpr"];
102
+ }
103
+ }
104
+
105
+ export function InterpolatedPart_$reflection() {
106
+ return union_type("FScript.Language.InterpolatedPart", [], InterpolatedPart, () => [[["Item", string_type]], [["Item", Expr_$reflection()]]]);
107
+ }
108
+
109
+ export class MapEntry extends Union {
110
+ constructor(tag, fields) {
111
+ super();
112
+ this.tag = tag;
113
+ this.fields = fields;
114
+ }
115
+ cases() {
116
+ return ["MEKeyValue", "MESpread"];
117
+ }
118
+ }
119
+
120
+ export function MapEntry_$reflection() {
121
+ return union_type("FScript.Language.MapEntry", [], MapEntry, () => [[["Item1", Expr_$reflection()], ["Item2", Expr_$reflection()]], [["Item", Expr_$reflection()]]]);
122
+ }
123
+
124
+ export class Stmt extends Union {
125
+ constructor(tag, fields) {
126
+ super();
127
+ this.tag = tag;
128
+ this.fields = fields;
129
+ }
130
+ cases() {
131
+ return ["SType", "SImport", "SLet", "SLetPattern", "SLetRecGroup", "SExpr"];
132
+ }
133
+ }
134
+
135
+ export function Stmt_$reflection() {
136
+ return union_type("FScript.Language.Stmt", [], Stmt, () => [[["Item", TypeDef_$reflection()]], [["Item1", string_type], ["Item2", string_type], ["Item3", Span_$reflection()]], [["Item1", string_type], ["Item2", list_type(Param_$reflection())], ["Item3", option_type(TypeRef_$reflection())], ["Item4", Expr_$reflection()], ["Item5", bool_type], ["Item6", bool_type], ["Item7", Span_$reflection()]], [["Item1", Pattern_$reflection()], ["Item2", Expr_$reflection()], ["Item3", bool_type], ["Item4", Span_$reflection()]], [["Item1", list_type(tuple_type(string_type, list_type(Param_$reflection()), option_type(TypeRef_$reflection()), Expr_$reflection(), Span_$reflection()))], ["Item2", bool_type], ["Item3", Span_$reflection()]], [["Item", Expr_$reflection()]]]);
137
+ }
138
+
139
+ export function Ast_spanOfPattern(pat) {
140
+ switch (pat.tag) {
141
+ case 1:
142
+ return pat.fields[1];
143
+ case 2:
144
+ return pat.fields[1];
145
+ case 3:
146
+ return pat.fields[0];
147
+ case 4:
148
+ return pat.fields[2];
149
+ case 5:
150
+ return pat.fields[1];
151
+ case 6:
152
+ return pat.fields[1];
153
+ case 7:
154
+ return pat.fields[2];
155
+ case 8:
156
+ return pat.fields[1];
157
+ case 9:
158
+ return pat.fields[0];
159
+ case 10:
160
+ return pat.fields[3];
161
+ case 11:
162
+ return pat.fields[1];
163
+ default:
164
+ return pat.fields[0];
165
+ }
166
+ }
167
+
168
+ export function Ast_spanOfExpr(expr) {
169
+ switch (expr.tag) {
170
+ case 1:
171
+ return expr.fields[1];
172
+ case 2:
173
+ return expr.fields[1];
174
+ case 3:
175
+ return expr.fields[1];
176
+ case 4:
177
+ return expr.fields[2];
178
+ case 5:
179
+ return expr.fields[2];
180
+ case 6:
181
+ return expr.fields[3];
182
+ case 7:
183
+ return expr.fields[1];
184
+ case 8:
185
+ return expr.fields[3];
186
+ case 9:
187
+ return expr.fields[2];
188
+ case 10:
189
+ return expr.fields[5];
190
+ case 11:
191
+ return expr.fields[3];
192
+ case 12:
193
+ return expr.fields[2];
194
+ case 13:
195
+ return expr.fields[1];
196
+ case 14:
197
+ return expr.fields[2];
198
+ case 15:
199
+ return expr.fields[1];
200
+ case 16:
201
+ return expr.fields[1];
202
+ case 17:
203
+ return expr.fields[1];
204
+ case 18:
205
+ return expr.fields[1];
206
+ case 19:
207
+ return expr.fields[2];
208
+ case 20:
209
+ return expr.fields[2];
210
+ case 21:
211
+ return expr.fields[2];
212
+ case 22:
213
+ return expr.fields[2];
214
+ case 23:
215
+ return expr.fields[2];
216
+ case 24:
217
+ return expr.fields[2];
218
+ case 25:
219
+ return expr.fields[3];
220
+ case 26:
221
+ return expr.fields[1];
222
+ case 27:
223
+ return expr.fields[0];
224
+ case 28:
225
+ return expr.fields[1];
226
+ case 29:
227
+ return expr.fields[1];
228
+ case 30:
229
+ return expr.fields[1];
230
+ default:
231
+ return expr.fields[0];
232
+ }
233
+ }
234
+