@temperlang/std 0.4.0 → 0.5.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 CHANGED
@@ -1,198 +1,195 @@
1
1
  const {
2
- trunc: trunc__711
2
+ trunc: trunc__727
3
3
  } = globalThis.Math;
4
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
5
+ type as type__392, requireInstanceOf as requireInstanceOf__585, requireStringIndex as requireStringIndex__852, cmpFloat as cmpFloat__966, mappedGetOr as mappedGetOr_422, listedGet as listedGet_424, mappedForEach as mappedForEach_436, float64ToString as float64ToString_473, float64ToInt as float64ToInt_475, stringToInt as stringToInt_487, stringToFloat64 as stringToFloat64_488, listBuilderAdd as listBuilderAdd_500, listedGetOr as listedGetOr_504, listBuilderSet as listBuilderSet_512, listBuilderRemoveLast as listBuilderRemoveLast_517, mapBuilderConstructor as mapBuilderConstructor_579, panic as panic_586, mappedGet as mappedGet_591, mapBuilderSet as mapBuilderSet_592, listBuilderToList as listBuilderToList_598, mappedToMap as mappedToMap_599, stringGet as stringGet_645, stringNext as stringNext_746, stringHasAtLeast as stringHasAtLeast_817, stringBuilderAppendCodePoint as stringBuilderAppendCodePoint_822
6
6
  } from "@temperlang/core";
