@temperlang/std 0.2.1 → 0.4.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/json.js ADDED
@@ -0,0 +1,2033 @@
1
+ const {
2
+ trunc: trunc__711
3
+ } = globalThis.Math;
4
+ import {
5
+ type as type__383, requireInstanceOf as requireInstanceOf__570, requireStringIndex as requireStringIndex__836, cmpFloat as cmpFloat__948, mappedGetOr as mappedGetOr_411, listedGet as listedGet_413, mappedForEach as mappedForEach_426, float64ToString as float64ToString_463, float64ToInt as float64ToInt_465, stringToInt as stringToInt_477, stringToFloat64 as stringToFloat64_478, listBuilderAdd as listBuilderAdd_490, listedGetOr as listedGetOr_494, listBuilderSet as listBuilderSet_502, listBuilderRemoveLast as listBuilderRemoveLast_507, mapBuilderConstructor as mapBuilderConstructor_564, mappedGet as mappedGet_575, mapBuilderSet as mapBuilderSet_576, listBuilderToList as listBuilderToList_582, mappedToMap as mappedToMap_583, stringGet as stringGet_628, stringNext as stringNext_731, stringHasAtLeast as stringHasAtLeast_805, stringBuilderAppendCodePoint as stringBuilderAppendCodePoint_810
6
+ } from "@temperlang/core";
7
+ export class InterchangeContext extends type__383() {
8
+ };
9
+ export class NullInterchangeContext extends type__383(InterchangeContext) {
10
+ /**
11
+ * @param {string} headerName_385
12
+ * @returns {string | null}
13
+ */
14
+ getHeader(headerName_385) {
15
+ return null;
16
+ }
17
+ /** @type {NullInterchangeContext} */
18
+ static #instance_386 = new NullInterchangeContext();
19
+ /** @returns {NullInterchangeContext} */
20
+ static get instance() {
21
+ return this.#instance_386;
22
+ }
23
+ constructor() {
24
+ super ();
25
+ return;
26
+ }
27
+ };
28
+ export class JsonProducer extends type__383() {
29
+ startObject() {
30
+ null;
31
+ return;
32
+ }
33
+ endObject() {
34
+ null;
35
+ return;
36
+ }
37
+ /** @param {string} key_390 */
38
+ objectKey(key_390) {
39
+ null;
40
+ return;
41
+ }
42
+ startArray() {
43
+ null;
44
+ return;
45
+ }
46
+ endArray() {
47
+ null;
48
+ return;
49
+ }
50
+ nullValue() {
51
+ null;
52
+ return;
53
+ }
54
+ /** @param {boolean} x_395 */
55
+ booleanValue(x_395) {
56
+ null;
57
+ return;
58
+ }
59
+ /** @param {number} x_397 */
60
+ intValue(x_397) {
61
+ null;
62
+ return;
63
+ }
64
+ /** @param {number} x_399 */
65
+ float64Value(x_399) {
66
+ null;
67
+ return;
68
+ }
69
+ /** @param {string} x_401 */
70
+ numericTokenValue(x_401) {
71
+ null;
72
+ return;
73
+ }
74
+ /** @param {string} x_403 */
75
+ stringValue(x_403) {
76
+ null;
77
+ return;
78
+ }
79
+ };
80
+ export class JsonSyntaxTree extends type__383() {
81
+ /** @param {JsonProducer} p_405 */
82
+ produce(p_405) {
83
+ null;
84
+ return;
85
+ }
86
+ };
87
+ export class JsonObject extends type__383(JsonSyntaxTree) {
88
+ /** @type {Map<string, Array<JsonSyntaxTree>>} */
89
+ #properties_406;
90
+ /**
91
+ * @param {string} propertyKey_408
92
+ * @returns {JsonSyntaxTree | null}
93
+ */
94
+ propertyValueOrNull(propertyKey_408) {
95
+ let return_409;
96
+ const treeList_410 = mappedGetOr_411(this.#properties_406, propertyKey_408, Object.freeze([]));
97
+ const lastIndex_412 = treeList_410.length - 1;
98
+ if (lastIndex_412 >= 0) {
99
+ return_409 = listedGet_413(treeList_410, lastIndex_412);
100
+ } else {
101
+ return_409 = null;
102
+ }
103
+ return return_409;
104
+ }
105
+ /**
106
+ * @param {string} propertyKey_415
107
+ * @returns {JsonSyntaxTree}
108
+ */
109
+ propertyValueOrBubble(propertyKey_415) {
110
+ let return_416;
111
+ let t_417;
112
+ t_417 = this.propertyValueOrNull(propertyKey_415);
113
+ const t_418 = t_417;
114
+ if (t_418 == null) {
115
+ throw Error();
116
+ } else {
117
+ return_416 = t_418;
118
+ }
119
+ return return_416;
120
+ }
121
+ /** @param {JsonProducer} p_420 */
122
+ produce(p_420) {
123
+ p_420.startObject();
124
+ function fn_421(k_422, vs_423) {
125
+ function fn_424(v_425) {
126
+ p_420.objectKey(k_422);
127
+ v_425.produce(p_420);
128
+ return;
129
+ }
130
+ vs_423.forEach(fn_424);
131
+ return;
132
+ }
133
+ mappedForEach_426(this.#properties_406, fn_421);
134
+ p_420.endObject();
135
+ return;
136
+ }
137
+ /** @param {Map<string, Array<JsonSyntaxTree>>} properties_427 */
138
+ constructor(properties_427) {
139
+ super ();
140
+ this.#properties_406 = properties_427;
141
+ return;
142
+ }
143
+ /** @returns {Map<string, Array<JsonSyntaxTree>>} */
144
+ get properties() {
145
+ return this.#properties_406;
146
+ }
147
+ };
148
+ export class JsonArray extends type__383(JsonSyntaxTree) {
149
+ /** @type {Array<JsonSyntaxTree>} */
150
+ #elements_429;
151
+ /** @param {JsonProducer} p_431 */
152
+ produce(p_431) {
153
+ p_431.startArray();
154
+ function fn_432(v_433) {
155
+ v_433.produce(p_431);
156
+ return;
157
+ }
158
+ this.#elements_429.forEach(fn_432);
159
+ p_431.endArray();
160
+ return;
161
+ }
162
+ /** @param {Array<JsonSyntaxTree>} elements_434 */
163
+ constructor(elements_434) {
164
+ super ();
165
+ this.#elements_429 = elements_434;
166
+ return;
167
+ }
168
+ /** @returns {Array<JsonSyntaxTree>} */
169
+ get elements() {
170
+ return this.#elements_429;
171
+ }
172
+ };
173
+ export class JsonBoolean extends type__383(JsonSyntaxTree) {
174
+ /** @type {boolean} */
175
+ #content_436;
176
+ /** @param {JsonProducer} p_438 */
177
+ produce(p_438) {
178
+ p_438.booleanValue(this.#content_436);
179
+ return;
180
+ }
181
+ /** @param {boolean} content_439 */
182
+ constructor(content_439) {
183
+ super ();
184
+ this.#content_436 = content_439;
185
+ return;
186
+ }
187
+ /** @returns {boolean} */
188
+ get content() {
189
+ return this.#content_436;
190
+ }
191
+ };
192
+ export class JsonNull extends type__383(JsonSyntaxTree) {
193
+ /** @param {JsonProducer} p_442 */
194
+ produce(p_442) {
195
+ p_442.nullValue();
196
+ return;
197
+ }
198
+ constructor() {
199
+ super ();
200
+ return;
201
+ }
202
+ };
203
+ export class JsonString extends type__383(JsonSyntaxTree) {
204
+ /** @type {string} */
205
+ #content_443;
206
+ /** @param {JsonProducer} p_445 */
207
+ produce(p_445) {
208
+ p_445.stringValue(this.#content_443);
209
+ return;
210
+ }
211
+ /** @param {string} content_446 */
212
+ constructor(content_446) {
213
+ super ();
214
+ this.#content_443 = content_446;
215
+ return;
216
+ }
217
+ /** @returns {string} */
218
+ get content() {
219
+ return this.#content_443;
220
+ }
221
+ };
222
+ export class JsonNumeric extends type__383(JsonSyntaxTree) {
223
+ };
224
+ export class JsonInt extends type__383(JsonNumeric) {
225
+ /** @type {number} */
226
+ #content_451;
227
+ /** @param {JsonProducer} p_453 */
228
+ produce(p_453) {
229
+ p_453.intValue(this.#content_451);
230
+ return;
231
+ }
232
+ /** @returns {string} */
233
+ asJsonNumericToken() {
234
+ return this.#content_451.toString();
235
+ }
236
+ /** @returns {number} */
237
+ asInt() {
238
+ return this.#content_451;
239
+ }
240
+ /** @returns {number} */
241
+ asFloat64() {
242
+ return this.#content_451;
243
+ }
244
+ /** @param {number} content_457 */
245
+ constructor(content_457) {
246
+ super ();
247
+ this.#content_451 = content_457;
248
+ return;
249
+ }
250
+ /** @returns {number} */
251
+ get content() {
252
+ return this.#content_451;
253
+ }
254
+ };
255
+ export class JsonFloat64 extends type__383(JsonNumeric) {
256
+ /** @type {number} */
257
+ #content_459;
258
+ /** @param {JsonProducer} p_461 */
259
+ produce(p_461) {
260
+ p_461.float64Value(this.#content_459);
261
+ return;
262
+ }
263
+ /** @returns {string} */
264
+ asJsonNumericToken() {
265
+ return float64ToString_463(this.#content_459);
266
+ }
267
+ /** @returns {number} */
268
+ asInt() {
269
+ return float64ToInt_465(this.#content_459);
270
+ }
271
+ /** @returns {number} */
272
+ asFloat64() {
273
+ return this.#content_459;
274
+ }
275
+ /** @param {number} content_467 */
276
+ constructor(content_467) {
277
+ super ();
278
+ this.#content_459 = content_467;
279
+ return;
280
+ }
281
+ /** @returns {number} */
282
+ get content() {
283
+ return this.#content_459;
284
+ }
285
+ };
286
+ export class JsonNumericToken extends type__383(JsonNumeric) {
287
+ /** @type {string} */
288
+ #content_469;
289
+ /** @param {JsonProducer} p_471 */
290
+ produce(p_471) {
291
+ p_471.numericTokenValue(this.#content_469);
292
+ return;
293
+ }
294
+ /** @returns {string} */
295
+ asJsonNumericToken() {
296
+ return this.#content_469;
297
+ }
298
+ /** @returns {number} */
299
+ asInt() {
300
+ let return_474;
301
+ let t_475;
302
+ let t_476;
303
+ try {
304
+ t_475 = stringToInt_477(this.#content_469);
305
+ return_474 = t_475;
306
+ } catch {
307
+ t_476 = stringToFloat64_478(this.#content_469);
308
+ return_474 = float64ToInt_465(t_476);
309
+ }
310
+ return return_474;
311
+ }
312
+ /** @returns {number} */
313
+ asFloat64() {
314
+ return stringToFloat64_478(this.#content_469);
315
+ }
316
+ /** @param {string} content_480 */
317
+ constructor(content_480) {
318
+ super ();
319
+ this.#content_469 = content_480;
320
+ return;
321
+ }
322
+ /** @returns {string} */
323
+ get content() {
324
+ return this.#content_469;
325
+ }
326
+ };
327
+ export class JsonTextProducer extends type__383(JsonProducer) {
328
+ /** @type {InterchangeContext} */
329
+ #interchangeContext_482;
330
+ /** @type {globalThis.Array<string>} */
331
+ #buffer_483;
332
+ /** @type {Array<number>} */
333
+ #stack_484;
334
+ /** @type {boolean} */
335
+ #wellFormed_485;
336
+ /** @param {InterchangeContext | null} [interchangeContext_486] */
337
+ constructor(interchangeContext_486) {
338
+ super ();
339
+ let interchangeContext_487;
340
+ if (interchangeContext_486 == null) {
341
+ interchangeContext_487 = NullInterchangeContext.instance;
342
+ } else {
343
+ interchangeContext_487 = interchangeContext_486;
344
+ }
345
+ this.#interchangeContext_482 = interchangeContext_487;
346
+ let t_488 = [""];
347
+ this.#buffer_483 = t_488;
348
+ let t_489 = [];
349
+ this.#stack_484 = t_489;
350
+ listBuilderAdd_490(this.#stack_484, 5);
351
+ this.#wellFormed_485 = true;
352
+ return;
353
+ }
354
+ /** @returns {number} */
355
+ #state_492() {
356
+ let t_493 = this.#stack_484.length;
357
+ return listedGetOr_494(this.#stack_484, t_493 - 1, -1);
358
+ }
359
+ #beforeValue_496() {
360
+ let t_497;
361
+ let t_498;
362
+ let t_499;
363
+ let t_500;
364
+ const currentState_501 = this.#state_492();
365
+ if (currentState_501 === 3) {
366
+ t_497 = this.#stack_484.length;
367
+ listBuilderSet_502(this.#stack_484, t_497 - 1, 4);
368
+ } else if (currentState_501 === 4) {
369
+ this.#buffer_483[0] += ",";
370
+ } else if (currentState_501 === 1) {
371
+ t_498 = this.#stack_484.length;
372
+ listBuilderSet_502(this.#stack_484, t_498 - 1, 2);
373
+ } else if (currentState_501 === 5) {
374
+ t_499 = this.#stack_484.length;
375
+ listBuilderSet_502(this.#stack_484, t_499 - 1, 6);
376
+ } else {
377
+ if (currentState_501 === 6) {
378
+ t_500 = true;
379
+ } else {
380
+ t_500 = currentState_501 === 2;
381
+ }
382
+ if (t_500) {
383
+ this.#wellFormed_485 = false;
384
+ }
385
+ }
386
+ return;
387
+ }
388
+ startObject() {
389
+ this.#beforeValue_496();
390
+ this.#buffer_483[0] += "{";
391
+ listBuilderAdd_490(this.#stack_484, 0);
392
+ return;
393
+ }
394
+ endObject() {
395
+ let t_505;
396
+ this.#buffer_483[0] += "}";
397
+ const currentState_506 = this.#state_492();
398
+ if (0 === currentState_506) {
399
+ t_505 = true;
400
+ } else {
401
+ t_505 = 2 === currentState_506;
402
+ }
403
+ if (t_505) {
404
+ listBuilderRemoveLast_507(this.#stack_484);
405
+ } else {
406
+ this.#wellFormed_485 = false;
407
+ }
408
+ return;
409
+ }
410
+ /** @param {string} key_509 */
411
+ objectKey(key_509) {
412
+ let t_510;
413
+ const currentState_511 = this.#state_492();
414
+ if (!(currentState_511 === 0)) {
415
+ if (currentState_511 === 2) {
416
+ this.#buffer_483[0] += ",";
417
+ } else {
418
+ this.#wellFormed_485 = false;
419
+ }
420
+ }
421
+ encodeJsonString_512(key_509, this.#buffer_483);
422
+ this.#buffer_483[0] += ":";
423
+ if (currentState_511 >= 0) {
424
+ t_510 = this.#stack_484.length;
425
+ listBuilderSet_502(this.#stack_484, t_510 - 1, 1);
426
+ }
427
+ return;
428
+ }
429
+ startArray() {
430
+ this.#beforeValue_496();
431
+ this.#buffer_483[0] += "[";
432
+ listBuilderAdd_490(this.#stack_484, 3);
433
+ return;
434
+ }
435
+ endArray() {
436
+ let t_515;
437
+ this.#buffer_483[0] += "]";
438
+ const currentState_516 = this.#state_492();
439
+ if (3 === currentState_516) {
440
+ t_515 = true;
441
+ } else {
442
+ t_515 = 4 === currentState_516;
443
+ }
444
+ if (t_515) {
445
+ listBuilderRemoveLast_507(this.#stack_484);
446
+ } else {
447
+ this.#wellFormed_485 = false;
448
+ }
449
+ return;
450
+ }
451
+ nullValue() {
452
+ this.#beforeValue_496();
453
+ this.#buffer_483[0] += "null";
454
+ return;
455
+ }
456
+ /** @param {boolean} x_519 */
457
+ booleanValue(x_519) {
458
+ let t_520;
459
+ this.#beforeValue_496();
460
+ if (x_519) {
461
+ t_520 = "true";
462
+ } else {
463
+ t_520 = "false";
464
+ }
465
+ this.#buffer_483[0] += t_520;
466
+ return;
467
+ }
468
+ /** @param {number} x_522 */
469
+ intValue(x_522) {
470
+ this.#beforeValue_496();
471
+ let t_523 = x_522.toString();
472
+ this.#buffer_483[0] += t_523;
473
+ return;
474
+ }
475
+ /** @param {number} x_525 */
476
+ float64Value(x_525) {
477
+ this.#beforeValue_496();
478
+ let t_526 = float64ToString_463(x_525);
479
+ this.#buffer_483[0] += t_526;
480
+ return;
481
+ }
482
+ /** @param {string} x_528 */
483
+ numericTokenValue(x_528) {
484
+ this.#beforeValue_496();
485
+ this.#buffer_483[0] += x_528;
486
+ return;
487
+ }
488
+ /** @param {string} x_530 */
489
+ stringValue(x_530) {
490
+ this.#beforeValue_496();
491
+ encodeJsonString_512(x_530, this.#buffer_483);
492
+ return;
493
+ }
494
+ /** @returns {string} */
495
+ toJsonString() {
496
+ let return_532;
497
+ let t_533;
498
+ let t_534;
499
+ let t_535;
500
+ if (this.#wellFormed_485) {
501
+ if (this.#stack_484.length === 1) {
502
+ t_533 = this.#state_492();
503
+ t_534 = t_533 === 6;
504
+ } else {
505
+ t_534 = false;
506
+ }
507
+ t_535 = t_534;
508
+ } else {
509
+ t_535 = false;
510
+ }
511
+ if (t_535) {
512
+ return_532 = this.#buffer_483[0];
513
+ } else {
514
+ throw Error();
515
+ }
516
+ return return_532;
517
+ }
518
+ /** @returns {InterchangeContext} */
519
+ get interchangeContext() {
520
+ return this.#interchangeContext_482;
521
+ }
522
+ };
523
+ export class JsonParseErrorReceiver extends type__383() {
524
+ /** @param {string} explanation_538 */
525
+ explainJsonError(explanation_538) {
526
+ null;
527
+ return;
528
+ }
529
+ };
530
+ export class JsonSyntaxTreeProducer extends type__383(JsonProducer, JsonParseErrorReceiver) {
531
+ /** @type {Array<Array<JsonSyntaxTree>>} */
532
+ #stack_539;
533
+ /** @type {string | null} */
534
+ #error_540;
535
+ /** @returns {InterchangeContext} */
536
+ get interchangeContext() {
537
+ return NullInterchangeContext.instance;
538
+ }
539
+ constructor() {
540
+ super ();
541
+ let t_542 = [];
542
+ this.#stack_539 = t_542;
543
+ let t_543 = [];
544
+ listBuilderAdd_490(this.#stack_539, t_543);
545
+ this.#error_540 = null;
546
+ return;
547
+ }
548
+ /** @param {JsonSyntaxTree} v_546 */
549
+ #storeValue_545(v_546) {
550
+ let t_547;
551
+ let t_548;
552
+ if (! ! this.#stack_539.length) {
553
+ t_547 = this.#stack_539.length;
554
+ t_548 = listedGet_413(this.#stack_539, t_547 - 1);
555
+ listBuilderAdd_490(t_548, v_546);
556
+ }
557
+ return;
558
+ }
559
+ startObject() {
560
+ let t_550 = [];
561
+ listBuilderAdd_490(this.#stack_539, t_550);
562
+ return;
563
+ }
564
+ endObject() {
565
+ let return_552;
566
+ let t_553;
567
+ let t_554;
568
+ let t_555;
569
+ let t_556;
570
+ let t_557;
571
+ let t_558;
572
+ let t_559;
573
+ let t_560;
574
+ fn_561: {
575
+ if (! this.#stack_539.length) {
576
+ return_552 = void 0;
577
+ break fn_561;
578
+ }
579
+ let ls_562;
580
+ ls_562 = listBuilderRemoveLast_507(this.#stack_539);
581
+ const m_563 = mapBuilderConstructor_564();
582
+ let multis_565 = null;
583
+ let i_566 = 0;
584
+ let n_567 = ls_562.length & -2;
585
+ while (i_566 < n_567) {
586
+ const postfixReturn_568 = i_566;
587
+ i_566 = i_566 + 1;
588
+ t_555 = listedGet_413(ls_562, postfixReturn_568);
589
+ const keyTree_569 = t_555;
590
+ if (!(keyTree_569 instanceof JsonString)) {
591
+ break;
592
+ }
593
+ t_556 = requireInstanceOf__570(keyTree_569, JsonString);
594
+ const key_571 = t_556.content;
595
+ const postfixReturn_572 = i_566;
596
+ i_566 = i_566 + 1;
597
+ t_557 = listedGet_413(ls_562, postfixReturn_572);
598
+ const value_573 = t_557;
599
+ if (m_563.has(key_571)) {
600
+ if (multis_565 == null) {
601
+ t_553 = mapBuilderConstructor_564();
602
+ multis_565 = t_553;
603
+ }
604
+ if (multis_565 == null) {
605
+ throw Error();
606
+ } else {
607
+ t_558 = multis_565;
608
+ }
609
+ const mb_574 = t_558;
610
+ if (! mb_574.has(key_571)) {
611
+ t_559 = mappedGet_575(m_563, key_571);
612
+ mapBuilderSet_576(mb_574, key_571, t_559.slice());
613
+ }
614
+ t_560 = mappedGet_575(mb_574, key_571);
615
+ listBuilderAdd_490(t_560, value_573);
616
+ } else {
617
+ mapBuilderSet_576(m_563, key_571, Object.freeze([value_573]));
618
+ }
619
+ }
620
+ const multis_577 = multis_565;
621
+ if (!(multis_577 == null)) {
622
+ function fn_578(k_579, vs_580) {
623
+ let t_581 = listBuilderToList_582(vs_580);
624
+ mapBuilderSet_576(m_563, k_579, t_581);
625
+ return;
626
+ }
627
+ mappedForEach_426(multis_577, fn_578);
628
+ }
629
+ t_554 = new JsonObject(mappedToMap_583(m_563));
630
+ this.#storeValue_545(t_554);
631
+ return_552 = void 0;
632
+ }
633
+ return return_552;
634
+ }
635
+ /** @param {string} key_585 */
636
+ objectKey(key_585) {
637
+ let t_586 = new JsonString(key_585);
638
+ this.#storeValue_545(t_586);
639
+ return;
640
+ }
641
+ startArray() {
642
+ let t_588 = [];
643
+ listBuilderAdd_490(this.#stack_539, t_588);
644
+ return;
645
+ }
646
+ endArray() {
647
+ let return_590;
648
+ let t_591;
649
+ fn_592: {
650
+ if (! this.#stack_539.length) {
651
+ return_590 = void 0;
652
+ break fn_592;
653
+ }
654
+ let ls_593;
655
+ ls_593 = listBuilderRemoveLast_507(this.#stack_539);
656
+ t_591 = new JsonArray(listBuilderToList_582(ls_593));
657
+ this.#storeValue_545(t_591);
658
+ return_590 = void 0;
659
+ }
660
+ return return_590;
661
+ }
662
+ nullValue() {
663
+ let t_595 = new JsonNull();
664
+ this.#storeValue_545(t_595);
665
+ return;
666
+ }
667
+ /** @param {boolean} x_597 */
668
+ booleanValue(x_597) {
669
+ let t_598 = new JsonBoolean(x_597);
670
+ this.#storeValue_545(t_598);
671
+ return;
672
+ }
673
+ /** @param {number} x_600 */
674
+ intValue(x_600) {
675
+ let t_601 = new JsonInt(x_600);
676
+ this.#storeValue_545(t_601);
677
+ return;
678
+ }
679
+ /** @param {number} x_603 */
680
+ float64Value(x_603) {
681
+ let t_604 = new JsonFloat64(x_603);
682
+ this.#storeValue_545(t_604);
683
+ return;
684
+ }
685
+ /** @param {string} x_606 */
686
+ numericTokenValue(x_606) {
687
+ let t_607 = new JsonNumericToken(x_606);
688
+ this.#storeValue_545(t_607);
689
+ return;
690
+ }
691
+ /** @param {string} x_609 */
692
+ stringValue(x_609) {
693
+ let t_610 = new JsonString(x_609);
694
+ this.#storeValue_545(t_610);
695
+ return;
696
+ }
697
+ /** @returns {JsonSyntaxTree} */
698
+ toJsonSyntaxTree() {
699
+ let t_612;
700
+ if (this.#stack_539.length !== 1) {
701
+ t_612 = true;
702
+ } else {
703
+ t_612 = !(this.#error_540 == null);
704
+ }
705
+ if (t_612) {
706
+ throw Error();
707
+ }
708
+ let ls_613;
709
+ ls_613 = listedGet_413(this.#stack_539, 0);
710
+ if (ls_613.length !== 1) {
711
+ throw Error();
712
+ }
713
+ return listedGet_413(ls_613, 0);
714
+ }
715
+ /** @returns {string | null} */
716
+ get jsonError() {
717
+ return this.#error_540;
718
+ }
719
+ /** @param {string} error_616 */
720
+ explainJsonError(error_616) {
721
+ this.#error_540 = error_616;
722
+ return;
723
+ }
724
+ };
725
+ /**
726
+ * @param {string} sourceText_618
727
+ * @param {globalThis.number} i_619
728
+ * @param {JsonProducer} out_620
729
+ * @returns {globalThis.number}
730
+ */
731
+ function parseJsonValue_617(sourceText_618, i_619, out_620) {
732
+ let return_621;
733
+ let t_622;
734
+ let t_623;
735
+ let t_624;
736
+ fn_625: {
737
+ t_622 = skipJsonSpaces_626(sourceText_618, i_619);
738
+ i_619 = t_622;
739
+ if (!(sourceText_618.length > i_619)) {
740
+ expectedTokenError_627(sourceText_618, i_619, out_620, "JSON value");
741
+ return_621 = -1;
742
+ break fn_625;
743
+ }
744
+ t_623 = stringGet_628(sourceText_618, i_619);
745
+ if (t_623 === 123) {
746
+ return_621 = parseJsonObject_629(sourceText_618, i_619, out_620);
747
+ } else if (t_623 === 91) {
748
+ return_621 = parseJsonArray_630(sourceText_618, i_619, out_620);
749
+ } else if (t_623 === 34) {
750
+ return_621 = parseJsonString_631(sourceText_618, i_619, out_620);
751
+ } else {
752
+ if (t_623 === 116) {
753
+ t_624 = true;
754
+ } else {
755
+ t_624 = t_623 === 102;
756
+ }
757
+ if (t_624) {
758
+ return_621 = parseJsonBoolean_632(sourceText_618, i_619, out_620);
759
+ } else if (t_623 === 110) {
760
+ return_621 = parseJsonNull_633(sourceText_618, i_619, out_620);
761
+ } else {
762
+ return_621 = parseJsonNumber_634(sourceText_618, i_619, out_620);
763
+ }
764
+ }
765
+ }
766
+ return return_621;
767
+ }
768
+ /** @template T_638 */
769
+ export class JsonAdapter extends type__383() {
770
+ /**
771
+ * @param {T_638} x_636
772
+ * @param {JsonProducer} p_637
773
+ */
774
+ encodeToJson(x_636, p_637) {
775
+ null;
776
+ return;
777
+ }
778
+ };
779
+ class BooleanJsonAdapter_642 extends type__383(JsonAdapter) {
780
+ /**
781
+ * @param {boolean} x_644
782
+ * @param {JsonProducer} p_645
783
+ */
784
+ encodeToJson(x_644, p_645) {
785
+ p_645.booleanValue(x_644);
786
+ return;
787
+ }
788
+ /**
789
+ * @param {JsonSyntaxTree} t_647
790
+ * @param {InterchangeContext} ic_648
791
+ * @returns {boolean}
792
+ */
793
+ decodeFromJson(t_647, ic_648) {
794
+ let t_649;
795
+ t_649 = requireInstanceOf__570(t_647, JsonBoolean);
796
+ return t_649.content;
797
+ }
798
+ constructor() {
799
+ super ();
800
+ return;
801
+ }
802
+ }
803
+ class Float64JsonAdapter_650 extends type__383(JsonAdapter) {
804
+ /**
805
+ * @param {number} x_652
806
+ * @param {JsonProducer} p_653
807
+ */
808
+ encodeToJson(x_652, p_653) {
809
+ p_653.float64Value(x_652);
810
+ return;
811
+ }
812
+ /**
813
+ * @param {JsonSyntaxTree} t_655
814
+ * @param {InterchangeContext} ic_656
815
+ * @returns {number}
816
+ */
817
+ decodeFromJson(t_655, ic_656) {
818
+ let t_657;
819
+ t_657 = requireInstanceOf__570(t_655, JsonFloat64);
820
+ return t_657.content;
821
+ }
822
+ constructor() {
823
+ super ();
824
+ return;
825
+ }
826
+ }
827
+ class IntJsonAdapter_658 extends type__383(JsonAdapter) {
828
+ /**
829
+ * @param {number} x_660
830
+ * @param {JsonProducer} p_661
831
+ */
832
+ encodeToJson(x_660, p_661) {
833
+ p_661.intValue(x_660);
834
+ return;
835
+ }
836
+ /**
837
+ * @param {JsonSyntaxTree} t_663
838
+ * @param {InterchangeContext} ic_664
839
+ * @returns {number}
840
+ */
841
+ decodeFromJson(t_663, ic_664) {
842
+ let t_665;
843
+ t_665 = requireInstanceOf__570(t_663, JsonInt);
844
+ return t_665.content;
845
+ }
846
+ constructor() {
847
+ super ();
848
+ return;
849
+ }
850
+ }
851
+ class StringJsonAdapter_666 extends type__383(JsonAdapter) {
852
+ /**
853
+ * @param {string} x_668
854
+ * @param {JsonProducer} p_669
855
+ */
856
+ encodeToJson(x_668, p_669) {
857
+ p_669.stringValue(x_668);
858
+ return;
859
+ }
860
+ /**
861
+ * @param {JsonSyntaxTree} t_671
862
+ * @param {InterchangeContext} ic_672
863
+ * @returns {string}
864
+ */
865
+ decodeFromJson(t_671, ic_672) {
866
+ let t_673;
867
+ t_673 = requireInstanceOf__570(t_671, JsonString);
868
+ return t_673.content;
869
+ }
870
+ constructor() {
871
+ super ();
872
+ return;
873
+ }
874
+ }
875
+ /** @template T_676 */
876
+ class ListJsonAdapter_674 extends type__383(JsonAdapter) {
877
+ /** @type {JsonAdapter<T_676>} */
878
+ #adapterForT_675;
879
+ /**
880
+ * @param {Array<T_676>} x_678
881
+ * @param {JsonProducer} p_679
882
+ */
883
+ encodeToJson(x_678, p_679) {
884
+ const this682 = this;
885
+ p_679.startArray();
886
+ function fn_680(el_681) {
887
+ this682.#adapterForT_675.encodeToJson(el_681, p_679);
888
+ return;
889
+ }
890
+ x_678.forEach(fn_680);
891
+ p_679.endArray();
892
+ return;
893
+ }
894
+ /**
895
+ * @param {JsonSyntaxTree} t_684
896
+ * @param {InterchangeContext} ic_685
897
+ * @returns {Array<T_676>}
898
+ */
899
+ decodeFromJson(t_684, ic_685) {
900
+ let t_686;
901
+ let t_687;
902
+ const b_688 = [];
903
+ let t_689;
904
+ t_689 = requireInstanceOf__570(t_684, JsonArray);
905
+ const elements_690 = t_689.elements;
906
+ const n_691 = elements_690.length;
907
+ let i_692 = 0;
908
+ while (i_692 < n_691) {
909
+ t_686 = listedGet_413(elements_690, i_692);
910
+ const el_693 = t_686;
911
+ i_692 = i_692 + 1;
912
+ t_687 = this.#adapterForT_675.decodeFromJson(el_693, ic_685);
913
+ listBuilderAdd_490(b_688, t_687);
914
+ }
915
+ return listBuilderToList_582(b_688);
916
+ }
917
+ /** @param {JsonAdapter<T_676>} adapterForT_694 */
918
+ constructor(adapterForT_694) {
919
+ super ();
920
+ this.#adapterForT_675 = adapterForT_694;
921
+ return;
922
+ }
923
+ }
924
+ /** @template T_696 */
925
+ export class OrNullJsonAdapter extends type__383(JsonAdapter) {
926
+ /** @type {JsonAdapter<T_696>} */
927
+ #adapterForT_695;
928
+ /**
929
+ * @param {T_696 | null} x_698
930
+ * @param {JsonProducer} p_699
931
+ */
932
+ encodeToJson(x_698, p_699) {
933
+ if (x_698 == null) {
934
+ p_699.nullValue();
935
+ } else {
936
+ const x_700 = x_698;
937
+ this.#adapterForT_695.encodeToJson(x_700, p_699);
938
+ }
939
+ return;
940
+ }
941
+ /**
942
+ * @param {JsonSyntaxTree} t_702
943
+ * @param {InterchangeContext} ic_703
944
+ * @returns {T_696 | null}
945
+ */
946
+ decodeFromJson(t_702, ic_703) {
947
+ let return_704;
948
+ if (t_702 instanceof JsonNull) {
949
+ return_704 = null;
950
+ } else {
951
+ return_704 = this.#adapterForT_695.decodeFromJson(t_702, ic_703);
952
+ }
953
+ return return_704;
954
+ }
955
+ /** @param {JsonAdapter<T_696>} adapterForT_705 */
956
+ constructor(adapterForT_705) {
957
+ super ();
958
+ this.#adapterForT_695 = adapterForT_705;
959
+ return;
960
+ }
961
+ };
962
+ /** @type {Array<string>} */
963
+ const hexDigits_706 = Object.freeze(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]);
964
+ /**
965
+ * @param {number} cp_708
966
+ * @param {globalThis.Array<string>} buffer_709
967
+ */
968
+ function encodeHex4_707(cp_708, buffer_709) {
969
+ const b0_710 = trunc__711(cp_708 / 4096) & 15;
970
+ const b1_712 = trunc__711(cp_708 / 256) & 15;
971
+ const b2_713 = trunc__711(cp_708 / 16) & 15;
972
+ const b3_714 = cp_708 & 15;
973
+ let t_715;
974
+ t_715 = listedGet_413(hexDigits_706, b0_710);
975
+ buffer_709[0] += t_715;
976
+ let t_716;
977
+ t_716 = listedGet_413(hexDigits_706, b1_712);
978
+ buffer_709[0] += t_716;
979
+ let t_717;
980
+ t_717 = listedGet_413(hexDigits_706, b2_713);
981
+ buffer_709[0] += t_717;
982
+ let t_718;
983
+ t_718 = listedGet_413(hexDigits_706, b3_714);
984
+ buffer_709[0] += t_718;
985
+ return;
986
+ }
987
+ /**
988
+ * @param {string} x_719
989
+ * @param {globalThis.Array<string>} buffer_720
990
+ */
991
+ function encodeJsonString_512(x_719, buffer_720) {
992
+ let t_721;
993
+ let t_722;
994
+ let t_723;
995
+ let t_724;
996
+ let t_725;
997
+ buffer_720[0] += "\u0022";
998
+ let i_726 = 0;
999
+ let emitted_727 = i_726;
1000
+ while (true) {
1001
+ if (!(x_719.length > i_726)) {
1002
+ break;
1003
+ }
1004
+ t_721 = stringGet_628(x_719, i_726);
1005
+ const cp_728 = t_721;
1006
+ if (cp_728 === 8) {
1007
+ t_725 = "\\b";
1008
+ } else if (cp_728 === 9) {
1009
+ t_725 = "\\t";
1010
+ } else if (cp_728 === 10) {
1011
+ t_725 = "\\n";
1012
+ } else if (cp_728 === 12) {
1013
+ t_725 = "\\f";
1014
+ } else if (cp_728 === 13) {
1015
+ t_725 = "\\r";
1016
+ } else if (cp_728 === 34) {
1017
+ t_725 = "\\\u0022";
1018
+ } else if (cp_728 === 92) {
1019
+ t_725 = "\\\\";
1020
+ } else {
1021
+ if (cp_728 < 32) {
1022
+ t_723 = true;
1023
+ } else {
1024
+ if (55296 <= cp_728) {
1025
+ t_722 = cp_728 <= 57343;
1026
+ } else {
1027
+ t_722 = false;
1028
+ }
1029
+ t_723 = t_722;
1030
+ }
1031
+ if (t_723) {
1032
+ t_724 = "\\u";
1033
+ } else {
1034
+ t_724 = "";
1035
+ }
1036
+ t_725 = t_724;
1037
+ }
1038
+ const replacement_729 = t_725;
1039
+ const nextI_730 = stringNext_731(x_719, i_726);
1040
+ if (replacement_729 !== "") {
1041
+ buffer_720[0] += x_719.substring(emitted_727, i_726);
1042
+ buffer_720[0] += replacement_729;
1043
+ if (replacement_729 === "\\u") {
1044
+ encodeHex4_707(cp_728, buffer_720);
1045
+ }
1046
+ emitted_727 = nextI_730;
1047
+ }
1048
+ i_726 = nextI_730;
1049
+ }
1050
+ buffer_720[0] += x_719.substring(emitted_727, i_726);
1051
+ buffer_720[0] += "\u0022";
1052
+ return;
1053
+ }
1054
+ /**
1055
+ * @param {JsonProducer} out_733
1056
+ * @param {string} explanation_734
1057
+ */
1058
+ function storeJsonError_732(out_733, explanation_734) {
1059
+ if (out_733 instanceof JsonParseErrorReceiver) {
1060
+ let errorReceiver_735;
1061
+ errorReceiver_735 = requireInstanceOf__570(out_733, JsonParseErrorReceiver);
1062
+ errorReceiver_735.explainJsonError(explanation_734);
1063
+ }
1064
+ return;
1065
+ }
1066
+ /**
1067
+ * @param {string} sourceText_736
1068
+ * @param {globalThis.number} i_737
1069
+ * @param {JsonProducer} out_738
1070
+ * @param {string} shortExplanation_739
1071
+ */
1072
+ function expectedTokenError_627(sourceText_736, i_737, out_738, shortExplanation_739) {
1073
+ let t_740;
1074
+ let t_741;
1075
+ let gotten_742;
1076
+ if (sourceText_736.length > i_737) {
1077
+ t_740 = sourceText_736.length;
1078
+ t_741 = sourceText_736.substring(i_737, t_740);
1079
+ gotten_742 = "`" + t_741 + "`";
1080
+ } else {
1081
+ gotten_742 = "end-of-file";
1082
+ }
1083
+ storeJsonError_732(out_738, "Expected " + shortExplanation_739 + ", but got " + gotten_742);
1084
+ return;
1085
+ }
1086
+ /**
1087
+ * @param {string} sourceText_743
1088
+ * @param {globalThis.number} i_744
1089
+ * @returns {globalThis.number}
1090
+ */
1091
+ function skipJsonSpaces_626(sourceText_743, i_744) {
1092
+ let t_745;
1093
+ let t_746;
1094
+ let t_747;
1095
+ let t_748;
1096
+ let t_749;
1097
+ while (true) {
1098
+ if (!(sourceText_743.length > i_744)) {
1099
+ break;
1100
+ }
1101
+ t_746 = stringGet_628(sourceText_743, i_744);
1102
+ if (t_746 === 9) {
1103
+ t_749 = true;
1104
+ } else {
1105
+ if (t_746 === 10) {
1106
+ t_748 = true;
1107
+ } else {
1108
+ if (t_746 === 13) {
1109
+ t_747 = true;
1110
+ } else {
1111
+ t_747 = t_746 === 32;
1112
+ }
1113
+ t_748 = t_747;
1114
+ }
1115
+ t_749 = t_748;
1116
+ }
1117
+ if (! t_749) {
1118
+ break;
1119
+ }
1120
+ t_745 = stringNext_731(sourceText_743, i_744);
1121
+ i_744 = t_745;
1122
+ }
1123
+ return i_744;
1124
+ }
1125
+ /**
1126
+ * @param {string} sourceText_751
1127
+ * @param {globalThis.number} start_752
1128
+ * @param {globalThis.number} limit_753
1129
+ * @returns {number}
1130
+ */
1131
+ function decodeHexUnsigned_750(sourceText_751, start_752, limit_753) {
1132
+ let return_754;
1133
+ let t_755;
1134
+ let t_756;
1135
+ let t_757;
1136
+ let t_758;
1137
+ let t_759;
1138
+ let t_760;
1139
+ fn_761: {
1140
+ let n_762 = 0;
1141
+ let i_763 = start_752;
1142
+ while (true) {
1143
+ if (!(i_763 - limit_753 < 0)) {
1144
+ break;
1145
+ }
1146
+ t_756 = stringGet_628(sourceText_751, i_763);
1147
+ const cp_764 = t_756;
1148
+ if (48 <= cp_764) {
1149
+ t_757 = cp_764 <= 48;
1150
+ } else {
1151
+ t_757 = false;
1152
+ }
1153
+ if (t_757) {
1154
+ t_760 = cp_764 - 48;
1155
+ } else {
1156
+ if (65 <= cp_764) {
1157
+ t_758 = cp_764 <= 70;
1158
+ } else {
1159
+ t_758 = false;
1160
+ }
1161
+ if (t_758) {
1162
+ t_760 = cp_764 - 65 + 10;
1163
+ } else {
1164
+ if (97 <= cp_764) {
1165
+ t_759 = cp_764 <= 102;
1166
+ } else {
1167
+ t_759 = false;
1168
+ }
1169
+ if (t_759) {
1170
+ t_760 = cp_764 - 97 + 10;
1171
+ } else {
1172
+ return_754 = -1;
1173
+ break fn_761;
1174
+ }
1175
+ }
1176
+ }
1177
+ const digit_765 = t_760;
1178
+ n_762 = n_762 * 16 + digit_765;
1179
+ t_755 = stringNext_731(sourceText_751, i_763);
1180
+ i_763 = t_755;
1181
+ }
1182
+ return_754 = n_762;
1183
+ }
1184
+ return return_754;
1185
+ }
1186
+ /**
1187
+ * @param {string} sourceText_766
1188
+ * @param {globalThis.number} i_767
1189
+ * @param {JsonProducer} out_768
1190
+ * @returns {globalThis.number}
1191
+ */
1192
+ function parseJsonString_631(sourceText_766, i_767, out_768) {
1193
+ let return_769;
1194
+ let t_770;
1195
+ let t_771;
1196
+ let t_772;
1197
+ let t_773;
1198
+ let t_774;
1199
+ let t_775;
1200
+ let t_776;
1201
+ let t_777;
1202
+ let t_778;
1203
+ let t_779;
1204
+ let t_780;
1205
+ let t_781;
1206
+ let t_782;
1207
+ let t_783;
1208
+ let t_784;
1209
+ let t_785;
1210
+ let t_786;
1211
+ let t_787;
1212
+ let t_788;
1213
+ let t_789;
1214
+ let t_790;
1215
+ let t_791;
1216
+ let t_792;
1217
+ let t_793;
1218
+ let t_794;
1219
+ let t_795;
1220
+ fn_796: {
1221
+ if (!(sourceText_766.length > i_767)) {
1222
+ t_781 = true;
1223
+ } else {
1224
+ t_780 = stringGet_628(sourceText_766, i_767);
1225
+ t_781 = t_780 !== 34;
1226
+ }
1227
+ if (t_781) {
1228
+ expectedTokenError_627(sourceText_766, i_767, out_768, "\u0022");
1229
+ return_769 = -1;
1230
+ break fn_796;
1231
+ }
1232
+ t_770 = stringNext_731(sourceText_766, i_767);
1233
+ i_767 = t_770;
1234
+ const sb_797 = [""];
1235
+ let leadSurrogate_798 = -1;
1236
+ let consumed_799 = i_767;
1237
+ while (true) {
1238
+ if (!(sourceText_766.length > i_767)) {
1239
+ break;
1240
+ }
1241
+ t_782 = stringGet_628(sourceText_766, i_767);
1242
+ const cp_800 = t_782;
1243
+ if (cp_800 === 34) {
1244
+ break;
1245
+ }
1246
+ t_771 = stringNext_731(sourceText_766, i_767);
1247
+ let iNext_801 = t_771;
1248
+ const end_802 = sourceText_766.length;
1249
+ let needToFlush_803 = false;
1250
+ if (cp_800 !== 92) {
1251
+ t_789 = cp_800;
1252
+ } else {
1253
+ needToFlush_803 = true;
1254
+ if (!(sourceText_766.length > iNext_801)) {
1255
+ expectedTokenError_627(sourceText_766, iNext_801, out_768, "escape sequence");
1256
+ return_769 = -1;
1257
+ break fn_796;
1258
+ }
1259
+ t_783 = stringGet_628(sourceText_766, iNext_801);
1260
+ const esc0_804 = t_783;
1261
+ t_772 = stringNext_731(sourceText_766, iNext_801);
1262
+ iNext_801 = t_772;
1263
+ if (esc0_804 === 34) {
1264
+ t_785 = true;
1265
+ } else {
1266
+ if (esc0_804 === 92) {
1267
+ t_784 = true;
1268
+ } else {
1269
+ t_784 = esc0_804 === 47;
1270
+ }
1271
+ t_785 = t_784;
1272
+ }
1273
+ if (t_785) {
1274
+ t_788 = esc0_804;
1275
+ } else if (esc0_804 === 98) {
1276
+ t_788 = 8;
1277
+ } else if (esc0_804 === 102) {
1278
+ t_788 = 12;
1279
+ } else if (esc0_804 === 110) {
1280
+ t_788 = 10;
1281
+ } else if (esc0_804 === 114) {
1282
+ t_788 = 13;
1283
+ } else if (esc0_804 === 116) {
1284
+ t_788 = 9;
1285
+ } else if (esc0_804 === 117) {
1286
+ if (stringHasAtLeast_805(sourceText_766, iNext_801, end_802, 4)) {
1287
+ const startHex_806 = iNext_801;
1288
+ t_773 = stringNext_731(sourceText_766, iNext_801);
1289
+ iNext_801 = t_773;
1290
+ t_774 = stringNext_731(sourceText_766, iNext_801);
1291
+ iNext_801 = t_774;
1292
+ t_775 = stringNext_731(sourceText_766, iNext_801);
1293
+ iNext_801 = t_775;
1294
+ t_776 = stringNext_731(sourceText_766, iNext_801);
1295
+ iNext_801 = t_776;
1296
+ t_777 = decodeHexUnsigned_750(sourceText_766, startHex_806, iNext_801);
1297
+ t_786 = t_777;
1298
+ } else {
1299
+ t_786 = -1;
1300
+ }
1301
+ const hex_807 = t_786;
1302
+ if (hex_807 < 0) {
1303
+ expectedTokenError_627(sourceText_766, iNext_801, out_768, "four hex digits");
1304
+ return_769 = -1;
1305
+ break fn_796;
1306
+ }
1307
+ t_787 = hex_807;
1308
+ t_788 = t_787;
1309
+ } else {
1310
+ expectedTokenError_627(sourceText_766, iNext_801, out_768, "escape sequence");
1311
+ return_769 = -1;
1312
+ break fn_796;
1313
+ }
1314
+ t_789 = t_788;
1315
+ }
1316
+ let decodedCp_808 = t_789;
1317
+ if (leadSurrogate_798 >= 0) {
1318
+ needToFlush_803 = true;
1319
+ const lead_809 = leadSurrogate_798;
1320
+ if (56320 <= decodedCp_808) {
1321
+ t_790 = decodedCp_808 <= 57343;
1322
+ } else {
1323
+ t_790 = false;
1324
+ }
1325
+ if (t_790) {
1326
+ leadSurrogate_798 = -1;
1327
+ t_791 = (lead_809 - 55296) * 1024 | decodedCp_808 - 56320;
1328
+ decodedCp_808 = 65536 + t_791;
1329
+ }
1330
+ } else {
1331
+ if (55296 <= decodedCp_808) {
1332
+ t_792 = decodedCp_808 <= 56319;
1333
+ } else {
1334
+ t_792 = false;
1335
+ }
1336
+ if (t_792) {
1337
+ needToFlush_803 = true;
1338
+ }
1339
+ }
1340
+ if (needToFlush_803) {
1341
+ sb_797[0] += sourceText_766.substring(consumed_799, i_767);
1342
+ if (leadSurrogate_798 >= 0) {
1343
+ stringBuilderAppendCodePoint_810(sb_797, leadSurrogate_798);
1344
+ }
1345
+ if (55296 <= decodedCp_808) {
1346
+ t_793 = decodedCp_808 <= 56319;
1347
+ } else {
1348
+ t_793 = false;
1349
+ }
1350
+ if (t_793) {
1351
+ leadSurrogate_798 = decodedCp_808;
1352
+ } else {
1353
+ leadSurrogate_798 = -1;
1354
+ stringBuilderAppendCodePoint_810(sb_797, decodedCp_808);
1355
+ }
1356
+ consumed_799 = iNext_801;
1357
+ }
1358
+ i_767 = iNext_801;
1359
+ }
1360
+ if (!(sourceText_766.length > i_767)) {
1361
+ t_795 = true;
1362
+ } else {
1363
+ t_794 = stringGet_628(sourceText_766, i_767);
1364
+ t_795 = t_794 !== 34;
1365
+ }
1366
+ if (t_795) {
1367
+ expectedTokenError_627(sourceText_766, i_767, out_768, "\u0022");
1368
+ return_769 = -1;
1369
+ } else {
1370
+ if (leadSurrogate_798 >= 0) {
1371
+ stringBuilderAppendCodePoint_810(sb_797, leadSurrogate_798);
1372
+ } else {
1373
+ sb_797[0] += sourceText_766.substring(consumed_799, i_767);
1374
+ }
1375
+ t_778 = stringNext_731(sourceText_766, i_767);
1376
+ i_767 = t_778;
1377
+ t_779 = sb_797[0];
1378
+ out_768.stringValue(t_779);
1379
+ return_769 = i_767;
1380
+ }
1381
+ }
1382
+ return return_769;
1383
+ }
1384
+ /**
1385
+ * @param {string} sourceText_811
1386
+ * @param {globalThis.number} i_812
1387
+ * @param {JsonProducer} out_813
1388
+ * @returns {globalThis.number}
1389
+ */
1390
+ function parseJsonObject_629(sourceText_811, i_812, out_813) {
1391
+ let return_814;
1392
+ let t_815;
1393
+ let t_816;
1394
+ let t_817;
1395
+ let t_818;
1396
+ let t_819;
1397
+ let t_820;
1398
+ let t_821;
1399
+ let t_822;
1400
+ let t_823;
1401
+ let t_824;
1402
+ let t_825;
1403
+ let t_826;
1404
+ let t_827;
1405
+ let t_828;
1406
+ let t_829;
1407
+ let t_830;
1408
+ let t_831;
1409
+ let t_832;
1410
+ let t_833;
1411
+ fn_834: {
1412
+ if (!(sourceText_811.length > i_812)) {
1413
+ t_823 = true;
1414
+ } else {
1415
+ t_822 = stringGet_628(sourceText_811, i_812);
1416
+ t_823 = t_822 !== 123;
1417
+ }
1418
+ if (t_823) {
1419
+ expectedTokenError_627(sourceText_811, i_812, out_813, "'{'");
1420
+ return_814 = -1;
1421
+ break fn_834;
1422
+ }
1423
+ out_813.startObject();
1424
+ t_815 = stringNext_731(sourceText_811, i_812);
1425
+ t_816 = skipJsonSpaces_626(sourceText_811, t_815);
1426
+ i_812 = t_816;
1427
+ if (sourceText_811.length > i_812) {
1428
+ t_824 = stringGet_628(sourceText_811, i_812);
1429
+ t_825 = t_824 !== 125;
1430
+ } else {
1431
+ t_825 = false;
1432
+ }
1433
+ if (t_825) {
1434
+ while (true) {
1435
+ const afterKey_835 = parseJsonString_631(sourceText_811, i_812, out_813);
1436
+ if (!(afterKey_835 >= 0)) {
1437
+ return_814 = -1;
1438
+ break fn_834;
1439
+ }
1440
+ t_826 = requireStringIndex__836(afterKey_835);
1441
+ t_817 = skipJsonSpaces_626(sourceText_811, t_826);
1442
+ i_812 = t_817;
1443
+ if (sourceText_811.length > i_812) {
1444
+ t_827 = stringGet_628(sourceText_811, i_812);
1445
+ t_828 = t_827 === 58;
1446
+ } else {
1447
+ t_828 = false;
1448
+ }
1449
+ if (t_828) {
1450
+ t_818 = stringNext_731(sourceText_811, i_812);
1451
+ i_812 = t_818;
1452
+ const afterPropertyValue_837 = parseJsonValue_617(sourceText_811, i_812, out_813);
1453
+ if (!(afterPropertyValue_837 >= 0)) {
1454
+ return_814 = -1;
1455
+ break fn_834;
1456
+ }
1457
+ t_829 = requireStringIndex__836(afterPropertyValue_837);
1458
+ i_812 = t_829;
1459
+ } else {
1460
+ expectedTokenError_627(sourceText_811, i_812, out_813, "':'");
1461
+ return_814 = -1;
1462
+ break fn_834;
1463
+ }
1464
+ t_819 = skipJsonSpaces_626(sourceText_811, i_812);
1465
+ i_812 = t_819;
1466
+ if (sourceText_811.length > i_812) {
1467
+ t_830 = stringGet_628(sourceText_811, i_812);
1468
+ t_831 = t_830 === 44;
1469
+ } else {
1470
+ t_831 = false;
1471
+ }
1472
+ if (t_831) {
1473
+ t_820 = stringNext_731(sourceText_811, i_812);
1474
+ t_821 = skipJsonSpaces_626(sourceText_811, t_820);
1475
+ i_812 = t_821;
1476
+ } else {
1477
+ break;
1478
+ }
1479
+ }
1480
+ }
1481
+ if (sourceText_811.length > i_812) {
1482
+ t_832 = stringGet_628(sourceText_811, i_812);
1483
+ t_833 = t_832 === 125;
1484
+ } else {
1485
+ t_833 = false;
1486
+ }
1487
+ if (t_833) {
1488
+ out_813.endObject();
1489
+ return_814 = stringNext_731(sourceText_811, i_812);
1490
+ } else {
1491
+ expectedTokenError_627(sourceText_811, i_812, out_813, "'}'");
1492
+ return_814 = -1;
1493
+ }
1494
+ }
1495
+ return return_814;
1496
+ }
1497
+ /**
1498
+ * @param {string} sourceText_838
1499
+ * @param {globalThis.number} i_839
1500
+ * @param {JsonProducer} out_840
1501
+ * @returns {globalThis.number}
1502
+ */
1503
+ function parseJsonArray_630(sourceText_838, i_839, out_840) {
1504
+ let return_841;
1505
+ let t_842;
1506
+ let t_843;
1507
+ let t_844;
1508
+ let t_845;
1509
+ let t_846;
1510
+ let t_847;
1511
+ let t_848;
1512
+ let t_849;
1513
+ let t_850;
1514
+ let t_851;
1515
+ let t_852;
1516
+ let t_853;
1517
+ let t_854;
1518
+ let t_855;
1519
+ fn_856: {
1520
+ if (!(sourceText_838.length > i_839)) {
1521
+ t_848 = true;
1522
+ } else {
1523
+ t_847 = stringGet_628(sourceText_838, i_839);
1524
+ t_848 = t_847 !== 91;
1525
+ }
1526
+ if (t_848) {
1527
+ expectedTokenError_627(sourceText_838, i_839, out_840, "'['");
1528
+ return_841 = -1;
1529
+ break fn_856;
1530
+ }
1531
+ out_840.startArray();
1532
+ t_842 = stringNext_731(sourceText_838, i_839);
1533
+ t_843 = skipJsonSpaces_626(sourceText_838, t_842);
1534
+ i_839 = t_843;
1535
+ if (sourceText_838.length > i_839) {
1536
+ t_849 = stringGet_628(sourceText_838, i_839);
1537
+ t_850 = t_849 !== 93;
1538
+ } else {
1539
+ t_850 = false;
1540
+ }
1541
+ if (t_850) {
1542
+ while (true) {
1543
+ const afterElementValue_857 = parseJsonValue_617(sourceText_838, i_839, out_840);
1544
+ if (!(afterElementValue_857 >= 0)) {
1545
+ return_841 = -1;
1546
+ break fn_856;
1547
+ }
1548
+ t_851 = requireStringIndex__836(afterElementValue_857);
1549
+ i_839 = t_851;
1550
+ t_844 = skipJsonSpaces_626(sourceText_838, i_839);
1551
+ i_839 = t_844;
1552
+ if (sourceText_838.length > i_839) {
1553
+ t_852 = stringGet_628(sourceText_838, i_839);
1554
+ t_853 = t_852 === 44;
1555
+ } else {
1556
+ t_853 = false;
1557
+ }
1558
+ if (t_853) {
1559
+ t_845 = stringNext_731(sourceText_838, i_839);
1560
+ t_846 = skipJsonSpaces_626(sourceText_838, t_845);
1561
+ i_839 = t_846;
1562
+ } else {
1563
+ break;
1564
+ }
1565
+ }
1566
+ }
1567
+ if (sourceText_838.length > i_839) {
1568
+ t_854 = stringGet_628(sourceText_838, i_839);
1569
+ t_855 = t_854 === 93;
1570
+ } else {
1571
+ t_855 = false;
1572
+ }
1573
+ if (t_855) {
1574
+ out_840.endArray();
1575
+ return_841 = stringNext_731(sourceText_838, i_839);
1576
+ } else {
1577
+ expectedTokenError_627(sourceText_838, i_839, out_840, "']'");
1578
+ return_841 = -1;
1579
+ }
1580
+ }
1581
+ return return_841;
1582
+ }
1583
+ /**
1584
+ * @param {string} string_859
1585
+ * @param {globalThis.number} inString_860
1586
+ * @param {string} substring_861
1587
+ * @returns {globalThis.number}
1588
+ */
1589
+ function afterSubstring_858(string_859, inString_860, substring_861) {
1590
+ let return_862;
1591
+ let t_863;
1592
+ let t_864;
1593
+ let t_865;
1594
+ let t_866;
1595
+ fn_867: {
1596
+ let i_868 = inString_860;
1597
+ let j_869 = 0;
1598
+ while (true) {
1599
+ if (!(substring_861.length > j_869)) {
1600
+ break;
1601
+ }
1602
+ if (!(string_859.length > i_868)) {
1603
+ return_862 = -1;
1604
+ break fn_867;
1605
+ }
1606
+ t_865 = stringGet_628(string_859, i_868);
1607
+ t_866 = stringGet_628(substring_861, j_869);
1608
+ if (t_865 !== t_866) {
1609
+ return_862 = -1;
1610
+ break fn_867;
1611
+ }
1612
+ t_863 = stringNext_731(string_859, i_868);
1613
+ i_868 = t_863;
1614
+ t_864 = stringNext_731(substring_861, j_869);
1615
+ j_869 = t_864;
1616
+ }
1617
+ return_862 = i_868;
1618
+ }
1619
+ return return_862;
1620
+ }
1621
+ /**
1622
+ * @param {string} sourceText_870
1623
+ * @param {globalThis.number} i_871
1624
+ * @param {JsonProducer} out_872
1625
+ * @returns {globalThis.number}
1626
+ */
1627
+ function parseJsonBoolean_632(sourceText_870, i_871, out_872) {
1628
+ let return_873;
1629
+ let t_874;
1630
+ let t_875;
1631
+ let t_876;
1632
+ let t_877;
1633
+ fn_878: {
1634
+ let ch0_879;
1635
+ if (sourceText_870.length > i_871) {
1636
+ t_875 = stringGet_628(sourceText_870, i_871);
1637
+ ch0_879 = t_875;
1638
+ } else {
1639
+ ch0_879 = 0;
1640
+ }
1641
+ const end_880 = sourceText_870.length;
1642
+ let keyword_881;
1643
+ let n_882;
1644
+ if (ch0_879 === 102) {
1645
+ keyword_881 = "false";
1646
+ n_882 = 5;
1647
+ } else if (ch0_879 === 116) {
1648
+ keyword_881 = "true";
1649
+ n_882 = 4;
1650
+ } else {
1651
+ keyword_881 = null;
1652
+ n_882 = 0;
1653
+ }
1654
+ if (!(keyword_881 == null)) {
1655
+ t_874 = stringHasAtLeast_805(sourceText_870, i_871, end_880, n_882);
1656
+ t_876 = t_874;
1657
+ } else {
1658
+ t_876 = false;
1659
+ }
1660
+ if (t_876) {
1661
+ if (keyword_881 == null) {
1662
+ throw Error();
1663
+ } else {
1664
+ t_877 = keyword_881;
1665
+ }
1666
+ const after_883 = afterSubstring_858(sourceText_870, i_871, t_877);
1667
+ if (after_883 >= 0) {
1668
+ out_872.booleanValue(n_882 === 4);
1669
+ return_873 = after_883;
1670
+ break fn_878;
1671
+ }
1672
+ }
1673
+ expectedTokenError_627(sourceText_870, i_871, out_872, "`false` or `true`");
1674
+ return_873 = -1;
1675
+ }
1676
+ return return_873;
1677
+ }
1678
+ /**
1679
+ * @param {string} sourceText_884
1680
+ * @param {globalThis.number} i_885
1681
+ * @param {JsonProducer} out_886
1682
+ * @returns {globalThis.number}
1683
+ */
1684
+ function parseJsonNull_633(sourceText_884, i_885, out_886) {
1685
+ let return_887;
1686
+ fn_888: {
1687
+ const after_889 = afterSubstring_858(sourceText_884, i_885, "null");
1688
+ if (after_889 >= 0) {
1689
+ out_886.nullValue();
1690
+ return_887 = requireStringIndex__836(after_889);
1691
+ break fn_888;
1692
+ }
1693
+ expectedTokenError_627(sourceText_884, i_885, out_886, "`null`");
1694
+ return_887 = -1;
1695
+ }
1696
+ return return_887;
1697
+ }
1698
+ /**
1699
+ * @param {string} sourceText_890
1700
+ * @param {globalThis.number} i_891
1701
+ * @param {JsonProducer} out_892
1702
+ * @returns {globalThis.number}
1703
+ */
1704
+ function parseJsonNumber_634(sourceText_890, i_891, out_892) {
1705
+ let return_893;
1706
+ let t_894;
1707
+ let t_895;
1708
+ let t_896;
1709
+ let t_897;
1710
+ let t_898;
1711
+ let t_899;
1712
+ let t_900;
1713
+ let t_901;
1714
+ let t_902;
1715
+ let t_903;
1716
+ let t_904;
1717
+ let t_905;
1718
+ let t_906;
1719
+ let t_907;
1720
+ let t_908;
1721
+ let t_909;
1722
+ let t_910;
1723
+ let t_911;
1724
+ let t_912;
1725
+ let t_913;
1726
+ let t_914;
1727
+ let t_915;
1728
+ let t_916;
1729
+ let t_917;
1730
+ let t_918;
1731
+ let t_919;
1732
+ let t_920;
1733
+ let t_921;
1734
+ let t_922;
1735
+ let t_923;
1736
+ let t_924;
1737
+ let t_925;
1738
+ let t_926;
1739
+ let t_927;
1740
+ let t_928;
1741
+ let t_929;
1742
+ let t_930;
1743
+ let t_931;
1744
+ fn_932: {
1745
+ let isNegative_933 = false;
1746
+ const startOfNumber_934 = i_891;
1747
+ if (sourceText_890.length > i_891) {
1748
+ t_902 = stringGet_628(sourceText_890, i_891);
1749
+ t_903 = t_902 === 45;
1750
+ } else {
1751
+ t_903 = false;
1752
+ }
1753
+ if (t_903) {
1754
+ isNegative_933 = true;
1755
+ t_894 = stringNext_731(sourceText_890, i_891);
1756
+ i_891 = t_894;
1757
+ }
1758
+ let digit0_935;
1759
+ if (sourceText_890.length > i_891) {
1760
+ t_904 = stringGet_628(sourceText_890, i_891);
1761
+ digit0_935 = t_904;
1762
+ } else {
1763
+ digit0_935 = -1;
1764
+ }
1765
+ if (digit0_935 < 48) {
1766
+ t_905 = true;
1767
+ } else {
1768
+ t_905 = 57 < digit0_935;
1769
+ }
1770
+ if (t_905) {
1771
+ let error_936;
1772
+ if (! isNegative_933) {
1773
+ t_906 = digit0_935 !== 46;
1774
+ } else {
1775
+ t_906 = false;
1776
+ }
1777
+ if (t_906) {
1778
+ error_936 = "JSON value";
1779
+ } else {
1780
+ error_936 = "digit";
1781
+ }
1782
+ expectedTokenError_627(sourceText_890, i_891, out_892, error_936);
1783
+ return_893 = -1;
1784
+ break fn_932;
1785
+ }
1786
+ t_895 = stringNext_731(sourceText_890, i_891);
1787
+ i_891 = t_895;
1788
+ let nDigits_937 = 1;
1789
+ t_907 = digit0_935 - 48;
1790
+ let tentativeValue_938 = t_907;
1791
+ if (48 !== digit0_935) {
1792
+ while (true) {
1793
+ if (!(sourceText_890.length > i_891)) {
1794
+ break;
1795
+ }
1796
+ t_908 = stringGet_628(sourceText_890, i_891);
1797
+ const possibleDigit_939 = t_908;
1798
+ if (48 <= possibleDigit_939) {
1799
+ t_909 = possibleDigit_939 <= 57;
1800
+ } else {
1801
+ t_909 = false;
1802
+ }
1803
+ if (t_909) {
1804
+ t_896 = stringNext_731(sourceText_890, i_891);
1805
+ i_891 = t_896;
1806
+ nDigits_937 = nDigits_937 + 1;
1807
+ t_911 = tentativeValue_938 * 10.0;
1808
+ t_910 = possibleDigit_939 - 48;
1809
+ tentativeValue_938 = t_911 + t_910;
1810
+ } else {
1811
+ break;
1812
+ }
1813
+ }
1814
+ }
1815
+ let nDigitsAfterPoint_940 = 0;
1816
+ if (sourceText_890.length > i_891) {
1817
+ t_912 = stringGet_628(sourceText_890, i_891);
1818
+ t_913 = 46 === t_912;
1819
+ } else {
1820
+ t_913 = false;
1821
+ }
1822
+ if (t_913) {
1823
+ t_897 = stringNext_731(sourceText_890, i_891);
1824
+ i_891 = t_897;
1825
+ const afterPoint_941 = i_891;
1826
+ while (true) {
1827
+ if (!(sourceText_890.length > i_891)) {
1828
+ break;
1829
+ }
1830
+ t_914 = stringGet_628(sourceText_890, i_891);
1831
+ const possibleDigit_942 = t_914;
1832
+ if (48 <= possibleDigit_942) {
1833
+ t_915 = possibleDigit_942 <= 57;
1834
+ } else {
1835
+ t_915 = false;
1836
+ }
1837
+ if (t_915) {
1838
+ t_898 = stringNext_731(sourceText_890, i_891);
1839
+ i_891 = t_898;
1840
+ nDigits_937 = nDigits_937 + 1;
1841
+ nDigitsAfterPoint_940 = nDigitsAfterPoint_940 + 1;
1842
+ t_917 = tentativeValue_938 * 10.0;
1843
+ t_916 = possibleDigit_942 - 48;
1844
+ tentativeValue_938 = t_917 + t_916;
1845
+ } else {
1846
+ break;
1847
+ }
1848
+ }
1849
+ if (Object.is(i_891, afterPoint_941)) {
1850
+ expectedTokenError_627(sourceText_890, i_891, out_892, "digit");
1851
+ return_893 = -1;
1852
+ break fn_932;
1853
+ }
1854
+ }
1855
+ let nExponentDigits_943 = 0;
1856
+ if (sourceText_890.length > i_891) {
1857
+ t_918 = stringGet_628(sourceText_890, i_891);
1858
+ t_919 = t_918 | 32;
1859
+ t_920 = 101 === t_919;
1860
+ } else {
1861
+ t_920 = false;
1862
+ }
1863
+ if (t_920) {
1864
+ t_899 = stringNext_731(sourceText_890, i_891);
1865
+ i_891 = t_899;
1866
+ if (!(sourceText_890.length > i_891)) {
1867
+ expectedTokenError_627(sourceText_890, i_891, out_892, "sign or digit");
1868
+ return_893 = -1;
1869
+ break fn_932;
1870
+ }
1871
+ let afterE_944;
1872
+ afterE_944 = stringGet_628(sourceText_890, i_891);
1873
+ if (afterE_944 === 43) {
1874
+ t_921 = true;
1875
+ } else {
1876
+ t_921 = afterE_944 === 45;
1877
+ }
1878
+ if (t_921) {
1879
+ t_900 = stringNext_731(sourceText_890, i_891);
1880
+ i_891 = t_900;
1881
+ }
1882
+ while (true) {
1883
+ if (!(sourceText_890.length > i_891)) {
1884
+ break;
1885
+ }
1886
+ t_922 = stringGet_628(sourceText_890, i_891);
1887
+ const possibleDigit_945 = t_922;
1888
+ if (48 <= possibleDigit_945) {
1889
+ t_923 = possibleDigit_945 <= 57;
1890
+ } else {
1891
+ t_923 = false;
1892
+ }
1893
+ if (t_923) {
1894
+ t_901 = stringNext_731(sourceText_890, i_891);
1895
+ i_891 = t_901;
1896
+ nExponentDigits_943 = nExponentDigits_943 + 1;
1897
+ } else {
1898
+ break;
1899
+ }
1900
+ }
1901
+ if (nExponentDigits_943 === 0) {
1902
+ expectedTokenError_627(sourceText_890, i_891, out_892, "exponent digit");
1903
+ return_893 = -1;
1904
+ break fn_932;
1905
+ }
1906
+ }
1907
+ const afterExponent_946 = i_891;
1908
+ if (nExponentDigits_943 === 0) {
1909
+ t_924 = nDigitsAfterPoint_940 === 0;
1910
+ } else {
1911
+ t_924 = false;
1912
+ }
1913
+ if (t_924) {
1914
+ let value_947;
1915
+ if (isNegative_933) {
1916
+ value_947 = - tentativeValue_938;
1917
+ } else {
1918
+ value_947 = tentativeValue_938;
1919
+ }
1920
+ if (nDigits_937 <= 10) {
1921
+ if (cmpFloat__948(-2.147483648E9, value_947) <= 0) {
1922
+ t_925 = cmpFloat__948(value_947, 2.147483647E9) <= 0;
1923
+ } else {
1924
+ t_925 = false;
1925
+ }
1926
+ t_926 = t_925;
1927
+ } else {
1928
+ t_926 = false;
1929
+ }
1930
+ if (t_926) {
1931
+ t_927 = float64ToInt_465(value_947);
1932
+ out_892.intValue(t_927);
1933
+ return_893 = i_891;
1934
+ break fn_932;
1935
+ }
1936
+ }
1937
+ const numericTokenString_949 = sourceText_890.substring(startOfNumber_934, i_891);
1938
+ let doubleValue_950 = NaN;
1939
+ if (nExponentDigits_943 !== 0) {
1940
+ t_928 = true;
1941
+ } else {
1942
+ t_928 = nDigitsAfterPoint_940 !== 0;
1943
+ }
1944
+ if (t_928) {
1945
+ try {
1946
+ t_929 = stringToFloat64_478(numericTokenString_949);
1947
+ doubleValue_950 = t_929;
1948
+ } catch {
1949
+ }
1950
+ }
1951
+ if (cmpFloat__948(doubleValue_950, -Infinity) !== 0) {
1952
+ if (cmpFloat__948(doubleValue_950, Infinity) !== 0) {
1953
+ t_930 = cmpFloat__948(doubleValue_950, NaN) !== 0;
1954
+ } else {
1955
+ t_930 = false;
1956
+ }
1957
+ t_931 = t_930;
1958
+ } else {
1959
+ t_931 = false;
1960
+ }
1961
+ if (t_931) {
1962
+ out_892.float64Value(doubleValue_950);
1963
+ } else {
1964
+ out_892.numericTokenValue(numericTokenString_949);
1965
+ }
1966
+ return_893 = i_891;
1967
+ }
1968
+ return return_893;
1969
+ }
1970
+ /**
1971
+ * @param {string} sourceText_951
1972
+ * @param {JsonProducer} out_952
1973
+ */
1974
+ export function parseJsonToProducer(sourceText_951, out_952) {
1975
+ let t_953;
1976
+ let t_954;
1977
+ let t_955;
1978
+ let t_956;
1979
+ let t_957;
1980
+ let t_958;
1981
+ let i_959 = 0;
1982
+ const afterValue_960 = parseJsonValue_617(sourceText_951, i_959, out_952);
1983
+ if (afterValue_960 >= 0) {
1984
+ t_957 = requireStringIndex__836(afterValue_960);
1985
+ t_953 = skipJsonSpaces_626(sourceText_951, t_957);
1986
+ i_959 = t_953;
1987
+ if (sourceText_951.length > i_959) {
1988
+ t_954 = out_952 instanceof JsonParseErrorReceiver;
1989
+ t_958 = t_954;
1990
+ } else {
1991
+ t_958 = false;
1992
+ }
1993
+ if (t_958) {
1994
+ t_955 = sourceText_951.length;
1995
+ t_956 = sourceText_951.substring(i_959, t_955);
1996
+ storeJsonError_732(out_952, "Extraneous JSON `" + t_956 + "`");
1997
+ }
1998
+ }
1999
+ return;
2000
+ };
2001
+ /**
2002
+ * @param {string} sourceText_961
2003
+ * @returns {JsonSyntaxTree}
2004
+ */
2005
+ export function parseJson(sourceText_961) {
2006
+ const p_962 = new JsonSyntaxTreeProducer();
2007
+ parseJsonToProducer(sourceText_961, p_962);
2008
+ return p_962.toJsonSyntaxTree();
2009
+ };
2010
+ /** @returns {JsonAdapter<boolean>} */
2011
+ export function booleanJsonAdapter() {
2012
+ return new BooleanJsonAdapter_642();
2013
+ };
2014
+ /** @returns {JsonAdapter<number>} */
2015
+ export function float64JsonAdapter() {
2016
+ return new Float64JsonAdapter_650();
2017
+ };
2018
+ /** @returns {JsonAdapter<number>} */
2019
+ export function intJsonAdapter() {
2020
+ return new IntJsonAdapter_658();
2021
+ };
2022
+ /** @returns {JsonAdapter<string>} */
2023
+ export function stringJsonAdapter() {
2024
+ return new StringJsonAdapter_666();
2025
+ };
2026
+ /**
2027
+ * @template {unknown} T_964
2028
+ * @param {JsonAdapter<T_964>} adapterForT_963
2029
+ * @returns {JsonAdapter<Array<T_964>>}
2030
+ */
2031
+ export function listJsonAdapter(adapterForT_963) {
2032
+ return new ListJsonAdapter_674(adapterForT_963);
2033
+ };