@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
@@ -0,0 +1,333 @@
1
+ import { disposeSafe, defaultOf, toIterator, getEnumerator, structuralHash, equals as equals_1, compare, Exception } from "./Util.js";
2
+ import { class_type } from "./Reflection.js";
3
+ import { SR_Arg_KeyNotFound } from "./Global.js";
4
+ import { toArray, empty, singleton, append, enumerateWhile, delay } from "./Seq.js";
5
+ import { setItem, initialize, copyTo, fill, item as item_1 } from "./Array.js";
6
+ import { max } from "./Double.js";
7
+ import { ArgumentOutOfRangeException_$ctor_Z721C83C5 } from "./System.js";
8
+ export class KeyNotFoundException extends Exception {
9
+ constructor(message) {
10
+ super(message);
11
+ }
12
+ }
13
+ export function KeyNotFoundException_$reflection() {
14
+ return class_type("System.Collections.Generic.KeyNotFoundException", undefined, KeyNotFoundException, class_type("System.Exception"));
15
+ }
16
+ export function KeyNotFoundException_$ctor_Z721C83C5(message) {
17
+ return new KeyNotFoundException(message);
18
+ }
19
+ export function KeyNotFoundException_$ctor() {
20
+ return KeyNotFoundException_$ctor_Z721C83C5(SR_Arg_KeyNotFound);
21
+ }
22
+ export class Comparer$1 {
23
+ constructor(comparison) {
24
+ this.comparison = comparison;
25
+ }
26
+ Compare(x, y) {
27
+ const _ = this;
28
+ return ((x == null) ? ((y == null) ? 0 : -1) : ((y == null) ? 1 : _.comparison(x, y))) | 0;
29
+ }
30
+ }
31
+ export function Comparer$1_$reflection(gen0) {
32
+ return class_type("System.Collections.Generic.Comparer`1", [gen0], Comparer$1);
33
+ }
34
+ export function Comparer$1_$ctor_47C913C(comparison) {
35
+ return new Comparer$1(comparison);
36
+ }
37
+ export function Comparer$1_get_Default() {
38
+ return Comparer$1_$ctor_47C913C((e, e_1) => (compare(e, e_1) | 0));
39
+ }
40
+ export function Comparer$1_Create_47C913C(comparison) {
41
+ return Comparer$1_$ctor_47C913C(comparison);
42
+ }
43
+ export function Comparer$1__Compare_5BDDA0(_, x, y) {
44
+ return _.comparison(x, y) | 0;
45
+ }
46
+ export class EqualityComparer$1 {
47
+ constructor(equals, getHashCode) {
48
+ this.equals = equals;
49
+ this.getHashCode = getHashCode;
50
+ }
51
+ Equals(x, y) {
52
+ const _ = this;
53
+ return (x == null) ? (y == null) : ((y == null) ? false : _.equals(x, y));
54
+ }
55
+ GetHashCode(x) {
56
+ const _ = this;
57
+ return _.getHashCode(x) | 0;
58
+ }
59
+ }
60
+ export function EqualityComparer$1_$reflection(gen0) {
61
+ return class_type("System.Collections.Generic.EqualityComparer`1", [gen0], EqualityComparer$1);
62
+ }
63
+ export function EqualityComparer$1_$ctor_Z6EE254AB(equals, getHashCode) {
64
+ return new EqualityComparer$1(equals, getHashCode);
65
+ }
66
+ export function EqualityComparer$1_get_Default() {
67
+ return EqualityComparer$1_$ctor_Z6EE254AB(equals_1, (obj) => (structuralHash(obj) | 0));
68
+ }
69
+ export function EqualityComparer$1_Create_Z6EE254AB(equals, getHashCode) {
70
+ return EqualityComparer$1_$ctor_Z6EE254AB(equals, getHashCode);
71
+ }
72
+ export function EqualityComparer$1__Equals_5BDDA0(_, x, y) {
73
+ return _.equals(x, y);
74
+ }
75
+ export function EqualityComparer$1__GetHashCode_2B595(_, x) {
76
+ return _.getHashCode(x) | 0;
77
+ }
78
+ export class Stack$1 {
79
+ constructor(initialContents, initialCount) {
80
+ this.contents = initialContents;
81
+ this.count = (initialCount | 0);
82
+ }
83
+ GetEnumerator() {
84
+ const _ = this;
85
+ return getEnumerator(delay(() => {
86
+ let index = _.count - 1;
87
+ return enumerateWhile(() => (index >= 0), delay(() => append(singleton(item_1(index, _.contents)), delay(() => {
88
+ index = ((index - 1) | 0);
89
+ return empty();
90
+ }))));
91
+ }));
92
+ }
93
+ [Symbol.iterator]() {
94
+ return toIterator(getEnumerator(this));
95
+ }
96
+ "System.Collections.IEnumerable.GetEnumerator"() {
97
+ const this$ = this;
98
+ return getEnumerator(this$);
99
+ }
100
+ }
101
+ export function Stack$1_$reflection(gen0) {
102
+ return class_type("System.Collections.Generic.Stack`1", [gen0], Stack$1);
103
+ }
104
+ function Stack$1_$ctor_Z3B4C077E(initialContents, initialCount) {
105
+ return new Stack$1(initialContents, initialCount);
106
+ }
107
+ export function Stack$1_$ctor_Z524259A4(initialCapacity) {
108
+ return Stack$1_$ctor_Z3B4C077E(fill(new Array(initialCapacity), 0, initialCapacity, null), 0);
109
+ }
110
+ export function Stack$1_$ctor() {
111
+ return Stack$1_$ctor_Z524259A4(4);
112
+ }
113
+ export function Stack$1_$ctor_BB573A(xs) {
114
+ const arr = Array.from(xs);
115
+ return Stack$1_$ctor_Z3B4C077E(arr, arr.length);
116
+ }
117
+ export function Stack$1__Ensure_Z524259A4(_, newSize) {
118
+ const oldSize = _.contents.length | 0;
119
+ if (newSize > oldSize) {
120
+ const old = _.contents;
121
+ _.contents = fill(new Array(max(newSize, oldSize * 2)), 0, max(newSize, oldSize * 2), null);
122
+ copyTo(old, 0, _.contents, 0, _.count);
123
+ }
124
+ }
125
+ export function Stack$1__get_Count(_) {
126
+ return _.count | 0;
127
+ }
128
+ export function Stack$1__Pop(_) {
129
+ _.count = ((_.count - 1) | 0);
130
+ return item_1(_.count, _.contents);
131
+ }
132
+ export function Stack$1__Peek(_) {
133
+ return item_1(_.count - 1, _.contents);
134
+ }
135
+ export function Stack$1__Contains_2B595(_, x) {
136
+ let found = false;
137
+ let i = 0;
138
+ while ((i < _.count) && !found) {
139
+ if (equals_1(x, item_1(i, _.contents))) {
140
+ found = true;
141
+ }
142
+ else {
143
+ i = ((i + 1) | 0);
144
+ }
145
+ }
146
+ return found;
147
+ }
148
+ export function Stack$1__TryPeek_1F3DB691(this$, result) {
149
+ if (this$.count > 0) {
150
+ result.contents = Stack$1__Peek(this$);
151
+ return true;
152
+ }
153
+ else {
154
+ return false;
155
+ }
156
+ }
157
+ export function Stack$1__TryPop_1F3DB691(this$, result) {
158
+ if (this$.count > 0) {
159
+ result.contents = Stack$1__Pop(this$);
160
+ return true;
161
+ }
162
+ else {
163
+ return false;
164
+ }
165
+ }
166
+ export function Stack$1__Push_2B595(this$, x) {
167
+ Stack$1__Ensure_Z524259A4(this$, this$.count + 1);
168
+ this$.contents[this$.count] = x;
169
+ this$.count = ((this$.count + 1) | 0);
170
+ }
171
+ export function Stack$1__Clear(_) {
172
+ _.count = 0;
173
+ fill(_.contents, 0, _.contents.length, defaultOf());
174
+ }
175
+ export function Stack$1__TrimExcess(this$) {
176
+ if ((this$.count / this$.contents.length) > 0.9) {
177
+ Stack$1__Ensure_Z524259A4(this$, this$.count);
178
+ }
179
+ }
180
+ export function Stack$1__ToArray(_) {
181
+ return initialize(_.count, (i) => item_1((_.count - 1) - i, _.contents));
182
+ }
183
+ export class Queue$1 {
184
+ constructor(initialContents, initialCount) {
185
+ this.contents = initialContents;
186
+ this.count = (initialCount | 0);
187
+ this.head = 0;
188
+ this.tail = (((initialCount === this.contents.length) ? 0 : initialCount) | 0);
189
+ }
190
+ GetEnumerator() {
191
+ const _ = this;
192
+ return getEnumerator(Queue$1__toSeq(_));
193
+ }
194
+ [Symbol.iterator]() {
195
+ return toIterator(getEnumerator(this));
196
+ }
197
+ "System.Collections.IEnumerable.GetEnumerator"() {
198
+ const this$ = this;
199
+ return getEnumerator(this$);
200
+ }
201
+ }
202
+ export function Queue$1_$reflection(gen0) {
203
+ return class_type("System.Collections.Generic.Queue`1", [gen0], Queue$1);
204
+ }
205
+ function Queue$1_$ctor_Z3B4C077E(initialContents, initialCount) {
206
+ return new Queue$1(initialContents, initialCount);
207
+ }
208
+ export function Queue$1_$ctor_Z524259A4(initialCapacity) {
209
+ if (initialCapacity < 0) {
210
+ throw ArgumentOutOfRangeException_$ctor_Z721C83C5("capacity is less than 0");
211
+ }
212
+ return Queue$1_$ctor_Z3B4C077E(fill(new Array(initialCapacity), 0, initialCapacity, null), 0);
213
+ }
214
+ export function Queue$1_$ctor() {
215
+ return Queue$1_$ctor_Z524259A4(4);
216
+ }
217
+ export function Queue$1_$ctor_BB573A(xs) {
218
+ const arr = Array.from(xs);
219
+ return Queue$1_$ctor_Z3B4C077E(arr, arr.length);
220
+ }
221
+ export function Queue$1__get_Count(_) {
222
+ return _.count | 0;
223
+ }
224
+ export function Queue$1__Enqueue_2B595(_, value) {
225
+ if (_.count === Queue$1__size(_)) {
226
+ Queue$1__ensure_Z524259A4(_, _.count + 1);
227
+ }
228
+ _.contents[_.tail] = value;
229
+ _.tail = (((_.tail + 1) % Queue$1__size(_)) | 0);
230
+ _.count = ((_.count + 1) | 0);
231
+ }
232
+ export function Queue$1__Dequeue(_) {
233
+ if (_.count === 0) {
234
+ throw new Exception("Queue is empty");
235
+ }
236
+ const value = item_1(_.head, _.contents);
237
+ _.head = (((_.head + 1) % Queue$1__size(_)) | 0);
238
+ _.count = ((_.count - 1) | 0);
239
+ return value;
240
+ }
241
+ export function Queue$1__Peek(_) {
242
+ if (_.count === 0) {
243
+ throw new Exception("Queue is empty");
244
+ }
245
+ return item_1(_.head, _.contents);
246
+ }
247
+ export function Queue$1__TryDequeue_1F3DB691(this$, result) {
248
+ if (this$.count === 0) {
249
+ return false;
250
+ }
251
+ else {
252
+ result.contents = Queue$1__Dequeue(this$);
253
+ return true;
254
+ }
255
+ }
256
+ export function Queue$1__TryPeek_1F3DB691(this$, result) {
257
+ if (this$.count === 0) {
258
+ return false;
259
+ }
260
+ else {
261
+ result.contents = Queue$1__Peek(this$);
262
+ return true;
263
+ }
264
+ }
265
+ export function Queue$1__Contains_2B595(_, x) {
266
+ let found = false;
267
+ let i = 0;
268
+ while ((i < _.count) && !found) {
269
+ if (equals_1(x, item_1(Queue$1__toIndex_Z524259A4(_, i), _.contents))) {
270
+ found = true;
271
+ }
272
+ else {
273
+ i = ((i + 1) | 0);
274
+ }
275
+ }
276
+ return found;
277
+ }
278
+ export function Queue$1__Clear(_) {
279
+ _.count = 0;
280
+ _.head = 0;
281
+ _.tail = 0;
282
+ fill(_.contents, 0, Queue$1__size(_), defaultOf());
283
+ }
284
+ export function Queue$1__TrimExcess(_) {
285
+ if ((_.count / _.contents.length) > 0.9) {
286
+ Queue$1__ensure_Z524259A4(_, _.count);
287
+ }
288
+ }
289
+ export function Queue$1__ToArray(_) {
290
+ return toArray(Queue$1__toSeq(_));
291
+ }
292
+ export function Queue$1__CopyTo_Z3B4C077E(_, target, start) {
293
+ let i = start;
294
+ const enumerator = getEnumerator(Queue$1__toSeq(_));
295
+ try {
296
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
297
+ const item = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
298
+ setItem(target, i, item);
299
+ i = ((i + 1) | 0);
300
+ }
301
+ }
302
+ finally {
303
+ disposeSafe(enumerator);
304
+ }
305
+ }
306
+ export function Queue$1__size(this$) {
307
+ return this$.contents.length | 0;
308
+ }
309
+ export function Queue$1__toIndex_Z524259A4(this$, i) {
310
+ return ((this$.head + i) % Queue$1__size(this$)) | 0;
311
+ }
312
+ export function Queue$1__ensure_Z524259A4(this$, requiredSize) {
313
+ const newBuffer = fill(new Array(requiredSize), 0, requiredSize, null);
314
+ if (this$.head < this$.tail) {
315
+ copyTo(this$.contents, this$.head, newBuffer, 0, this$.count);
316
+ }
317
+ else {
318
+ copyTo(this$.contents, this$.head, newBuffer, 0, Queue$1__size(this$) - this$.head);
319
+ copyTo(this$.contents, 0, newBuffer, Queue$1__size(this$) - this$.head, this$.tail);
320
+ }
321
+ this$.head = 0;
322
+ this$.contents = newBuffer;
323
+ this$.tail = (((this$.count === Queue$1__size(this$)) ? 0 : this$.count) | 0);
324
+ }
325
+ export function Queue$1__toSeq(this$) {
326
+ return delay(() => {
327
+ let i = 0;
328
+ return enumerateWhile(() => (i < this$.count), delay(() => append(singleton(item_1(Queue$1__toIndex_Z524259A4(this$, i), this$.contents)), delay(() => {
329
+ i = ((i + 1) | 0);
330
+ return empty();
331
+ }))));
332
+ });
333
+ }
@@ -0,0 +1,200 @@
1
+ import { replace, format, replicate, substring, isNullOrEmpty, join } from "./String.js";
2
+ import { class_type } from "./Reflection.js";
3
+ import { toString } from "./Types.js";
4
+ import { Exception, clear, int64ToString, int32ToString, int16ToString } from "./Util.js";
5
+ import { setItem, item } from "./Array.js";
6
+ export class StringBuilder {
7
+ constructor(value, capacity) {
8
+ this.buf = [];
9
+ if (!isNullOrEmpty(value)) {
10
+ void (this.buf.push(value));
11
+ }
12
+ }
13
+ toString() {
14
+ const _ = this;
15
+ return join("", _.buf);
16
+ }
17
+ }
18
+ export function StringBuilder_$reflection() {
19
+ return class_type("System.Text.StringBuilder", undefined, StringBuilder);
20
+ }
21
+ export function StringBuilder_$ctor_Z18115A39(value, capacity) {
22
+ return new StringBuilder(value, capacity);
23
+ }
24
+ export function StringBuilder_$ctor_Z524259A4(capacity) {
25
+ return StringBuilder_$ctor_Z18115A39("", capacity);
26
+ }
27
+ export function StringBuilder_$ctor_Z721C83C5(value) {
28
+ return StringBuilder_$ctor_Z18115A39(value, 16);
29
+ }
30
+ export function StringBuilder_$ctor() {
31
+ return StringBuilder_$ctor_Z18115A39("", 16);
32
+ }
33
+ export function StringBuilder__Append_Z721C83C5(x, s) {
34
+ void (x.buf.push(toString(s)));
35
+ return x;
36
+ }
37
+ export function StringBuilder__Append_487EF8FB(x, s, startIndex, count) {
38
+ void (x.buf.push(substring(toString(s), startIndex, count)));
39
+ return x;
40
+ }
41
+ export function StringBuilder__Append_244C7CD6(x, c) {
42
+ void (x.buf.push(c));
43
+ return x;
44
+ }
45
+ export function StringBuilder__Append_61B1CA(x, c, repeatCount) {
46
+ const s = replicate(repeatCount, c);
47
+ void (x.buf.push(s));
48
+ return x;
49
+ }
50
+ export function StringBuilder__Append_Z510FF069(x, o) {
51
+ void (x.buf.push(o.toString()));
52
+ return x;
53
+ }
54
+ export function StringBuilder__Append_244D3E44(x, o) {
55
+ void (x.buf.push(o.toString()));
56
+ return x;
57
+ }
58
+ export function StringBuilder__Append_Z524259E6(x, o) {
59
+ void (x.buf.push(int16ToString(o)));
60
+ return x;
61
+ }
62
+ export function StringBuilder__Append_Z6EF82811(x, o) {
63
+ void (x.buf.push(o.toString()));
64
+ return x;
65
+ }
66
+ export function StringBuilder__Append_Z524259A4(x, o) {
67
+ void (x.buf.push(int32ToString(o)));
68
+ return x;
69
+ }
70
+ export function StringBuilder__Append_Z6EF827D7(x, o) {
71
+ void (x.buf.push(o.toString()));
72
+ return x;
73
+ }
74
+ export function StringBuilder__Append_Z524259C1(x, o) {
75
+ void (x.buf.push(int64ToString(o)));
76
+ return x;
77
+ }
78
+ export function StringBuilder__Append_Z6EF827B6(x, o) {
79
+ void (x.buf.push(o.toString()));
80
+ return x;
81
+ }
82
+ export function StringBuilder__Append_Z7138B98C(x, o) {
83
+ void (x.buf.push(o.toString()));
84
+ return x;
85
+ }
86
+ export function StringBuilder__Append_5E38073B(x, o) {
87
+ void (x.buf.push(o.toString()));
88
+ return x;
89
+ }
90
+ export function StringBuilder__Append_Z1FBCCD16(x, o) {
91
+ void (x.buf.push(toString(o)));
92
+ return x;
93
+ }
94
+ export function StringBuilder__Append_4E60E31B(x, o) {
95
+ void (x.buf.push(toString(o)));
96
+ return x;
97
+ }
98
+ export function StringBuilder__Append_Z372E4D23(x, cs) {
99
+ void (x.buf.push(cs.join('')));
100
+ return x;
101
+ }
102
+ export function StringBuilder__Append_43A65C09(x, s) {
103
+ void (x.buf.push(s.toString()));
104
+ return x;
105
+ }
106
+ export function StringBuilder__AppendFormat_433E080(x, fmt, o) {
107
+ void (x.buf.push(format(fmt, o)));
108
+ return x;
109
+ }
110
+ export function StringBuilder__AppendFormat_Z3B30EC65(x, fmt, o1, o2) {
111
+ void (x.buf.push(format(fmt, o1, o2)));
112
+ return x;
113
+ }
114
+ export function StringBuilder__AppendFormat_10D165E0(x, fmt, o1, o2, o3) {
115
+ void (x.buf.push(format(fmt, o1, o2, o3)));
116
+ return x;
117
+ }
118
+ export function StringBuilder__AppendFormat_Z17053F5(x, fmt, arr) {
119
+ void (x.buf.push(format(fmt, ...arr)));
120
+ return x;
121
+ }
122
+ export function StringBuilder__AppendFormat_Z696D8D1B(x, provider, fmt, o) {
123
+ void (x.buf.push(format(provider, fmt, o)));
124
+ return x;
125
+ }
126
+ export function StringBuilder__AppendFormat_26802C9E(x, provider, fmt, o1, o2) {
127
+ void (x.buf.push(format(provider, fmt, o1, o2)));
128
+ return x;
129
+ }
130
+ export function StringBuilder__AppendFormat_Z471ADCBB(x, provider, fmt, o1, o2, o3) {
131
+ void (x.buf.push(format(provider, fmt, o1, o2, o3)));
132
+ return x;
133
+ }
134
+ export function StringBuilder__AppendFormat_6C2E3E6E(x, provider, fmt, arr) {
135
+ void (x.buf.push(format(provider, fmt, ...arr)));
136
+ return x;
137
+ }
138
+ export function StringBuilder__AppendLine(x) {
139
+ void (x.buf.push("\n"));
140
+ return x;
141
+ }
142
+ export function StringBuilder__AppendLine_Z721C83C5(x, s) {
143
+ void (x.buf.push(s));
144
+ void (x.buf.push("\n"));
145
+ return x;
146
+ }
147
+ export function StringBuilder__Clear(x) {
148
+ clear(x.buf);
149
+ return x;
150
+ }
151
+ export function StringBuilder__get_Chars_Z524259A4(x, index) {
152
+ let len = 0;
153
+ let i = 0;
154
+ while ((i < x.buf.length) && ((len + item(i, x.buf).length) <= index)) {
155
+ len = ((len + item(i, x.buf).length) | 0);
156
+ i = ((i + 1) | 0);
157
+ }
158
+ if ((index < 0) ? true : (i >= x.buf.length)) {
159
+ throw new Exception("Index was outside the bounds of the array");
160
+ }
161
+ else {
162
+ const pos = (index - len) | 0;
163
+ return item(i, x.buf)[pos];
164
+ }
165
+ }
166
+ export function StringBuilder__set_Chars_413E0D0A(x, index, value) {
167
+ let len = 0;
168
+ let i = 0;
169
+ while ((i < x.buf.length) && ((len + item(i, x.buf).length) <= index)) {
170
+ len = ((len + item(i, x.buf).length) | 0);
171
+ i = ((i + 1) | 0);
172
+ }
173
+ if ((index < 0) ? true : (i >= x.buf.length)) {
174
+ throw new Exception("Index was outside the bounds of the array");
175
+ }
176
+ else {
177
+ const pos = (index - len) | 0;
178
+ setItem(x.buf, i, (item(i, x.buf).slice(0, (pos - 1) + 1) + value) + item(i, x.buf).slice(pos + 1, item(i, x.buf).length));
179
+ }
180
+ }
181
+ export function StringBuilder__Replace_Z766F94C0(x, oldValue, newValue) {
182
+ for (let i = x.buf.length - 1; i >= 0; i--) {
183
+ setItem(x.buf, i, replace(item(i, x.buf), oldValue, newValue));
184
+ }
185
+ return x;
186
+ }
187
+ export function StringBuilder__Replace_Z384F8060(x, oldValue, newValue) {
188
+ const str = replace(x.toString(), oldValue, newValue);
189
+ return StringBuilder__Append_Z721C83C5(StringBuilder__Clear(x), str);
190
+ }
191
+ export function StringBuilder__get_Length(x) {
192
+ let len = 0;
193
+ for (let i = x.buf.length - 1; i >= 0; i--) {
194
+ len = ((len + item(i, x.buf).length) | 0);
195
+ }
196
+ return len | 0;
197
+ }
198
+ export function StringBuilder__ToString_Z37302880(x, firstIndex, length) {
199
+ return substring(x.toString(), firstIndex, length);
200
+ }