7
- export class InterchangeContext extends type__383() {
7
+ export class InterchangeContext extends type__392() {
8
+ /**
9
+ * @param {string} headerName_391
10
+ * @returns {string | null}
11
+ */
12
+ getHeader(headerName_391) {
13
+ null;
14
+ }
8
15
  };
9
- export class NullInterchangeContext extends type__383(InterchangeContext) {
16
+ export class NullInterchangeContext extends type__392(InterchangeContext) {
10
17
  /**
11
- * @param {string} headerName_385
18
+ * @param {string} headerName_394
12
19
  * @returns {string | null}
13
20
  */
14
- getHeader(headerName_385) {
21
+ getHeader(headerName_394) {
15
22
  return null;
16
23
  }
17
24
  /** @type {NullInterchangeContext} */
18
- static #instance_386 = new NullInterchangeContext();
25
+ static #instance_395 = new NullInterchangeContext();
19
26
  /** @returns {NullInterchangeContext} */
20
27
  static get instance() {
21
- return this.#instance_386;
28
+ return this.#instance_395;
22
29
  }
23
30
  constructor() {
24
31
  super ();
25
32
  return;
26
33
  }
27
34
  };
28
- export class JsonProducer extends type__383() {
35
+ export class JsonProducer extends type__392() {
29
36
  startObject() {
30
37
  null;
31
- return;
32
38
  }
33
39
  endObject() {
34
40
  null;
35
- return;
36
41
  }
37
- /** @param {string} key_390 */
38
- objectKey(key_390) {
42
+ /** @param {string} key_400 */
43
+ objectKey(key_400) {
39
44
  null;
40
- return;
41
45
  }
42
46
  startArray() {
43
47
  null;
44
- return;
45
48
  }
46
49
  endArray() {
47
50
  null;
48
- return;
49
51
  }
50
52
  nullValue() {
51
53
  null;
52
- return;
53
54
  }
54
- /** @param {boolean} x_395 */
55
- booleanValue(x_395) {
55
+ /** @param {boolean} x_405 */
56
+ booleanValue(x_405) {
56
57
  null;
57
- return;
58
58
  }
59
- /** @param {number} x_397 */
60
- intValue(x_397) {
59
+ /** @param {number} x_407 */
60
+ intValue(x_407) {
61
61
  null;
62
- return;
63
62
  }
64
- /** @param {number} x_399 */
65
- float64Value(x_399) {
63
+ /** @param {number} x_409 */
64
+ float64Value(x_409) {
66
65
  null;
67
- return;
68
66
  }
69
- /** @param {string} x_401 */
70
- numericTokenValue(x_401) {
67
+ /** @param {string} x_411 */
68
+ numericTokenValue(x_411) {
71
69
  null;
72
- return;
73
70
  }
74
- /** @param {string} x_403 */
75
- stringValue(x_403) {
71
+ /** @param {string} x_413 */
72
+ stringValue(x_413) {
76
73
  null;
77
- return;
74
+ }
75
+ /** @returns {JsonParseErrorReceiver | null} */
76
+ get parseErrorReceiver() {
77
+ return null;
78
78
  }
79
79
  };
80
- export class JsonSyntaxTree extends type__383() {
81
- /** @param {JsonProducer} p_405 */
82
- produce(p_405) {
80
+ export class JsonSyntaxTree extends type__392() {
81
+ /** @param {JsonProducer} p_416 */
82
+ produce(p_416) {
83
83
  null;
84
- return;
85
84
  }
86
85
  };
87
- export class JsonObject extends type__383(JsonSyntaxTree) {
86
+ export class JsonObject extends type__392(JsonSyntaxTree) {
88
87
  /** @type {Map<string, Array<JsonSyntaxTree>>} */
89
- #properties_406;
88
+ #properties_417;
90
89
  /**
91
- * @param {string} propertyKey_408
90
+ * @param {string} propertyKey_419
92
91
  * @returns {JsonSyntaxTree | null}
93
92
  */
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);
93
+ propertyValueOrNull(propertyKey_419) {
94
+ let return_420;
95
+ const treeList_421 = mappedGetOr_422(this.#properties_417, propertyKey_419, Object.freeze([]));
96
+ const lastIndex_423 = treeList_421.length - 1;
97
+ if (lastIndex_423 >= 0) {
98
+ return_420 = listedGet_424(treeList_421, lastIndex_423);
100
99
  } else {
101
- return_409 = null;
100
+ return_420 = null;
102
101
  }
103
- return return_409;
102
+ return return_420;
104
103
  }
105
104
  /**
106
- * @param {string} propertyKey_415
105
+ * @param {string} propertyKey_426
107
106
  * @returns {JsonSyntaxTree}
108
107
  */
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) {
108
+ propertyValueOrBubble(propertyKey_426) {
109
+ let return_427;
110
+ let t_428 = this.propertyValueOrNull(propertyKey_426);
111
+ if (t_428 == null) {
115
112
  throw Error();
116
113
  } else {
117
- return_416 = t_418;
114
+ return_427 = t_428;
118
115
  }
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);
116
+ return return_427;
117
+ }
118
+ /** @param {JsonProducer} p_430 */
119
+ produce(p_430) {
120
+ p_430.startObject();
121
+ function fn_431(k_432, vs_433) {
122
+ function fn_434(v_435) {
123
+ p_430.objectKey(k_432);
124
+ v_435.produce(p_430);
128
125
  return;
129
126
  }
130
- vs_423.forEach(fn_424);
127
+ vs_433.forEach(fn_434);
131
128
  return;
132
129
  }
133
- mappedForEach_426(this.#properties_406, fn_421);
134
- p_420.endObject();
130
+ mappedForEach_436(this.#properties_417, fn_431);
131
+ p_430.endObject();
135
132
  return;
136
133
  }
137
- /** @param {Map<string, Array<JsonSyntaxTree>>} properties_427 */
138
- constructor(properties_427) {
134
+ /** @param {Map<string, Array<JsonSyntaxTree>>} properties_437 */
135
+ constructor(properties_437) {
139
136
  super ();
140
- this.#properties_406 = properties_427;
137
+ this.#properties_417 = properties_437;
141
138
  return;
142
139
  }
143
140
  /** @returns {Map<string, Array<JsonSyntaxTree>>} */
144
141
  get properties() {
145
- return this.#properties_406;
142
+ return this.#properties_417;
146
143
  }
147
144
  };
148
- export class JsonArray extends type__383(JsonSyntaxTree) {
145
+ export class JsonArray extends type__392(JsonSyntaxTree) {
149
146
  /** @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);
147
+ #elements_439;
148
+ /** @param {JsonProducer} p_441 */
149
+ produce(p_441) {
150
+ p_441.startArray();
151
+ function fn_442(v_443) {
152
+ v_443.produce(p_441);
156
153
  return;
157
154
  }
158
- this.#elements_429.forEach(fn_432);
159
- p_431.endArray();
155
+ this.#elements_439.forEach(fn_442);
156
+ p_441.endArray();
160
157
  return;
161
158
  }
162
- /** @param {Array<JsonSyntaxTree>} elements_434 */
163
- constructor(elements_434) {
159
+ /** @param {Array<JsonSyntaxTree>} elements_444 */
160
+ constructor(elements_444) {
164
161
  super ();
165
- this.#elements_429 = elements_434;
162
+ this.#elements_439 = elements_444;
166
163
  return;
167
164
  }
168
165
  /** @returns {Array<JsonSyntaxTree>} */
169
166
  get elements() {
170
- return this.#elements_429;
167
+ return this.#elements_439;
171
168
  }
172
169
  };
173
- export class JsonBoolean extends type__383(JsonSyntaxTree) {
170
+ export class JsonBoolean extends type__392(JsonSyntaxTree) {
174
171
  /** @type {boolean} */
175
- #content_436;
176
- /** @param {JsonProducer} p_438 */
177
- produce(p_438) {
178
- p_438.booleanValue(this.#content_436);
172
+ #content_446;
173
+ /** @param {JsonProducer} p_448 */
174
+ produce(p_448) {
175
+ p_448.booleanValue(this.#content_446);
179
176
  return;
180
177
  }
181
- /** @param {boolean} content_439 */
182
- constructor(content_439) {
178
+ /** @param {boolean} content_449 */
179
+ constructor(content_449) {
183
180
  super ();
184
- this.#content_436 = content_439;
181
+ this.#content_446 = content_449;
185
182
  return;
186
183
  }
187
184
  /** @returns {boolean} */
188
185
  get content() {
189
- return this.#content_436;
186
+ return this.#content_446;
190
187
  }
191
188
  };
192
- export class JsonNull extends type__383(JsonSyntaxTree) {
193
- /** @param {JsonProducer} p_442 */
194
- produce(p_442) {
195
- p_442.nullValue();
189
+ export class JsonNull extends type__392(JsonSyntaxTree) {
190
+ /** @param {JsonProducer} p_452 */
191
+ produce(p_452) {
192
+ p_452.nullValue();
196
193
  return;
197
194
  }
198
195
  constructor() {
@@ -200,1013 +197,1032 @@ export class JsonNull extends type__383(JsonSyntaxTree) {
200
197
  return;
201
198
  }
202
199
  };
203
- export class JsonString extends type__383(JsonSyntaxTree) {
200
+ export class JsonString extends type__392(JsonSyntaxTree) {
204
201
  /** @type {string} */
205
- #content_443;
206
- /** @param {JsonProducer} p_445 */
207
- produce(p_445) {
208
- p_445.stringValue(this.#content_443);
202
+ #content_453;
203
+ /** @param {JsonProducer} p_455 */
204
+ produce(p_455) {
205
+ p_455.stringValue(this.#content_453);
209
206
  return;
210
207
  }
211
- /** @param {string} content_446 */
212
- constructor(content_446) {
208
+ /** @param {string} content_456 */
209
+ constructor(content_456) {
213
210
  super ();
214
- this.#content_443 = content_446;
211
+ this.#content_453 = content_456;
215
212
  return;
216
213
  }
217
214
  /** @returns {string} */
218
215
  get content() {
219
- return this.#content_443;
216
+ return this.#content_453;
220
217
  }
221
218
  };
222
- export class JsonNumeric extends type__383(JsonSyntaxTree) {
219
+ export class JsonNumeric extends type__392(JsonSyntaxTree) {
220
+ /** @returns {string} */
221
+ asJsonNumericToken() {
222
+ null;
223
+ }
224
+ /** @returns {number} */
225
+ asInt() {
226
+ null;
227
+ }
228
+ /** @returns {number} */
229
+ asFloat64() {
230
+ null;
231
+ }
223
232
  };
224
- export class JsonInt extends type__383(JsonNumeric) {
233
+ export class JsonInt extends type__392(JsonNumeric) {
225
234
  /** @type {number} */
226
- #content_451;
227
- /** @param {JsonProducer} p_453 */
228
- produce(p_453) {
229
- p_453.intValue(this.#content_451);
235
+ #content_461;
236
+ /** @param {JsonProducer} p_463 */
237
+ produce(p_463) {
238
+ p_463.intValue(this.#content_461);
230
239
  return;
231
240
  }
232
241
  /** @returns {string} */
233
242
  asJsonNumericToken() {
234
- return this.#content_451.toString();
243
+ return this.#content_461.toString();
235
244
  }
236
245
  /** @returns {number} */
237
246
  asInt() {
238
- return this.#content_451;
247
+ return this.#content_461;
239
248
  }
240
249
  /** @returns {number} */
241
250
  asFloat64() {
242
- return this.#content_451;
251
+ return this.#content_461;
243
252
  }
244
- /** @param {number} content_457 */
245
- constructor(content_457) {
253
+ /** @param {number} content_467 */
254
+ constructor(content_467) {
246
255
  super ();
247
- this.#content_451 = content_457;
256
+ this.#content_461 = content_467;
248
257
  return;
249
258
  }
250
259
  /** @returns {number} */
251
260
  get content() {
252
- return this.#content_451;
261
+ return this.#content_461;
253
262
  }
254
263
  };
255
- export class JsonFloat64 extends type__383(JsonNumeric) {
264
+ export class JsonFloat64 extends type__392(JsonNumeric) {
256
265
  /** @type {number} */
257
- #content_459;
258
- /** @param {JsonProducer} p_461 */
259
- produce(p_461) {
260
- p_461.float64Value(this.#content_459);
266
+ #content_469;
267
+ /** @param {JsonProducer} p_471 */
268
+ produce(p_471) {
269
+ p_471.float64Value(this.#content_469);
261
270
  return;
262
271
  }
263
272
  /** @returns {string} */
264
273
  asJsonNumericToken() {
265
- return float64ToString_463(this.#content_459);
274
+ return float64ToString_473(this.#content_469);
266
275
  }
267
276
  /** @returns {number} */
268
277
  asInt() {
269
- return float64ToInt_465(this.#content_459);
278
+ return float64ToInt_475(this.#content_469);
270
279
  }
271
280
  /** @returns {number} */
272
281
  asFloat64() {
273
- return this.#content_459;
282
+ return this.#content_469;
274
283
  }
275
- /** @param {number} content_467 */
276
- constructor(content_467) {
284
+ /** @param {number} content_477 */
285
+ constructor(content_477) {
277
286
  super ();
278
- this.#content_459 = content_467;
287
+ this.#content_469 = content_477;
279
288
  return;
280
289
  }
281
290
  /** @returns {number} */
282
291
  get content() {
283
- return this.#content_459;
292
+ return this.#content_469;
284
293
  }
285
294
  };
286
- export class JsonNumericToken extends type__383(JsonNumeric) {
295
+ export class JsonNumericToken extends type__392(JsonNumeric) {
287
296
  /** @type {string} */
288
- #content_469;
289
- /** @param {JsonProducer} p_471 */
290
- produce(p_471) {
291
- p_471.numericTokenValue(this.#content_469);
297
+ #content_479;
298
+ /** @param {JsonProducer} p_481 */
299
+ produce(p_481) {
300
+ p_481.numericTokenValue(this.#content_479);
292
301
  return;
293
302
  }
294
303
  /** @returns {string} */
295
304
  asJsonNumericToken() {
296
- return this.#content_469;
305
+ return this.#content_479;
297
306
  }
298
307
  /** @returns {number} */
299
308
  asInt() {
300
- let return_474;
301
- let t_475;
302
- let t_476;
309
+ let return_484;
310
+ let t_485;
311
+ let t_486;
303
312
  try {
304
- t_475 = stringToInt_477(this.#content_469);
305
- return_474 = t_475;
313
+ t_485 = stringToInt_487(this.#content_479);
314
+ return_484 = t_485;
306
315
  } catch {
307
- t_476 = stringToFloat64_478(this.#content_469);
308
- return_474 = float64ToInt_465(t_476);
316
+ t_486 = stringToFloat64_488(this.#content_479);
317
+ return_484 = float64ToInt_475(t_486);
309
318
  }
310
- return return_474;
319
+ return return_484;
311
320
  }
312
321
  /** @returns {number} */
313
322
  asFloat64() {
314
- return stringToFloat64_478(this.#content_469);
323
+ return stringToFloat64_488(this.#content_479);
315
324
  }
316
- /** @param {string} content_480 */
317
- constructor(content_480) {
325
+ /** @param {string} content_490 */
326
+ constructor(content_490) {
318
327
  super ();
319
- this.#content_469 = content_480;
328
+ this.#content_479 = content_490;
320
329
  return;
321
330
  }
322
331
  /** @returns {string} */
323
332
  get content() {
324
- return this.#content_469;
333
+ return this.#content_479;
325
334
  }
326
335
  };
327
- export class JsonTextProducer extends type__383(JsonProducer) {
336
+ export class JsonTextProducer extends type__392(JsonProducer) {
328
337
  /** @type {InterchangeContext} */
329
- #interchangeContext_482;
338
+ #interchangeContext_492;
330
339
  /** @type {globalThis.Array<string>} */
331
- #buffer_483;
340
+ #buffer_493;
332
341
  /** @type {Array<number>} */
333
- #stack_484;
342
+ #stack_494;
334
343
  /** @type {boolean} */
335
- #wellFormed_485;
336
- /** @param {InterchangeContext | null} [interchangeContext_486] */
337
- constructor(interchangeContext_486) {
344
+ #wellFormed_495;
345
+ /** @param {InterchangeContext | null} [interchangeContext_496] */
346
+ constructor(interchangeContext_496) {
338
347
  super ();
339
- let interchangeContext_487;
340
- if (interchangeContext_486 == null) {
341
- interchangeContext_487 = NullInterchangeContext.instance;
348
+ let interchangeContext_497;
349
+ if (interchangeContext_496 == null) {
350
+ interchangeContext_497 = NullInterchangeContext.instance;
342
351
  } else {
343
- interchangeContext_487 = interchangeContext_486;
352
+ interchangeContext_497 = interchangeContext_496;
344
353
  }
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;
354
+ this.#interchangeContext_492 = interchangeContext_497;
355
+ let t_498 = [""];
356
+ this.#buffer_493 = t_498;
357
+ let t_499 = [];
358
+ this.#stack_494 = t_499;
359
+ listBuilderAdd_500(this.#stack_494, 5);
360
+ this.#wellFormed_495 = true;
352
361
  return;
353
362
  }
354
363
  /** @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);
364
+ #state_502() {
365
+ let t_503 = this.#stack_494.length;
366
+ return listedGetOr_504(this.#stack_494, t_503 - 1, -1);
367
+ }
368
+ #beforeValue_506() {
369
+ let t_507;
370
+ let t_508;
371
+ let t_509;
372
+ let t_510;
373
+ const currentState_511 = this.#state_502();
374
+ if (currentState_511 === 3) {
375
+ t_507 = this.#stack_494.length;
376
+ listBuilderSet_512(this.#stack_494, t_507 - 1, 4);
377
+ } else if (currentState_511 === 4) {
378
+ this.#buffer_493[0] += ",";
379
+ } else if (currentState_511 === 1) {
380
+ t_508 = this.#stack_494.length;
381
+ listBuilderSet_512(this.#stack_494, t_508 - 1, 2);
382
+ } else if (currentState_511 === 5) {
383
+ t_509 = this.#stack_494.length;
384
+ listBuilderSet_512(this.#stack_494, t_509 - 1, 6);
376
385
  } else {
377
- if (currentState_501 === 6) {
378
- t_500 = true;
386
+ if (currentState_511 === 6) {
387
+ t_510 = true;
379
388
  } else {
380
- t_500 = currentState_501 === 2;
389
+ t_510 = currentState_511 === 2;
381
390
  }
382
- if (t_500) {
383
- this.#wellFormed_485 = false;
391
+ if (t_510) {
392
+ this.#wellFormed_495 = false;
384
393
  }
385
394
  }
386
395
  return;
387
396
  }
388
397
  startObject() {
389
- this.#beforeValue_496();
390
- this.#buffer_483[0] += "{";
391
- listBuilderAdd_490(this.#stack_484, 0);
398
+ this.#beforeValue_506();
399
+ this.#buffer_493[0] += "{";
400
+ listBuilderAdd_500(this.#stack_494, 0);
392
401
  return;
393
402
  }
394
403
  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;
404
+ let t_515;
405
+ this.#buffer_493[0] += "}";
406
+ const currentState_516 = this.#state_502();
407
+ if (0 === currentState_516) {
408
+ t_515 = true;
400
409
  } else {
401
- t_505 = 2 === currentState_506;
410
+ t_515 = 2 === currentState_516;
402
411
  }
403
- if (t_505) {
404
- listBuilderRemoveLast_507(this.#stack_484);
412
+ if (t_515) {
413
+ listBuilderRemoveLast_517(this.#stack_494);
405
414
  } else {
406
- this.#wellFormed_485 = false;
415
+ this.#wellFormed_495 = false;
407
416
  }
408
417
  return;
409
418
  }
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] += ",";
419
+ /** @param {string} key_519 */
420
+ objectKey(key_519) {
421
+ let t_520;
422
+ const currentState_521 = this.#state_502();
423
+ if (!(currentState_521 === 0)) {
424
+ if (currentState_521 === 2) {
425
+ this.#buffer_493[0] += ",";
417
426
  } else {
418
- this.#wellFormed_485 = false;
427
+ this.#wellFormed_495 = false;
419
428
  }
420
429
  }
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);
430
+ encodeJsonString_522(key_519, this.#buffer_493);
431
+ this.#buffer_493[0] += ":";
432
+ if (currentState_521 >= 0) {
433
+ t_520 = this.#stack_494.length;
434
+ listBuilderSet_512(this.#stack_494, t_520 - 1, 1);
426
435
  }
427
436
  return;
428
437
  }
429
438
  startArray() {
430
- this.#beforeValue_496();
431
- this.#buffer_483[0] += "[";
432
- listBuilderAdd_490(this.#stack_484, 3);
439
+ this.#beforeValue_506();
440
+ this.#buffer_493[0] += "[";
441
+ listBuilderAdd_500(this.#stack_494, 3);
433
442
  return;
434
443
  }
435
444
  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;
445
+ let t_525;
446
+ this.#buffer_493[0] += "]";
447
+ const currentState_526 = this.#state_502();
448
+ if (3 === currentState_526) {
449
+ t_525 = true;
441
450
  } else {
442
- t_515 = 4 === currentState_516;
451
+ t_525 = 4 === currentState_526;
443
452
  }
444
- if (t_515) {
445
- listBuilderRemoveLast_507(this.#stack_484);
453
+ if (t_525) {
454
+ listBuilderRemoveLast_517(this.#stack_494);
446
455
  } else {
447
- this.#wellFormed_485 = false;
456
+ this.#wellFormed_495 = false;
448
457
  }
449
458
  return;
450
459
  }
451
460
  nullValue() {
452
- this.#beforeValue_496();
453
- this.#buffer_483[0] += "null";
461
+ this.#beforeValue_506();
462
+ this.#buffer_493[0] += "null";
454
463
  return;
455
464
  }
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";
465
+ /** @param {boolean} x_529 */
466
+ booleanValue(x_529) {
467
+ let t_530;
468
+ this.#beforeValue_506();
469
+ if (x_529) {
470
+ t_530 = "true";
462
471
  } else {
463
- t_520 = "false";
472
+ t_530 = "false";
464
473
  }
465
- this.#buffer_483[0] += t_520;
474
+ this.#buffer_493[0] += t_530;
466
475
  return;
467
476
  }
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;
477
+ /** @param {number} x_532 */
478
+ intValue(x_532) {
479
+ this.#beforeValue_506();
480
+ let t_533 = x_532.toString();
481
+ this.#buffer_493[0] += t_533;
473
482
  return;
474
483
  }
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;
484
+ /** @param {number} x_535 */
485
+ float64Value(x_535) {
486
+ this.#beforeValue_506();
487
+ let t_536 = float64ToString_473(x_535);
488
+ this.#buffer_493[0] += t_536;
480
489
  return;
481
490
  }
482
- /** @param {string} x_528 */
483
- numericTokenValue(x_528) {
484
- this.#beforeValue_496();
485
- this.#buffer_483[0] += x_528;
491
+ /** @param {string} x_538 */
492
+ numericTokenValue(x_538) {
493
+ this.#beforeValue_506();
494
+ this.#buffer_493[0] += x_538;
486
495
  return;
487
496
  }
488
- /** @param {string} x_530 */
489
- stringValue(x_530) {
490
- this.#beforeValue_496();
491
- encodeJsonString_512(x_530, this.#buffer_483);
497
+ /** @param {string} x_540 */
498
+ stringValue(x_540) {
499
+ this.#beforeValue_506();
500
+ encodeJsonString_522(x_540, this.#buffer_493);
492
501
  return;
493
502
  }
494
503
  /** @returns {string} */
495
504
  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;
505
+ let return_542;
506
+ let t_543;
507
+ let t_544;
508
+ let t_545;
509
+ if (this.#wellFormed_495) {
510
+ if (this.#stack_494.length === 1) {
511
+ t_543 = this.#state_502();
512
+ t_544 = t_543 === 6;
504
513
  } else {
505
- t_534 = false;
514
+ t_544 = false;
506
515
  }
507
- t_535 = t_534;
516
+ t_545 = t_544;
508
517
  } else {
509
- t_535 = false;
518
+ t_545 = false;
510
519
  }
511
- if (t_535) {
512
- return_532 = this.#buffer_483[0];
520
+ if (t_545) {
521
+ return_542 = this.#buffer_493[0];
513
522
  } else {
514
523
  throw Error();
515
524
  }
516
- return return_532;
525
+ return return_542;
517
526
  }
518
527
  /** @returns {InterchangeContext} */
519
528
  get interchangeContext() {
520
- return this.#interchangeContext_482;
529
+ return this.#interchangeContext_492;
521
530
  }
522
531
  };
523
- export class JsonParseErrorReceiver extends type__383() {
524
- /** @param {string} explanation_538 */
525
- explainJsonError(explanation_538) {
532
+ export class JsonParseErrorReceiver extends type__392() {
533
+ /** @param {string} explanation_548 */
534
+ explainJsonError(explanation_548) {
526
535
  null;
527
- return;
528
536
  }
529
537
  };
530
- export class JsonSyntaxTreeProducer extends type__383(JsonProducer, JsonParseErrorReceiver) {
538
+ export class JsonSyntaxTreeProducer extends type__392(JsonProducer, JsonParseErrorReceiver) {
531
539
  /** @type {Array<Array<JsonSyntaxTree>>} */
532
- #stack_539;
540
+ #stack_549;
533
541
  /** @type {string | null} */
534
- #error_540;
542
+ #error_550;
535
543
  /** @returns {InterchangeContext} */
536
544
  get interchangeContext() {
537
545
  return NullInterchangeContext.instance;
538
546
  }
539
547
  constructor() {
540
548
  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;
549
+ let t_552 = [];
550
+ this.#stack_549 = t_552;
551
+ let t_553 = [];
552
+ listBuilderAdd_500(this.#stack_549, t_553);
553
+ this.#error_550 = null;
546
554
  return;
547
555
  }
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
+ /** @param {JsonSyntaxTree} v_556 */
557
+ #storeValue_555(v_556) {
558
+ let t_557;
559
+ if (! ! this.#stack_549.length) {
560
+ t_557 = this.#stack_549.length;
561
+ listBuilderAdd_500(listedGet_424(this.#stack_549, t_557 - 1), v_556);
556
562
  }
557
563
  return;
558
564
  }
559
565
  startObject() {
560
- let t_550 = [];
561
- listBuilderAdd_490(this.#stack_539, t_550);
566
+ let t_559 = [];
567
+ listBuilderAdd_500(this.#stack_549, t_559);
562
568
  return;
563
569
  }
564
570
  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;
571
+ let return_561;
572
+ let t_562;
573
+ let t_563;
574
+ let t_564;
575
+ let t_565;
576
+ let t_566;
577
+ let t_567;
578
+ let t_568;
579
+ let t_569;
580
+ let t_570;
581
+ let t_571;
582
+ let t_572;
583
+ let t_573;
584
+ let t_574;
585
+ let t_575;
586
+ fn_576: {
587
+ if (! this.#stack_549.length) {
588
+ return_561 = void 0;
589
+ break fn_576;
578
590
  }
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
+ const ls_577 = listBuilderRemoveLast_517(this.#stack_549);
592
+ const m_578 = mapBuilderConstructor_579();
593
+ let multis_580 = null;
594
+ let i_581 = 0;
595
+ let n_582 = ls_577.length & -2;
596
+ while (i_581 < n_582) {
597
+ const postfixReturn_583 = i_581;
598
+ i_581 = i_581 + 1;
599
+ const keyTree_584 = listedGet_424(ls_577, postfixReturn_583);
600
+ if (!(keyTree_584 instanceof JsonString)) {
591
601
  break;
592
602
  }
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
+ try {
604
+ t_568 = requireInstanceOf__585(keyTree_584, JsonString);
605
+ t_569 = t_568;
606
+ } catch {
607
+ t_562 = panic_586();
608
+ t_569 = t_562;
609
+ }
610
+ const key_587 = t_569.content;
611
+ const postfixReturn_588 = i_581;
612
+ i_581 = i_581 + 1;
613
+ const value_589 = listedGet_424(ls_577, postfixReturn_588);
614
+ if (m_578.has(key_587)) {
615
+ if (multis_580 == null) {
616
+ t_563 = mapBuilderConstructor_579();
617
+ multis_580 = t_563;
603
618
  }
604
- if (multis_565 == null) {
605
- throw Error();
606
- } else {
607
- t_558 = multis_565;
619
+ try {
620
+ if (multis_580 == null) {
621
+ throw Error();
622
+ } else {
623
+ t_570 = multis_580;
624
+ }
625
+ t_571 = t_570;
626
+ } catch {
627
+ t_564 = panic_586();
628
+ t_571 = t_564;
608
629
  }
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());
630
+ const mb_590 = t_571;
631
+ if (! mb_590.has(key_587)) {
632
+ try {
633
+ t_572 = mappedGet_591(m_578, key_587);
634
+ t_573 = t_572;
635
+ } catch {
636
+ t_565 = panic_586();
637
+ t_573 = t_565;
638
+ }
639
+ mapBuilderSet_592(mb_590, key_587, t_573.slice());
613
640
  }
614
- t_560 = mappedGet_575(mb_574, key_571);
615
- listBuilderAdd_490(t_560, value_573);
641
+ try {
642
+ t_574 = mappedGet_591(mb_590, key_587);
643
+ t_575 = t_574;
644
+ } catch {
645
+ t_566 = panic_586();
646
+ t_575 = t_566;
647
+ }
648
+ listBuilderAdd_500(t_575, value_589);
616
649
  } else {
617
- mapBuilderSet_576(m_563, key_571, Object.freeze([value_573]));
650
+ mapBuilderSet_592(m_578, key_587, Object.freeze([value_589]));
618
651
  }
619
652
  }
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);
653
+ const multis_593 = multis_580;
654
+ if (!(multis_593 == null)) {
655
+ function fn_594(k_595, vs_596) {
656
+ let t_597 = listBuilderToList_598(vs_596);
657
+ mapBuilderSet_592(m_578, k_595, t_597);
625
658
  return;
626
659
  }
627
- mappedForEach_426(multis_577, fn_578);
660
+ mappedForEach_436(multis_593, fn_594);
628
661
  }
629
- t_554 = new JsonObject(mappedToMap_583(m_563));
630
- this.#storeValue_545(t_554);
631
- return_552 = void 0;
662
+ t_567 = new JsonObject(mappedToMap_599(m_578));
663
+ this.#storeValue_555(t_567);
664
+ return_561 = void 0;
632
665
  }
633
- return return_552;
666
+ return return_561;
634
667
  }
635
- /** @param {string} key_585 */
636
- objectKey(key_585) {
637
- let t_586 = new JsonString(key_585);
638
- this.#storeValue_545(t_586);
668
+ /** @param {string} key_601 */
669
+ objectKey(key_601) {
670
+ let t_602 = new JsonString(key_601);
671
+ this.#storeValue_555(t_602);
639
672
  return;
640
673
  }
641
674
  startArray() {
642
- let t_588 = [];
643
- listBuilderAdd_490(this.#stack_539, t_588);
675
+ let t_604 = [];
676
+ listBuilderAdd_500(this.#stack_549, t_604);
644
677
  return;
645
678
  }
646
679
  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;
680
+ let return_606;
681
+ let t_607;
682
+ fn_608: {
683
+ if (! this.#stack_549.length) {
684
+ return_606 = void 0;
685
+ break fn_608;
653
686
  }
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;
687
+ const ls_609 = listBuilderRemoveLast_517(this.#stack_549);
688
+ t_607 = new JsonArray(listBuilderToList_598(ls_609));
689
+ this.#storeValue_555(t_607);
690
+ return_606 = void 0;
659
691
  }
660
- return return_590;
692
+ return return_606;
661
693
  }
662
694
  nullValue() {
663
- let t_595 = new JsonNull();
664
- this.#storeValue_545(t_595);
695
+ let t_611 = new JsonNull();
696
+ this.#storeValue_555(t_611);
665
697
  return;
666
698
  }
667
- /** @param {boolean} x_597 */
668
- booleanValue(x_597) {
669
- let t_598 = new JsonBoolean(x_597);
670
- this.#storeValue_545(t_598);
699
+ /** @param {boolean} x_613 */
700
+ booleanValue(x_613) {
701
+ let t_614 = new JsonBoolean(x_613);
702
+ this.#storeValue_555(t_614);
671
703
  return;
672
704
  }
673
- /** @param {number} x_600 */
674
- intValue(x_600) {
675
- let t_601 = new JsonInt(x_600);
676
- this.#storeValue_545(t_601);
705
+ /** @param {number} x_616 */
706
+ intValue(x_616) {
707
+ let t_617 = new JsonInt(x_616);
708
+ this.#storeValue_555(t_617);
677
709
  return;
678
710
  }
679
- /** @param {number} x_603 */
680
- float64Value(x_603) {
681
- let t_604 = new JsonFloat64(x_603);
682
- this.#storeValue_545(t_604);
711
+ /** @param {number} x_619 */
712
+ float64Value(x_619) {
713
+ let t_620 = new JsonFloat64(x_619);
714
+ this.#storeValue_555(t_620);
683
715
  return;
684
716
  }
685
- /** @param {string} x_606 */
686
- numericTokenValue(x_606) {
687
- let t_607 = new JsonNumericToken(x_606);
688
- this.#storeValue_545(t_607);
717
+ /** @param {string} x_622 */
718
+ numericTokenValue(x_622) {
719
+ let t_623 = new JsonNumericToken(x_622);
720
+ this.#storeValue_555(t_623);
689
721
  return;
690
722
  }
691
- /** @param {string} x_609 */
692
- stringValue(x_609) {
693
- let t_610 = new JsonString(x_609);
694
- this.#storeValue_545(t_610);
723
+ /** @param {string} x_625 */
724
+ stringValue(x_625) {
725
+ let t_626 = new JsonString(x_625);
726
+ this.#storeValue_555(t_626);
695
727
  return;
696
728
  }
697
729
  /** @returns {JsonSyntaxTree} */
698
730
  toJsonSyntaxTree() {
699
- let t_612;
700
- if (this.#stack_539.length !== 1) {
701
- t_612 = true;
731
+ let t_628;
732
+ if (this.#stack_549.length !== 1) {
733
+ t_628 = true;
702
734
  } else {
703
- t_612 = !(this.#error_540 == null);
735
+ t_628 = !(this.#error_550 == null);
704
736
  }
705
- if (t_612) {
737
+ if (t_628) {
706
738
  throw Error();
707
739
  }
708
- let ls_613;
709
- ls_613 = listedGet_413(this.#stack_539, 0);
710
- if (ls_613.length !== 1) {
740
+ const ls_629 = listedGet_424(this.#stack_549, 0);
741
+ if (ls_629.length !== 1) {
711
742
  throw Error();
712
743
  }
713
- return listedGet_413(ls_613, 0);
744
+ return listedGet_424(ls_629, 0);
714
745
  }
715
746
  /** @returns {string | null} */
716
747
  get jsonError() {
717
- return this.#error_540;
748
+ return this.#error_550;
749
+ }
750
+ /** @returns {JsonParseErrorReceiver} */
751
+ get parseErrorReceiver() {
752
+ return this;
718
753
  }
719
- /** @param {string} error_616 */
720
- explainJsonError(error_616) {
721
- this.#error_540 = error_616;
754
+ /** @param {string} error_633 */
755
+ explainJsonError(error_633) {
756
+ this.#error_550 = error_633;
722
757
  return;
723
758
  }
724
759
  };
725
760
  /**
726
- * @param {string} sourceText_618
727
- * @param {globalThis.number} i_619
728
- * @param {JsonProducer} out_620
761
+ * @param {string} sourceText_635
762
+ * @param {globalThis.number} i_636
763
+ * @param {JsonProducer} out_637
729
764
  * @returns {globalThis.number}
730
765
  */
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);
766
+ function parseJsonValue_634(sourceText_635, i_636, out_637) {
767
+ let return_638;
768
+ let t_639;
769
+ let t_640;
770
+ let t_641;
771
+ fn_642: {
772
+ t_639 = skipJsonSpaces_643(sourceText_635, i_636);
773
+ i_636 = t_639;
774
+ if (!(sourceText_635.length > i_636)) {
775
+ expectedTokenError_644(sourceText_635, i_636, out_637, "JSON value");
776
+ return_638 = -1;
777
+ break fn_642;
778
+ }
779
+ t_640 = stringGet_645(sourceText_635, i_636);
780
+ if (t_640 === 123) {
781
+ return_638 = parseJsonObject_646(sourceText_635, i_636, out_637);
782
+ } else if (t_640 === 91) {
783
+ return_638 = parseJsonArray_647(sourceText_635, i_636, out_637);
784
+ } else if (t_640 === 34) {
785
+ return_638 = parseJsonString_648(sourceText_635, i_636, out_637);
751
786
  } else {
752
- if (t_623 === 116) {
753
- t_624 = true;
787
+ if (t_640 === 116) {
788
+ t_641 = true;
754
789
  } else {
755
- t_624 = t_623 === 102;
790
+ t_641 = t_640 === 102;
756
791
  }
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);
792
+ if (t_641) {
793
+ return_638 = parseJsonBoolean_649(sourceText_635, i_636, out_637);
794
+ } else if (t_640 === 110) {
795
+ return_638 = parseJsonNull_650(sourceText_635, i_636, out_637);
761
796
  } else {
762
- return_621 = parseJsonNumber_634(sourceText_618, i_619, out_620);
797
+ return_638 = parseJsonNumber_651(sourceText_635, i_636, out_637);
763
798
  }
764
799
  }
765
800
  }
766
- return return_621;
801
+ return return_638;
767
802
  }
768
- /** @template T_638 */
769
- export class JsonAdapter extends type__383() {
803
+ /** @template T_652 */
804
+ export class JsonAdapter extends type__392() {
770
805
  /**
771
- * @param {T_638} x_636
772
- * @param {JsonProducer} p_637
806
+ * @param {T_652} x_654
807
+ * @param {JsonProducer} p_655
773
808
  */
774
- encodeToJson(x_636, p_637) {
809
+ encodeToJson(x_654, p_655) {
810
+ null;
811
+ }
812
+ /**
813
+ * @param {JsonSyntaxTree} t_657
814
+ * @param {InterchangeContext} ic_658
815
+ * @returns {T_652}
816
+ */
817
+ decodeFromJson(t_657, ic_658) {
775
818
  null;
776
- return;
777
819
  }
778
820
  };
779
- class BooleanJsonAdapter_642 extends type__383(JsonAdapter) {
821
+ class BooleanJsonAdapter_659 extends type__392(JsonAdapter) {
780
822
  /**
781
- * @param {boolean} x_644
782
- * @param {JsonProducer} p_645
823
+ * @param {boolean} x_661
824
+ * @param {JsonProducer} p_662
783
825
  */
784
- encodeToJson(x_644, p_645) {
785
- p_645.booleanValue(x_644);
826
+ encodeToJson(x_661, p_662) {
827
+ p_662.booleanValue(x_661);
786
828
  return;
787
829
  }
788
830
  /**
789
- * @param {JsonSyntaxTree} t_647
790
- * @param {InterchangeContext} ic_648
831
+ * @param {JsonSyntaxTree} t_664
832
+ * @param {InterchangeContext} ic_665
791
833
  * @returns {boolean}
792
834
  */
793
- decodeFromJson(t_647, ic_648) {
794
- let t_649;
795
- t_649 = requireInstanceOf__570(t_647, JsonBoolean);
796
- return t_649.content;
835
+ decodeFromJson(t_664, ic_665) {
836
+ let t_666;
837
+ t_666 = requireInstanceOf__585(t_664, JsonBoolean);
838
+ return t_666.content;
797
839
  }
798
840
  constructor() {
799
841
  super ();
800
842
  return;
801
843
  }
802
844
  }
803
- class Float64JsonAdapter_650 extends type__383(JsonAdapter) {
845
+ class Float64JsonAdapter_667 extends type__392(JsonAdapter) {
804
846
  /**
805
- * @param {number} x_652
806
- * @param {JsonProducer} p_653
847
+ * @param {number} x_669
848
+ * @param {JsonProducer} p_670
807
849
  */
808
- encodeToJson(x_652, p_653) {
809
- p_653.float64Value(x_652);
850
+ encodeToJson(x_669, p_670) {
851
+ p_670.float64Value(x_669);
810
852
  return;
811
853
  }
812
854
  /**
813
- * @param {JsonSyntaxTree} t_655
814
- * @param {InterchangeContext} ic_656
855
+ * @param {JsonSyntaxTree} t_672
856
+ * @param {InterchangeContext} ic_673
815
857
  * @returns {number}
816
858
  */
817
- decodeFromJson(t_655, ic_656) {
818
- let t_657;
819
- t_657 = requireInstanceOf__570(t_655, JsonFloat64);
820
- return t_657.content;
859
+ decodeFromJson(t_672, ic_673) {
860
+ let t_674;
861
+ t_674 = requireInstanceOf__585(t_672, JsonNumeric);
862
+ return t_674.asFloat64();
821
863
  }
822
864
  constructor() {
823
865
  super ();
824
866
  return;
825
867
  }
826
868
  }
827
- class IntJsonAdapter_658 extends type__383(JsonAdapter) {
869
+ class IntJsonAdapter_675 extends type__392(JsonAdapter) {
828
870
  /**
829
- * @param {number} x_660
830
- * @param {JsonProducer} p_661
871
+ * @param {number} x_677
872
+ * @param {JsonProducer} p_678
831
873
  */
832
- encodeToJson(x_660, p_661) {
833
- p_661.intValue(x_660);
874
+ encodeToJson(x_677, p_678) {
875
+ p_678.intValue(x_677);
834
876
  return;
835
877
  }
836
878
  /**
837
- * @param {JsonSyntaxTree} t_663
838
- * @param {InterchangeContext} ic_664
879
+ * @param {JsonSyntaxTree} t_680
880
+ * @param {InterchangeContext} ic_681
839
881
  * @returns {number}
840
882
  */
841
- decodeFromJson(t_663, ic_664) {
842
- let t_665;
843
- t_665 = requireInstanceOf__570(t_663, JsonInt);
844
- return t_665.content;
883
+ decodeFromJson(t_680, ic_681) {
884
+ let t_682;
885
+ t_682 = requireInstanceOf__585(t_680, JsonNumeric);
886
+ return t_682.asInt();
845
887
  }
846
888
  constructor() {
847
889
  super ();
848
890
  return;
849
891
  }
850
892
  }
851
- class StringJsonAdapter_666 extends type__383(JsonAdapter) {
893
+ class StringJsonAdapter_683 extends type__392(JsonAdapter) {
852
894
  /**
853
- * @param {string} x_668
854
- * @param {JsonProducer} p_669
895
+ * @param {string} x_685
896
+ * @param {JsonProducer} p_686
855
897
  */
856
- encodeToJson(x_668, p_669) {
857
- p_669.stringValue(x_668);
898
+ encodeToJson(x_685, p_686) {
899
+ p_686.stringValue(x_685);
858
900
  return;
859
901
  }
860
902
  /**
861
- * @param {JsonSyntaxTree} t_671
862
- * @param {InterchangeContext} ic_672
903
+ * @param {JsonSyntaxTree} t_688
904
+ * @param {InterchangeContext} ic_689
863
905
  * @returns {string}
864
906
  */
865
- decodeFromJson(t_671, ic_672) {
866
- let t_673;
867
- t_673 = requireInstanceOf__570(t_671, JsonString);
868
- return t_673.content;
907
+ decodeFromJson(t_688, ic_689) {
908
+ let t_690;
909
+ t_690 = requireInstanceOf__585(t_688, JsonString);
910
+ return t_690.content;
869
911
  }
870
912
  constructor() {
871
913
  super ();
872
914
  return;
873
915
  }
874
916
  }
875
- /** @template T_676 */
876
- class ListJsonAdapter_674 extends type__383(JsonAdapter) {
877
- /** @type {JsonAdapter<T_676>} */
878
- #adapterForT_675;
917
+ /** @template T_692 */
918
+ class ListJsonAdapter_691 extends type__392(JsonAdapter) {
919
+ /** @type {JsonAdapter<T_692>} */
920
+ #adapterForT_693;
879
921
  /**
880
- * @param {Array<T_676>} x_678
881
- * @param {JsonProducer} p_679
922
+ * @param {Array<T_692>} x_695
923
+ * @param {JsonProducer} p_696
882
924
  */
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);
925
+ encodeToJson(x_695, p_696) {
926
+ const this699 = this;
927
+ p_696.startArray();
928
+ function fn_697(el_698) {
929
+ this699.#adapterForT_693.encodeToJson(el_698, p_696);
888
930
  return;
889
931
  }
890
- x_678.forEach(fn_680);
891
- p_679.endArray();
932
+ x_695.forEach(fn_697);
933
+ p_696.endArray();
892
934
  return;
893
935
  }
894
936
  /**
895
- * @param {JsonSyntaxTree} t_684
896
- * @param {InterchangeContext} ic_685
897
- * @returns {Array<T_676>}
937
+ * @param {JsonSyntaxTree} t_701
938
+ * @param {InterchangeContext} ic_702
939
+ * @returns {Array<T_692>}
898
940
  */
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) {
941
+ decodeFromJson(t_701, ic_702) {
942
+ let t_703;
943
+ const b_704 = [];
944
+ let t_705;
945
+ t_705 = requireInstanceOf__585(t_701, JsonArray);
946
+ const elements_706 = t_705.elements;
947
+ const n_707 = elements_706.length;
948
+ let i_708 = 0;
949
+ while (i_708 < n_707) {
950
+ const el_709 = listedGet_424(elements_706, i_708);
951
+ i_708 = i_708 + 1;
952
+ t_703 = this.#adapterForT_693.decodeFromJson(el_709, ic_702);
953
+ listBuilderAdd_500(b_704, t_703);
954
+ }
955
+ return listBuilderToList_598(b_704);
956
+ }
957
+ /** @param {JsonAdapter<T_692>} adapterForT_710 */
958
+ constructor(adapterForT_710) {
919
959
  super ();
920
- this.#adapterForT_675 = adapterForT_694;
960
+ this.#adapterForT_693 = adapterForT_710;
921
961
  return;
922
962
  }
923
963
  }
924
- /** @template T_696 */
925
- export class OrNullJsonAdapter extends type__383(JsonAdapter) {
926
- /** @type {JsonAdapter<T_696>} */
927
- #adapterForT_695;
964
+ /** @template T_711 */
965
+ export class OrNullJsonAdapter extends type__392(JsonAdapter) {
966
+ /** @type {JsonAdapter<T_711>} */
967
+ #adapterForT_712;
928
968
  /**
929
- * @param {T_696 | null} x_698
930
- * @param {JsonProducer} p_699
969
+ * @param {T_711 | null} x_714
970
+ * @param {JsonProducer} p_715
931
971
  */
932
- encodeToJson(x_698, p_699) {
933
- if (x_698 == null) {
934
- p_699.nullValue();
972
+ encodeToJson(x_714, p_715) {
973
+ if (x_714 == null) {
974
+ p_715.nullValue();
935
975
  } else {
936
- const x_700 = x_698;
937
- this.#adapterForT_695.encodeToJson(x_700, p_699);
976
+ const x_716 = x_714;
977
+ this.#adapterForT_712.encodeToJson(x_716, p_715);
938
978
  }
939
979
  return;
940
980
  }
941
981
  /**
942
- * @param {JsonSyntaxTree} t_702
943
- * @param {InterchangeContext} ic_703
944
- * @returns {T_696 | null}
982
+ * @param {JsonSyntaxTree} t_718
983
+ * @param {InterchangeContext} ic_719
984
+ * @returns {T_711 | null}
945
985
  */
946
- decodeFromJson(t_702, ic_703) {
947
- let return_704;
948
- if (t_702 instanceof JsonNull) {
949
- return_704 = null;
986
+ decodeFromJson(t_718, ic_719) {
987
+ let return_720;
988
+ if (t_718 instanceof JsonNull) {
989
+ return_720 = null;
950
990
  } else {
951
- return_704 = this.#adapterForT_695.decodeFromJson(t_702, ic_703);
991
+ return_720 = this.#adapterForT_712.decodeFromJson(t_718, ic_719);
952
992
  }
953
- return return_704;
993
+ return return_720;
954
994
  }
955
- /** @param {JsonAdapter<T_696>} adapterForT_705 */
956
- constructor(adapterForT_705) {
995
+ /** @param {JsonAdapter<T_711>} adapterForT_721 */
996
+ constructor(adapterForT_721) {
957
997
  super ();
958
- this.#adapterForT_695 = adapterForT_705;
998
+ this.#adapterForT_712 = adapterForT_721;
959
999
  return;
960
1000
  }
961
1001
  };
962
1002
  /** @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"]);
1003
+ const hexDigits_722 = Object.freeze(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]);
964
1004
  /**
965
- * @param {number} cp_708
966
- * @param {globalThis.Array<string>} buffer_709
1005
+ * @param {number} cp_724
1006
+ * @param {globalThis.Array<string>} buffer_725
967
1007
  */
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;
1008
+ function encodeHex4_723(cp_724, buffer_725) {
1009
+ const b0_726 = trunc__727(cp_724 / 4096) & 15;
1010
+ const b1_728 = trunc__727(cp_724 / 256) & 15;
1011
+ const b2_729 = trunc__727(cp_724 / 16) & 15;
1012
+ const b3_730 = cp_724 & 15;
1013
+ let t_731 = listedGet_424(hexDigits_722, b0_726);
1014
+ buffer_725[0] += t_731;
1015
+ let t_732 = listedGet_424(hexDigits_722, b1_728);
1016
+ buffer_725[0] += t_732;
1017
+ let t_733 = listedGet_424(hexDigits_722, b2_729);
1018
+ buffer_725[0] += t_733;
1019
+ let t_734 = listedGet_424(hexDigits_722, b3_730);
1020
+ buffer_725[0] += t_734;
985
1021
  return;
986
1022
  }
987
1023
  /**
988
- * @param {string} x_719
989
- * @param {globalThis.Array<string>} buffer_720
1024
+ * @param {string} x_735
1025
+ * @param {globalThis.Array<string>} buffer_736
990
1026
  */
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;
1027
+ function encodeJsonString_522(x_735, buffer_736) {
1028
+ let t_737;
1029
+ let t_738;
1030
+ let t_739;
1031
+ let t_740;
1032
+ buffer_736[0] += "\u0022";
1033
+ let i_741 = 0;
1034
+ let emitted_742 = i_741;
1000
1035
  while (true) {
1001
- if (!(x_719.length > i_726)) {
1036
+ if (!(x_735.length > i_741)) {
1002
1037
  break;
1003
1038
  }
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 = "\\\\";
1039
+ const cp_743 = stringGet_645(x_735, i_741);
1040
+ if (cp_743 === 8) {
1041
+ t_740 = "\\b";
1042
+ } else if (cp_743 === 9) {
1043
+ t_740 = "\\t";
1044
+ } else if (cp_743 === 10) {
1045
+ t_740 = "\\n";
1046
+ } else if (cp_743 === 12) {
1047
+ t_740 = "\\f";
1048
+ } else if (cp_743 === 13) {
1049
+ t_740 = "\\r";
1050
+ } else if (cp_743 === 34) {
1051
+ t_740 = "\\\u0022";
1052
+ } else if (cp_743 === 92) {
1053
+ t_740 = "\\\\";
1020
1054
  } else {
1021
- if (cp_728 < 32) {
1022
- t_723 = true;
1055
+ if (cp_743 < 32) {
1056
+ t_738 = true;
1023
1057
  } else {
1024
- if (55296 <= cp_728) {
1025
- t_722 = cp_728 <= 57343;
1058
+ if (55296 <= cp_743) {
1059
+ t_737 = cp_743 <= 57343;
1026
1060
  } else {
1027
- t_722 = false;
1061
+ t_737 = false;
1028
1062
  }
1029
- t_723 = t_722;
1063
+ t_738 = t_737;
1030
1064
  }
1031
- if (t_723) {
1032
- t_724 = "\\u";
1065
+ if (t_738) {
1066
+ t_739 = "\\u";
1033
1067
  } else {
1034
- t_724 = "";
1068
+ t_739 = "";
1035
1069
  }
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);
1070
+ t_740 = t_739;
1071
+ }
1072
+ const replacement_744 = t_740;
1073
+ const nextI_745 = stringNext_746(x_735, i_741);
1074
+ if (replacement_744 !== "") {
1075
+ buffer_736[0] += x_735.substring(emitted_742, i_741);
1076
+ buffer_736[0] += replacement_744;
1077
+ if (replacement_744 === "\\u") {
1078
+ encodeHex4_723(cp_743, buffer_736);
1045
1079
  }
1046
- emitted_727 = nextI_730;
1080
+ emitted_742 = nextI_745;
1047
1081
  }
1048
- i_726 = nextI_730;
1082
+ i_741 = nextI_745;
1049
1083
  }
1050
- buffer_720[0] += x_719.substring(emitted_727, i_726);
1051
- buffer_720[0] += "\u0022";
1084
+ buffer_736[0] += x_735.substring(emitted_742, i_741);
1085
+ buffer_736[0] += "\u0022";
1052
1086
  return;
1053
1087
  }
1054
1088
  /**
1055
- * @param {JsonProducer} out_733
1056
- * @param {string} explanation_734
1089
+ * @param {JsonProducer} out_748
1090
+ * @param {string} explanation_749
1057
1091
  */
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);
1092
+ function storeJsonError_747(out_748, explanation_749) {
1093
+ let t_750 = out_748.parseErrorReceiver;
1094
+ if (!(t_750 == null)) {
1095
+ t_750.explainJsonError(explanation_749);
1063
1096
  }
1064
1097
  return;
1065
1098
  }
1066
1099
  /**
1067
- * @param {string} sourceText_736
1068
- * @param {globalThis.number} i_737
1069
- * @param {JsonProducer} out_738
1070
- * @param {string} shortExplanation_739
1100
+ * @param {string} sourceText_751
1101
+ * @param {globalThis.number} i_752
1102
+ * @param {JsonProducer} out_753
1103
+ * @param {string} shortExplanation_754
1071
1104
  */
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 + "`";
1105
+ function expectedTokenError_644(sourceText_751, i_752, out_753, shortExplanation_754) {
1106
+ let t_755;
1107
+ let t_756;
1108
+ let gotten_757;
1109
+ if (sourceText_751.length > i_752) {
1110
+ t_755 = sourceText_751.length;
1111
+ t_756 = sourceText_751.substring(i_752, t_755);
1112
+ gotten_757 = "`" + t_756 + "`";
1080
1113
  } else {
1081
- gotten_742 = "end-of-file";
1114
+ gotten_757 = "end-of-file";
1082
1115
  }
1083
- storeJsonError_732(out_738, "Expected " + shortExplanation_739 + ", but got " + gotten_742);
1116
+ storeJsonError_747(out_753, "Expected " + shortExplanation_754 + ", but got " + gotten_757);
1084
1117
  return;
1085
1118
  }
1086
1119
  /**
1087
- * @param {string} sourceText_743
1088
- * @param {globalThis.number} i_744
1120
+ * @param {string} sourceText_758
1121
+ * @param {globalThis.number} i_759
1089
1122
  * @returns {globalThis.number}
1090
1123
  */
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;
1124
+ function skipJsonSpaces_643(sourceText_758, i_759) {
1125
+ let t_760;
1126
+ let t_761;
1127
+ let t_762;
1128
+ let t_763;
1129
+ let t_764;
1097
1130
  while (true) {
1098
- if (!(sourceText_743.length > i_744)) {
1131
+ if (!(sourceText_758.length > i_759)) {
1099
1132
  break;
1100
1133
  }
1101
- t_746 = stringGet_628(sourceText_743, i_744);
1102
- if (t_746 === 9) {
1103
- t_749 = true;
1134
+ t_760 = stringGet_645(sourceText_758, i_759);
1135
+ if (t_760 === 9) {
1136
+ t_764 = true;
1104
1137
  } else {
1105
- if (t_746 === 10) {
1106
- t_748 = true;
1138
+ if (t_760 === 10) {
1139
+ t_763 = true;
1107
1140
  } else {
1108
- if (t_746 === 13) {
1109
- t_747 = true;
1141
+ if (t_760 === 13) {
1142
+ t_762 = true;
1110
1143
  } else {
1111
- t_747 = t_746 === 32;
1144
+ t_762 = t_760 === 32;
1112
1145
  }
1113
- t_748 = t_747;
1146
+ t_763 = t_762;
1114
1147
  }
1115
- t_749 = t_748;
1148
+ t_764 = t_763;
1116
1149
  }
1117
- if (! t_749) {
1150
+ if (! t_764) {
1118
1151
  break;
1119
1152
  }
1120
- t_745 = stringNext_731(sourceText_743, i_744);
1121
- i_744 = t_745;
1153
+ t_761 = stringNext_746(sourceText_758, i_759);
1154
+ i_759 = t_761;
1122
1155
  }
1123
- return i_744;
1156
+ return i_759;
1124
1157
  }
1125
1158
  /**
1126
- * @param {string} sourceText_751
1127
- * @param {globalThis.number} start_752
1128
- * @param {globalThis.number} limit_753
1159
+ * @param {string} sourceText_766
1160
+ * @param {globalThis.number} start_767
1161
+ * @param {globalThis.number} limit_768
1129
1162
  * @returns {number}
1130
1163
  */
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;
1164
+ function decodeHexUnsigned_765(sourceText_766, start_767, limit_768) {
1165
+ let return_769;
1166
+ let t_770;
1167
+ let t_771;
1168
+ let t_772;
1169
+ let t_773;
1170
+ let t_774;
1171
+ fn_775: {
1172
+ let n_776 = 0;
1173
+ let i_777 = start_767;
1142
1174
  while (true) {
1143
- if (!(i_763 - limit_753 < 0)) {
1175
+ if (!(i_777 - limit_768 < 0)) {
1144
1176
  break;
1145
1177
  }
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;
1178
+ const cp_778 = stringGet_645(sourceText_766, i_777);
1179
+ if (48 <= cp_778) {
1180
+ t_771 = cp_778 <= 48;
1150
1181
  } else {
1151
- t_757 = false;
1182
+ t_771 = false;
1152
1183
  }
1153
- if (t_757) {
1154
- t_760 = cp_764 - 48;
1184
+ if (t_771) {
1185
+ t_774 = cp_778 - 48;
1155
1186
  } else {
1156
- if (65 <= cp_764) {
1157
- t_758 = cp_764 <= 70;
1187
+ if (65 <= cp_778) {
1188
+ t_772 = cp_778 <= 70;
1158
1189
  } else {
1159
- t_758 = false;
1190
+ t_772 = false;
1160
1191
  }
1161
- if (t_758) {
1162
- t_760 = cp_764 - 65 + 10;
1192
+ if (t_772) {
1193
+ t_774 = cp_778 - 65 + 10;
1163
1194
  } else {
1164
- if (97 <= cp_764) {
1165
- t_759 = cp_764 <= 102;
1195
+ if (97 <= cp_778) {
1196
+ t_773 = cp_778 <= 102;
1166
1197
  } else {
1167
- t_759 = false;
1198
+ t_773 = false;
1168
1199
  }
1169
- if (t_759) {
1170
- t_760 = cp_764 - 97 + 10;
1200
+ if (t_773) {
1201
+ t_774 = cp_778 - 97 + 10;
1171
1202
  } else {
1172
- return_754 = -1;
1173
- break fn_761;
1203
+ return_769 = -1;
1204
+ break fn_775;
1174
1205
  }
1175
1206
  }
1176
1207
  }
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;
1208
+ const digit_779 = t_774;
1209
+ n_776 = n_776 * 16 + digit_779;
1210
+ t_770 = stringNext_746(sourceText_766, i_777);
1211
+ i_777 = t_770;
1181
1212
  }
1182
- return_754 = n_762;
1213
+ return_769 = n_776;
1183
1214
  }
1184
- return return_754;
1215
+ return return_769;
1185
1216
  }
1186
1217
  /**
1187
- * @param {string} sourceText_766
1188
- * @param {globalThis.number} i_767
1189
- * @param {JsonProducer} out_768
1218
+ * @param {string} sourceText_781
1219
+ * @param {globalThis.number} i_782
1220
+ * @param {globalThis.Array<string>} sb_783
1221
+ * @param {JsonProducer} errOut_784
1190
1222
  * @returns {globalThis.number}
1191
1223
  */
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;
1224
+ function parseJsonStringTo_780(sourceText_781, i_782, sb_783, errOut_784) {
1225
+ let return_785;
1210
1226
  let t_786;
1211
1227
  let t_787;
1212
1228
  let t_788;
@@ -1217,190 +1233,198 @@ function parseJsonString_631(sourceText_766, i_767, out_768) {
1217
1233
  let t_793;
1218
1234
  let t_794;
1219
1235
  let t_795;
1220
- fn_796: {
1221
- if (!(sourceText_766.length > i_767)) {
1222
- t_781 = true;
1236
+ let t_796;
1237
+ let t_797;
1238
+ let t_798;
1239
+ let t_799;
1240
+ let t_800;
1241
+ let t_801;
1242
+ let t_802;
1243
+ let t_803;
1244
+ let t_804;
1245
+ let t_805;
1246
+ let t_806;
1247
+ let t_807;
1248
+ let t_808;
1249
+ fn_809: {
1250
+ if (!(sourceText_781.length > i_782)) {
1251
+ t_797 = true;
1223
1252
  } 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;
1253
+ t_786 = stringGet_645(sourceText_781, i_782);
1254
+ t_797 = t_786 !== 34;
1255
+ }
1256
+ if (t_797) {
1257
+ expectedTokenError_644(sourceText_781, i_782, errOut_784, "\u0022");
1258
+ return_785 = -1;
1259
+ break fn_809;
1260
+ }
1261
+ t_787 = stringNext_746(sourceText_781, i_782);
1262
+ i_782 = t_787;
1263
+ let leadSurrogate_810 = -1;
1264
+ let consumed_811 = i_782;
1237
1265
  while (true) {
1238
- if (!(sourceText_766.length > i_767)) {
1266
+ if (!(sourceText_781.length > i_782)) {
1239
1267
  break;
1240
1268
  }
1241
- t_782 = stringGet_628(sourceText_766, i_767);
1242
- const cp_800 = t_782;
1243
- if (cp_800 === 34) {
1269
+ const cp_812 = stringGet_645(sourceText_781, i_782);
1270
+ if (cp_812 === 34) {
1244
1271
  break;
1245
1272
  }
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;
1273
+ t_788 = stringNext_746(sourceText_781, i_782);
1274
+ let iNext_813 = t_788;
1275
+ const end_814 = sourceText_781.length;
1276
+ let needToFlush_815 = false;
1277
+ if (cp_812 !== 92) {
1278
+ t_803 = cp_812;
1252
1279
  } 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;
1280
+ needToFlush_815 = true;
1281
+ if (!(sourceText_781.length > iNext_813)) {
1282
+ expectedTokenError_644(sourceText_781, iNext_813, errOut_784, "escape sequence");
1283
+ return_785 = -1;
1284
+ break fn_809;
1258
1285
  }
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;
1286
+ const esc0_816 = stringGet_645(sourceText_781, iNext_813);
1287
+ t_789 = stringNext_746(sourceText_781, iNext_813);
1288
+ iNext_813 = t_789;
1289
+ if (esc0_816 === 34) {
1290
+ t_799 = true;
1265
1291
  } else {
1266
- if (esc0_804 === 92) {
1267
- t_784 = true;
1292
+ if (esc0_816 === 92) {
1293
+ t_798 = true;
1268
1294
  } else {
1269
- t_784 = esc0_804 === 47;
1295
+ t_798 = esc0_816 === 47;
1270
1296
  }
1271
- t_785 = t_784;
1297
+ t_799 = t_798;
1272
1298
  }
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;
1299
+ if (t_799) {
1300
+ t_802 = esc0_816;
1301
+ } else if (esc0_816 === 98) {
1302
+ t_802 = 8;
1303
+ } else if (esc0_816 === 102) {
1304
+ t_802 = 12;
1305
+ } else if (esc0_816 === 110) {
1306
+ t_802 = 10;
1307
+ } else if (esc0_816 === 114) {
1308
+ t_802 = 13;
1309
+ } else if (esc0_816 === 116) {
1310
+ t_802 = 9;
1311
+ } else if (esc0_816 === 117) {
1312
+ if (stringHasAtLeast_817(sourceText_781, iNext_813, end_814, 4)) {
1313
+ const startHex_818 = iNext_813;
1314
+ t_790 = stringNext_746(sourceText_781, iNext_813);
1315
+ iNext_813 = t_790;
1316
+ t_791 = stringNext_746(sourceText_781, iNext_813);
1317
+ iNext_813 = t_791;
1318
+ t_792 = stringNext_746(sourceText_781, iNext_813);
1319
+ iNext_813 = t_792;
1320
+ t_793 = stringNext_746(sourceText_781, iNext_813);
1321
+ iNext_813 = t_793;
1322
+ t_794 = decodeHexUnsigned_765(sourceText_781, startHex_818, iNext_813);
1323
+ t_800 = t_794;
1298
1324
  } else {
1299
- t_786 = -1;
1325
+ t_800 = -1;
1300
1326
  }
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;
1327
+ const hex_819 = t_800;
1328
+ if (hex_819 < 0) {
1329
+ expectedTokenError_644(sourceText_781, iNext_813, errOut_784, "four hex digits");
1330
+ return_785 = -1;
1331
+ break fn_809;
1306
1332
  }
1307
- t_787 = hex_807;
1308
- t_788 = t_787;
1333
+ t_801 = hex_819;
1334
+ t_802 = t_801;
1309
1335
  } else {
1310
- expectedTokenError_627(sourceText_766, iNext_801, out_768, "escape sequence");
1311
- return_769 = -1;
1312
- break fn_796;
1336
+ expectedTokenError_644(sourceText_781, iNext_813, errOut_784, "escape sequence");
1337
+ return_785 = -1;
1338
+ break fn_809;
1313
1339
  }
1314
- t_789 = t_788;
1340
+ t_803 = t_802;
1315
1341
  }
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;
1342
+ let decodedCp_820 = t_803;
1343
+ if (leadSurrogate_810 >= 0) {
1344
+ needToFlush_815 = true;
1345
+ const lead_821 = leadSurrogate_810;
1346
+ if (56320 <= decodedCp_820) {
1347
+ t_804 = decodedCp_820 <= 57343;
1322
1348
  } else {
1323
- t_790 = false;
1349
+ t_804 = false;
1324
1350
  }
1325
- if (t_790) {
1326
- leadSurrogate_798 = -1;
1327
- t_791 = (lead_809 - 55296) * 1024 | decodedCp_808 - 56320;
1328
- decodedCp_808 = 65536 + t_791;
1351
+ if (t_804) {
1352
+ leadSurrogate_810 = -1;
1353
+ t_805 = (lead_821 - 55296) * 1024 | decodedCp_820 - 56320;
1354
+ decodedCp_820 = 65536 + t_805;
1329
1355
  }
1330
1356
  } else {
1331
- if (55296 <= decodedCp_808) {
1332
- t_792 = decodedCp_808 <= 56319;
1357
+ if (55296 <= decodedCp_820) {
1358
+ t_806 = decodedCp_820 <= 56319;
1333
1359
  } else {
1334
- t_792 = false;
1360
+ t_806 = false;
1335
1361
  }
1336
- if (t_792) {
1337
- needToFlush_803 = true;
1362
+ if (t_806) {
1363
+ needToFlush_815 = true;
1338
1364
  }
1339
1365
  }
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);
1366
+ if (needToFlush_815) {
1367
+ sb_783[0] += sourceText_781.substring(consumed_811, i_782);
1368
+ if (leadSurrogate_810 >= 0) {
1369
+ try {
1370
+ stringBuilderAppendCodePoint_822(sb_783, leadSurrogate_810);
1371
+ } catch {
1372
+ throw Error();
1373
+ }
1344
1374
  }
1345
- if (55296 <= decodedCp_808) {
1346
- t_793 = decodedCp_808 <= 56319;
1375
+ if (55296 <= decodedCp_820) {
1376
+ t_807 = decodedCp_820 <= 56319;
1347
1377
  } else {
1348
- t_793 = false;
1378
+ t_807 = false;
1349
1379
  }
1350
- if (t_793) {
1351
- leadSurrogate_798 = decodedCp_808;
1380
+ if (t_807) {
1381
+ leadSurrogate_810 = decodedCp_820;
1352
1382
  } else {
1353
- leadSurrogate_798 = -1;
1354
- stringBuilderAppendCodePoint_810(sb_797, decodedCp_808);
1383
+ leadSurrogate_810 = -1;
1384
+ try {
1385
+ stringBuilderAppendCodePoint_822(sb_783, decodedCp_820);
1386
+ } catch {
1387
+ throw Error();
1388
+ }
1355
1389
  }
1356
- consumed_799 = iNext_801;
1390
+ consumed_811 = iNext_813;
1357
1391
  }
1358
- i_767 = iNext_801;
1392
+ i_782 = iNext_813;
1359
1393
  }
1360
- if (!(sourceText_766.length > i_767)) {
1361
- t_795 = true;
1394
+ if (!(sourceText_781.length > i_782)) {
1395
+ t_808 = true;
1362
1396
  } else {
1363
- t_794 = stringGet_628(sourceText_766, i_767);
1364
- t_795 = t_794 !== 34;
1397
+ t_795 = stringGet_645(sourceText_781, i_782);
1398
+ t_808 = t_795 !== 34;
1365
1399
  }
1366
- if (t_795) {
1367
- expectedTokenError_627(sourceText_766, i_767, out_768, "\u0022");
1368
- return_769 = -1;
1400
+ if (t_808) {
1401
+ expectedTokenError_644(sourceText_781, i_782, errOut_784, "\u0022");
1402
+ return_785 = -1;
1369
1403
  } else {
1370
- if (leadSurrogate_798 >= 0) {
1371
- stringBuilderAppendCodePoint_810(sb_797, leadSurrogate_798);
1404
+ if (leadSurrogate_810 >= 0) {
1405
+ try {
1406
+ stringBuilderAppendCodePoint_822(sb_783, leadSurrogate_810);
1407
+ } catch {
1408
+ throw Error();
1409
+ }
1372
1410
  } else {
1373
- sb_797[0] += sourceText_766.substring(consumed_799, i_767);
1411
+ sb_783[0] += sourceText_781.substring(consumed_811, i_782);
1374
1412
  }
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;
1413
+ t_796 = stringNext_746(sourceText_781, i_782);
1414
+ i_782 = t_796;
1415
+ return_785 = i_782;
1380
1416
  }
1381
1417
  }
1382
- return return_769;
1418
+ return return_785;
1383
1419
  }
1384
1420
  /**
1385
- * @param {string} sourceText_811
1386
- * @param {globalThis.number} i_812
1387
- * @param {JsonProducer} out_813
1421
+ * @param {string} sourceText_823
1422
+ * @param {globalThis.number} i_824
1423
+ * @param {JsonProducer} out_825
1388
1424
  * @returns {globalThis.number}
1389
1425
  */
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;
1426
+ function parseJsonObject_646(sourceText_823, i_824, out_825) {
1427
+ let return_826;
1404
1428
  let t_827;
1405
1429
  let t_828;
1406
1430
  let t_829;
@@ -1408,100 +1432,14 @@ function parseJsonObject_629(sourceText_811, i_812, out_813) {
1408
1432
  let t_831;
1409
1433
  let t_832;
1410
1434
  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;
1435
+ let t_834;
1436
+ let t_835;
1437
+ let t_836;
1438
+ let t_837;
1439
+ let t_838;
1440
+ let t_839;
1441
+ let t_840;
1442
+ let t_841;
1505
1443
  let t_842;
1506
1444
  let t_843;
1507
1445
  let t_844;
@@ -1509,191 +1447,244 @@ function parseJsonArray_630(sourceText_838, i_839, out_840) {
1509
1447
  let t_846;
1510
1448
  let t_847;
1511
1449
  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;
1450
+ fn_849: {
1451
+ try {
1452
+ if (!(sourceText_823.length > i_824)) {
1453
+ t_841 = true;
1454
+ } else {
1455
+ t_827 = stringGet_645(sourceText_823, i_824);
1456
+ t_841 = t_827 !== 123;
1457
+ }
1458
+ if (t_841) {
1459
+ expectedTokenError_644(sourceText_823, i_824, out_825, "'{'");
1460
+ return_826 = -1;
1461
+ break fn_849;
1462
+ }
1463
+ out_825.startObject();
1464
+ t_828 = stringNext_746(sourceText_823, i_824);
1465
+ t_829 = skipJsonSpaces_643(sourceText_823, t_828);
1466
+ i_824 = t_829;
1467
+ if (sourceText_823.length > i_824) {
1468
+ t_830 = stringGet_645(sourceText_823, i_824);
1469
+ t_842 = t_830 !== 125;
1470
+ } else {
1471
+ t_842 = false;
1472
+ }
1473
+ if (t_842) {
1474
+ while (true) {
1475
+ const keyBuffer_850 = [""];
1476
+ const afterKey_851 = parseJsonStringTo_780(sourceText_823, i_824, keyBuffer_850, out_825);
1477
+ if (!(afterKey_851 >= 0)) {
1478
+ return_826 = -1;
1479
+ break fn_849;
1480
+ }
1481
+ t_831 = keyBuffer_850[0];
1482
+ out_825.objectKey(t_831);
1483
+ try {
1484
+ t_843 = requireStringIndex__852(afterKey_851);
1485
+ t_844 = t_843;
1486
+ } catch {
1487
+ t_832 = panic_586();
1488
+ t_844 = t_832;
1489
+ }
1490
+ t_833 = skipJsonSpaces_643(sourceText_823, t_844);
1491
+ i_824 = t_833;
1492
+ if (sourceText_823.length > i_824) {
1493
+ t_834 = stringGet_645(sourceText_823, i_824);
1494
+ t_845 = t_834 === 58;
1495
+ } else {
1496
+ t_845 = false;
1497
+ }
1498
+ if (t_845) {
1499
+ t_835 = stringNext_746(sourceText_823, i_824);
1500
+ i_824 = t_835;
1501
+ const afterPropertyValue_853 = parseJsonValue_634(sourceText_823, i_824, out_825);
1502
+ if (!(afterPropertyValue_853 >= 0)) {
1503
+ return_826 = -1;
1504
+ break fn_849;
1505
+ }
1506
+ t_846 = requireStringIndex__852(afterPropertyValue_853);
1507
+ i_824 = t_846;
1508
+ } else {
1509
+ expectedTokenError_644(sourceText_823, i_824, out_825, "':'");
1510
+ return_826 = -1;
1511
+ break fn_849;
1512
+ }
1513
+ t_836 = skipJsonSpaces_643(sourceText_823, i_824);
1514
+ i_824 = t_836;
1515
+ if (sourceText_823.length > i_824) {
1516
+ t_837 = stringGet_645(sourceText_823, i_824);
1517
+ t_847 = t_837 === 44;
1518
+ } else {
1519
+ t_847 = false;
1520
+ }
1521
+ if (t_847) {
1522
+ t_838 = stringNext_746(sourceText_823, i_824);
1523
+ t_839 = skipJsonSpaces_643(sourceText_823, t_838);
1524
+ i_824 = t_839;
1525
+ } else {
1526
+ break;
1527
+ }
1564
1528
  }
1565
1529
  }
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;
1530
+ if (sourceText_823.length > i_824) {
1531
+ t_840 = stringGet_645(sourceText_823, i_824);
1532
+ t_848 = t_840 === 125;
1533
+ } else {
1534
+ t_848 = false;
1535
+ }
1536
+ if (t_848) {
1537
+ out_825.endObject();
1538
+ return_826 = stringNext_746(sourceText_823, i_824);
1539
+ } else {
1540
+ expectedTokenError_644(sourceText_823, i_824, out_825, "'}'");
1541
+ return_826 = -1;
1542
+ }
1543
+ } catch {
1544
+ return_826 = panic_586();
1579
1545
  }
1580
1546
  }
1581
- return return_841;
1547
+ return return_826;
1582
1548
  }
1583
1549
  /**
1584
- * @param {string} string_859
1585
- * @param {globalThis.number} inString_860
1586
- * @param {string} substring_861
1550
+ * @param {string} sourceText_854
1551
+ * @param {globalThis.number} i_855
1552
+ * @param {JsonProducer} out_856
1587
1553
  * @returns {globalThis.number}
1588
1554
  */
1589
- function afterSubstring_858(string_859, inString_860, substring_861) {
1590
- let return_862;
1555
+ function parseJsonArray_647(sourceText_854, i_855, out_856) {
1556
+ let return_857;
1557
+ let t_858;
1558
+ let t_859;
1559
+ let t_860;
1560
+ let t_861;
1561
+ let t_862;
1591
1562
  let t_863;
1592
1563
  let t_864;
1593
1564
  let t_865;
1594
1565
  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;
1566
+ let t_867;
1567
+ let t_868;
1568
+ let t_869;
1569
+ let t_870;
1570
+ let t_871;
1571
+ fn_872: {
1572
+ try {
1573
+ if (!(sourceText_854.length > i_855)) {
1574
+ t_867 = true;
1575
+ } else {
1576
+ t_858 = stringGet_645(sourceText_854, i_855);
1577
+ t_867 = t_858 !== 91;
1601
1578
  }
1602
- if (!(string_859.length > i_868)) {
1603
- return_862 = -1;
1604
- break fn_867;
1579
+ if (t_867) {
1580
+ expectedTokenError_644(sourceText_854, i_855, out_856, "'['");
1581
+ return_857 = -1;
1582
+ break fn_872;
1605
1583
  }
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;
1584
+ out_856.startArray();
1585
+ t_859 = stringNext_746(sourceText_854, i_855);
1586
+ t_860 = skipJsonSpaces_643(sourceText_854, t_859);
1587
+ i_855 = t_860;
1588
+ if (sourceText_854.length > i_855) {
1589
+ t_861 = stringGet_645(sourceText_854, i_855);
1590
+ t_868 = t_861 !== 93;
1591
+ } else {
1592
+ t_868 = false;
1611
1593
  }
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;
1594
+ if (t_868) {
1595
+ while (true) {
1596
+ const afterElementValue_873 = parseJsonValue_634(sourceText_854, i_855, out_856);
1597
+ if (!(afterElementValue_873 >= 0)) {
1598
+ return_857 = -1;
1599
+ break fn_872;
1600
+ }
1601
+ t_869 = requireStringIndex__852(afterElementValue_873);
1602
+ i_855 = t_869;
1603
+ t_862 = skipJsonSpaces_643(sourceText_854, i_855);
1604
+ i_855 = t_862;
1605
+ if (sourceText_854.length > i_855) {
1606
+ t_863 = stringGet_645(sourceText_854, i_855);
1607
+ t_870 = t_863 === 44;
1608
+ } else {
1609
+ t_870 = false;
1610
+ }
1611
+ if (t_870) {
1612
+ t_864 = stringNext_746(sourceText_854, i_855);
1613
+ t_865 = skipJsonSpaces_643(sourceText_854, t_864);
1614
+ i_855 = t_865;
1615
+ } else {
1616
+ break;
1617
+ }
1618
+ }
1619
+ }
1620
+ if (sourceText_854.length > i_855) {
1621
+ t_866 = stringGet_645(sourceText_854, i_855);
1622
+ t_871 = t_866 === 93;
1623
+ } else {
1624
+ t_871 = false;
1625
+ }
1626
+ if (t_871) {
1627
+ out_856.endArray();
1628
+ return_857 = stringNext_746(sourceText_854, i_855);
1629
+ } else {
1630
+ expectedTokenError_644(sourceText_854, i_855, out_856, "']'");
1631
+ return_857 = -1;
1632
+ }
1633
+ } catch {
1634
+ return_857 = panic_586();
1616
1635
  }
1617
- return_862 = i_868;
1618
1636
  }
1619
- return return_862;
1637
+ return return_857;
1620
1638
  }
1621
1639
  /**
1622
- * @param {string} sourceText_870
1623
- * @param {globalThis.number} i_871
1624
- * @param {JsonProducer} out_872
1640
+ * @param {string} sourceText_874
1641
+ * @param {globalThis.number} i_875
1642
+ * @param {JsonProducer} out_876
1625
1643
  * @returns {globalThis.number}
1626
1644
  */
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;
1645
+ function parseJsonString_648(sourceText_874, i_875, out_876) {
1632
1646
  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;
1647
+ const sb_878 = [""];
1648
+ const after_879 = parseJsonStringTo_780(sourceText_874, i_875, sb_878, out_876);
1649
+ if (after_879 >= 0) {
1650
+ t_877 = sb_878[0];
1651
+ out_876.stringValue(t_877);
1675
1652
  }
1676
- return return_873;
1653
+ return after_879;
1677
1654
  }
1678
1655
  /**
1679
- * @param {string} sourceText_884
1680
- * @param {globalThis.number} i_885
1681
- * @param {JsonProducer} out_886
1656
+ * @param {string} string_881
1657
+ * @param {globalThis.number} inString_882
1658
+ * @param {string} substring_883
1682
1659
  * @returns {globalThis.number}
1683
1660
  */
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;
1661
+ function afterSubstring_880(string_881, inString_882, substring_883) {
1662
+ let return_884;
1663
+ let t_885;
1664
+ let t_886;
1665
+ fn_887: {
1666
+ let i_888 = inString_882;
1667
+ let j_889 = 0;
1668
+ while (true) {
1669
+ if (!(substring_883.length > j_889)) {
1670
+ break;
1671
+ }
1672
+ if (!(string_881.length > i_888)) {
1673
+ return_884 = -1;
1674
+ break fn_887;
1675
+ }
1676
+ if (stringGet_645(string_881, i_888) !== stringGet_645(substring_883, j_889)) {
1677
+ return_884 = -1;
1678
+ break fn_887;
1679
+ }
1680
+ t_885 = stringNext_746(string_881, i_888);
1681
+ i_888 = t_885;
1682
+ t_886 = stringNext_746(substring_883, j_889);
1683
+ j_889 = t_886;
1692
1684
  }
1693
- expectedTokenError_627(sourceText_884, i_885, out_886, "`null`");
1694
- return_887 = -1;
1685
+ return_884 = i_888;
1695
1686
  }
1696
- return return_887;
1687
+ return return_884;
1697
1688
  }
1698
1689
  /**
1699
1690
  * @param {string} sourceText_890
@@ -1701,26 +1692,74 @@ function parseJsonNull_633(sourceText_884, i_885, out_886) {
1701
1692
  * @param {JsonProducer} out_892
1702
1693
  * @returns {globalThis.number}
1703
1694
  */
1704
- function parseJsonNumber_634(sourceText_890, i_891, out_892) {
1695
+ function parseJsonBoolean_649(sourceText_890, i_891, out_892) {
1705
1696
  let return_893;
1706
1697
  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;
1698
+ fn_895: {
1699
+ let ch0_896;
1700
+ if (sourceText_890.length > i_891) {
1701
+ t_894 = stringGet_645(sourceText_890, i_891);
1702
+ ch0_896 = t_894;
1703
+ } else {
1704
+ ch0_896 = 0;
1705
+ }
1706
+ const end_897 = sourceText_890.length;
1707
+ let keyword_898;
1708
+ let n_899;
1709
+ if (ch0_896 === 102) {
1710
+ keyword_898 = "false";
1711
+ n_899 = 5;
1712
+ } else if (ch0_896 === 116) {
1713
+ keyword_898 = "true";
1714
+ n_899 = 4;
1715
+ } else {
1716
+ keyword_898 = null;
1717
+ n_899 = 0;
1718
+ }
1719
+ if (!(keyword_898 == null)) {
1720
+ const keyword_900 = keyword_898;
1721
+ if (stringHasAtLeast_817(sourceText_890, i_891, end_897, n_899)) {
1722
+ const after_901 = afterSubstring_880(sourceText_890, i_891, keyword_900);
1723
+ if (after_901 >= 0) {
1724
+ return_893 = requireStringIndex__852(after_901);
1725
+ out_892.booleanValue(n_899 === 4);
1726
+ break fn_895;
1727
+ }
1728
+ }
1729
+ }
1730
+ expectedTokenError_644(sourceText_890, i_891, out_892, "`false` or `true`");
1731
+ return_893 = -1;
1732
+ }
1733
+ return return_893;
1734
+ }
1735
+ /**
1736
+ * @param {string} sourceText_902
1737
+ * @param {globalThis.number} i_903
1738
+ * @param {JsonProducer} out_904
1739
+ * @returns {globalThis.number}
1740
+ */
1741
+ function parseJsonNull_650(sourceText_902, i_903, out_904) {
1742
+ let return_905;
1743
+ fn_906: {
1744
+ const after_907 = afterSubstring_880(sourceText_902, i_903, "null");
1745
+ if (after_907 >= 0) {
1746
+ return_905 = requireStringIndex__852(after_907);
1747
+ out_904.nullValue();
1748
+ break fn_906;
1749
+ }
1750
+ expectedTokenError_644(sourceText_902, i_903, out_904, "`null`");
1751
+ return_905 = -1;
1752
+ }
1753
+ return return_905;
1754
+ }
1755
+ /**
1756
+ * @param {string} sourceText_908
1757
+ * @param {globalThis.number} i_909
1758
+ * @param {JsonProducer} out_910
1759
+ * @returns {globalThis.number}
1760
+ */
1761
+ function parseJsonNumber_651(sourceText_908, i_909, out_910) {
1762
+ let return_911;
1724
1763
  let t_912;
1725
1764
  let t_913;
1726
1765
  let t_914;
@@ -1741,293 +1780,322 @@ function parseJsonNumber_634(sourceText_890, i_891, out_892) {
1741
1780
  let t_929;
1742
1781
  let t_930;
1743
1782
  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;
1783
+ let t_932;
1784
+ let t_933;
1785
+ let t_934;
1786
+ let t_935;
1787
+ let t_936;
1788
+ let t_937;
1789
+ let t_938;
1790
+ let t_939;
1791
+ let t_940;
1792
+ let t_941;
1793
+ let t_942;
1794
+ let t_943;
1795
+ let t_944;
1796
+ let t_945;
1797
+ let t_946;
1798
+ let t_947;
1799
+ let t_948;
1800
+ let t_949;
1801
+ fn_950: {
1802
+ try {
1803
+ let isNegative_951 = false;
1804
+ const startOfNumber_952 = i_909;
1805
+ if (sourceText_908.length > i_909) {
1806
+ t_912 = stringGet_645(sourceText_908, i_909);
1807
+ t_925 = t_912 === 45;
1774
1808
  } else {
1775
- t_906 = false;
1809
+ t_925 = false;
1776
1810
  }
1777
- if (t_906) {
1778
- error_936 = "JSON value";
1811
+ if (t_925) {
1812
+ isNegative_951 = true;
1813
+ t_913 = stringNext_746(sourceText_908, i_909);
1814
+ i_909 = t_913;
1815
+ }
1816
+ let digit0_953;
1817
+ if (sourceText_908.length > i_909) {
1818
+ t_914 = stringGet_645(sourceText_908, i_909);
1819
+ digit0_953 = t_914;
1779
1820
  } else {
1780
- error_936 = "digit";
1821
+ digit0_953 = -1;
1781
1822
  }
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
- }
1823
+ if (digit0_953 < 48) {
1824
+ t_926 = true;
1825
+ } else {
1826
+ t_926 = 57 < digit0_953;
1813
1827
  }
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;
1828
+ if (t_926) {
1829
+ let error_954;
1830
+ if (! isNegative_951) {
1831
+ t_927 = digit0_953 !== 46;
1834
1832
  } else {
1835
- t_915 = false;
1833
+ t_927 = false;
1836
1834
  }
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;
1835
+ if (t_927) {
1836
+ error_954 = "JSON value";
1845
1837
  } else {
1846
- break;
1838
+ error_954 = "digit";
1847
1839
  }
1840
+ expectedTokenError_644(sourceText_908, i_909, out_910, error_954);
1841
+ return_911 = -1;
1842
+ break fn_950;
1848
1843
  }
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;
1844
+ t_915 = stringNext_746(sourceText_908, i_909);
1845
+ i_909 = t_915;
1846
+ let nDigits_955 = 1;
1847
+ try {
1848
+ t_928 = digit0_953 - 48;
1849
+ t_929 = t_928;
1850
+ } catch {
1851
+ t_916 = panic_586();
1852
+ t_929 = t_916;
1853
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;
1854
+ let tentativeValue_956 = t_929;
1855
+ if (48 !== digit0_953) {
1856
+ while (true) {
1857
+ if (!(sourceText_908.length > i_909)) {
1858
+ break;
1859
+ }
1860
+ const possibleDigit_957 = stringGet_645(sourceText_908, i_909);
1861
+ if (48 <= possibleDigit_957) {
1862
+ t_930 = possibleDigit_957 <= 57;
1863
+ } else {
1864
+ t_930 = false;
1865
+ }
1866
+ if (t_930) {
1867
+ t_917 = stringNext_746(sourceText_908, i_909);
1868
+ i_909 = t_917;
1869
+ nDigits_955 = nDigits_955 + 1;
1870
+ t_932 = tentativeValue_956 * 10.0;
1871
+ t_931 = possibleDigit_957 - 48;
1872
+ tentativeValue_956 = t_932 + t_931;
1873
+ } else {
1874
+ break;
1875
+ }
1876
+ }
1870
1877
  }
1871
- let afterE_944;
1872
- afterE_944 = stringGet_628(sourceText_890, i_891);
1873
- if (afterE_944 === 43) {
1874
- t_921 = true;
1878
+ let nDigitsAfterPoint_958 = 0;
1879
+ if (sourceText_908.length > i_909) {
1880
+ t_918 = stringGet_645(sourceText_908, i_909);
1881
+ t_933 = 46 === t_918;
1875
1882
  } else {
1876
- t_921 = afterE_944 === 45;
1883
+ t_933 = false;
1877
1884
  }
1878
- if (t_921) {
1879
- t_900 = stringNext_731(sourceText_890, i_891);
1880
- i_891 = t_900;
1885
+ if (t_933) {
1886
+ t_919 = stringNext_746(sourceText_908, i_909);
1887
+ i_909 = t_919;
1888
+ const afterPoint_959 = i_909;
1889
+ while (true) {
1890
+ if (!(sourceText_908.length > i_909)) {
1891
+ break;
1892
+ }
1893
+ const possibleDigit_960 = stringGet_645(sourceText_908, i_909);
1894
+ if (48 <= possibleDigit_960) {
1895
+ t_934 = possibleDigit_960 <= 57;
1896
+ } else {
1897
+ t_934 = false;
1898
+ }
1899
+ if (t_934) {
1900
+ t_920 = stringNext_746(sourceText_908, i_909);
1901
+ i_909 = t_920;
1902
+ nDigits_955 = nDigits_955 + 1;
1903
+ nDigitsAfterPoint_958 = nDigitsAfterPoint_958 + 1;
1904
+ t_936 = tentativeValue_956 * 10.0;
1905
+ t_935 = possibleDigit_960 - 48;
1906
+ tentativeValue_956 = t_936 + t_935;
1907
+ } else {
1908
+ break;
1909
+ }
1910
+ }
1911
+ if (i_909 === afterPoint_959) {
1912
+ expectedTokenError_644(sourceText_908, i_909, out_910, "digit");
1913
+ return_911 = -1;
1914
+ break fn_950;
1915
+ }
1881
1916
  }
1882
- while (true) {
1883
- if (!(sourceText_890.length > i_891)) {
1884
- break;
1917
+ let nExponentDigits_961 = 0;
1918
+ if (sourceText_908.length > i_909) {
1919
+ t_937 = stringGet_645(sourceText_908, i_909) | 32;
1920
+ t_938 = 101 === t_937;
1921
+ } else {
1922
+ t_938 = false;
1923
+ }
1924
+ if (t_938) {
1925
+ t_921 = stringNext_746(sourceText_908, i_909);
1926
+ i_909 = t_921;
1927
+ if (!(sourceText_908.length > i_909)) {
1928
+ expectedTokenError_644(sourceText_908, i_909, out_910, "sign or digit");
1929
+ return_911 = -1;
1930
+ break fn_950;
1885
1931
  }
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;
1932
+ const afterE_962 = stringGet_645(sourceText_908, i_909);
1933
+ if (afterE_962 === 43) {
1934
+ t_939 = true;
1890
1935
  } else {
1891
- t_923 = false;
1936
+ t_939 = afterE_962 === 45;
1892
1937
  }
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;
1938
+ if (t_939) {
1939
+ t_922 = stringNext_746(sourceText_908, i_909);
1940
+ i_909 = t_922;
1941
+ }
1942
+ while (true) {
1943
+ if (!(sourceText_908.length > i_909)) {
1944
+ break;
1945
+ }
1946
+ const possibleDigit_963 = stringGet_645(sourceText_908, i_909);
1947
+ if (48 <= possibleDigit_963) {
1948
+ t_940 = possibleDigit_963 <= 57;
1949
+ } else {
1950
+ t_940 = false;
1951
+ }
1952
+ if (t_940) {
1953
+ t_923 = stringNext_746(sourceText_908, i_909);
1954
+ i_909 = t_923;
1955
+ nExponentDigits_961 = nExponentDigits_961 + 1;
1956
+ } else {
1957
+ break;
1958
+ }
1959
+ }
1960
+ if (nExponentDigits_961 === 0) {
1961
+ expectedTokenError_644(sourceText_908, i_909, out_910, "exponent digit");
1962
+ return_911 = -1;
1963
+ break fn_950;
1899
1964
  }
1900
1965
  }
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;
1966
+ const afterExponent_964 = i_909;
1967
+ if (nExponentDigits_961 === 0) {
1968
+ t_941 = nDigitsAfterPoint_958 === 0;
1917
1969
  } else {
1918
- value_947 = tentativeValue_938;
1970
+ t_941 = false;
1919
1971
  }
1920
- if (nDigits_937 <= 10) {
1921
- if (cmpFloat__948(-2.147483648E9, value_947) <= 0) {
1922
- t_925 = cmpFloat__948(value_947, 2.147483647E9) <= 0;
1972
+ if (t_941) {
1973
+ let value_965;
1974
+ if (isNegative_951) {
1975
+ value_965 = - tentativeValue_956;
1976
+ } else {
1977
+ value_965 = tentativeValue_956;
1978
+ }
1979
+ if (nDigits_955 <= 10) {
1980
+ if (cmpFloat__966(-2.147483648E9, value_965) <= 0) {
1981
+ t_942 = cmpFloat__966(value_965, 2.147483647E9) <= 0;
1982
+ } else {
1983
+ t_942 = false;
1984
+ }
1985
+ t_943 = t_942;
1923
1986
  } else {
1924
- t_925 = false;
1987
+ t_943 = false;
1925
1988
  }
1926
- t_926 = t_925;
1989
+ if (t_943) {
1990
+ try {
1991
+ t_944 = float64ToInt_475(value_965);
1992
+ t_945 = t_944;
1993
+ } catch {
1994
+ t_924 = panic_586();
1995
+ t_945 = t_924;
1996
+ }
1997
+ out_910.intValue(t_945);
1998
+ return_911 = i_909;
1999
+ break fn_950;
2000
+ }
2001
+ }
2002
+ const numericTokenString_967 = sourceText_908.substring(startOfNumber_952, i_909);
2003
+ let doubleValue_968 = NaN;
2004
+ if (nExponentDigits_961 !== 0) {
2005
+ t_946 = true;
1927
2006
  } else {
1928
- t_926 = false;
2007
+ t_946 = nDigitsAfterPoint_958 !== 0;
1929
2008
  }
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;
2009
+ if (t_946) {
2010
+ try {
2011
+ t_947 = stringToFloat64_488(numericTokenString_967);
2012
+ doubleValue_968 = t_947;
2013
+ } catch {
2014
+ }
1935
2015
  }
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 {
2016
+ if (cmpFloat__966(doubleValue_968, -Infinity) !== 0) {
2017
+ if (cmpFloat__966(doubleValue_968, Infinity) !== 0) {
2018
+ t_948 = cmpFloat__966(doubleValue_968, NaN) !== 0;
2019
+ } else {
2020
+ t_948 = false;
2021
+ }
2022
+ t_949 = t_948;
2023
+ } else {
2024
+ t_949 = false;
1949
2025
  }
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;
2026
+ if (t_949) {
2027
+ out_910.float64Value(doubleValue_968);
1954
2028
  } else {
1955
- t_930 = false;
2029
+ out_910.numericTokenValue(numericTokenString_967);
1956
2030
  }
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);
2031
+ return_911 = i_909;
2032
+ } catch {
2033
+ return_911 = panic_586();
1965
2034
  }
1966
- return_893 = i_891;
1967
2035
  }
1968
- return return_893;
2036
+ return return_911;
1969
2037
  }
1970
2038
  /**
1971
- * @param {string} sourceText_951
1972
- * @param {JsonProducer} out_952
2039
+ * @param {string} sourceText_969
2040
+ * @param {JsonProducer} out_970
1973
2041
  */
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;
2042
+ export function parseJsonToProducer(sourceText_969, out_970) {
2043
+ let t_971;
2044
+ let t_972;
2045
+ let t_973;
2046
+ let t_974;
2047
+ let t_975;
2048
+ let t_976;
2049
+ let i_977 = 0;
2050
+ const afterValue_978 = parseJsonValue_634(sourceText_969, i_977, out_970);
2051
+ if (afterValue_978 >= 0) {
2052
+ t_976 = requireStringIndex__852(afterValue_978);
2053
+ t_971 = skipJsonSpaces_643(sourceText_969, t_976);
2054
+ i_977 = t_971;
2055
+ if (sourceText_969.length > i_977) {
2056
+ t_972 = out_970.parseErrorReceiver;
2057
+ t_975 = !(t_972 == null);
1990
2058
  } else {
1991
- t_958 = false;
2059
+ t_975 = false;
1992
2060
  }
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 + "`");
2061
+ if (t_975) {
2062
+ t_973 = sourceText_969.length;
2063
+ t_974 = sourceText_969.substring(i_977, t_973);
2064
+ storeJsonError_747(out_970, "Extraneous JSON `" + t_974 + "`");
1997
2065
  }
1998
2066
  }
1999
2067
  return;
2000
2068
  };
2001
2069
  /**
2002
- * @param {string} sourceText_961
2070
+ * @param {string} sourceText_979
2003
2071
  * @returns {JsonSyntaxTree}
2004
2072
  */
2005
- export function parseJson(sourceText_961) {
2006
- const p_962 = new JsonSyntaxTreeProducer();
2007
- parseJsonToProducer(sourceText_961, p_962);
2008
- return p_962.toJsonSyntaxTree();
2073
+ export function parseJson(sourceText_979) {
2074
+ const p_980 = new JsonSyntaxTreeProducer();
2075
+ parseJsonToProducer(sourceText_979, p_980);
2076
+ return p_980.toJsonSyntaxTree();
2009
2077
  };
2010
2078
  /** @returns {JsonAdapter<boolean>} */
2011
2079
  export function booleanJsonAdapter() {
2012
- return new BooleanJsonAdapter_642();
2080
+ return new BooleanJsonAdapter_659();
2013
2081
  };
2014
2082
  /** @returns {JsonAdapter<number>} */
2015
2083
  export function float64JsonAdapter() {
2016
- return new Float64JsonAdapter_650();
2084
+ return new Float64JsonAdapter_667();
2017
2085
  };
2018
2086
  /** @returns {JsonAdapter<number>} */
2019
2087
  export function intJsonAdapter() {
2020
- return new IntJsonAdapter_658();
2088
+ return new IntJsonAdapter_675();
2021
2089
  };
2022
2090
  /** @returns {JsonAdapter<string>} */
2023
2091
  export function stringJsonAdapter() {
2024
- return new StringJsonAdapter_666();
2092
+ return new StringJsonAdapter_683();
2025
2093
  };
2026
2094
  /**
2027
- * @template {unknown} T_964
2028
- * @param {JsonAdapter<T_964>} adapterForT_963
2029
- * @returns {JsonAdapter<Array<T_964>>}
2095
+ * @template {unknown} T_982
2096
+ * @param {JsonAdapter<T_982>} adapterForT_981
2097
+ * @returns {JsonAdapter<Array<T_982>>}
2030
2098
  */
2031
- export function listJsonAdapter(adapterForT_963) {
2032
- return new ListJsonAdapter_674(adapterForT_963);
2099
+ export function listJsonAdapter(adapterForT_981) {
2100
+ return new ListJsonAdapter_691(adapterForT_981);
2033
2101
  };