@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/regex.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {
2
- type as type__10, requireInstanceOf as requireInstanceOf__138, pairConstructor as pairConstructor_90, mapConstructor as mapConstructor_89, regexCompileFormatted as regexCompileFormatted_101, regexCompiledFound as regexCompiledFound_105, regexCompiledFind as regexCompiledFind_110, regexCompiledReplace as regexCompiledReplace_115, regexCompiledSplit as regexCompiledSplit_118, listedJoin as listedJoin_128, listBuilderAdd as listBuilderAdd_146, listedGet as listedGet_174, regexFormatterPushCodeTo as regexFormatterPushCodeTo_176, stringGet as stringGet_184, stringNext as stringNext_185, regexFormatterAdjustCodeSet as regexFormatterAdjustCodeSet_199, listBuilderToList as listBuilderToList_311
2
+ type as type__10, requireInstanceOf as requireInstanceOf__134, pairConstructor as pairConstructor_88, mapConstructor as mapConstructor_87, regexCompileFormatted as regexCompileFormatted_100, regexCompiledFound as regexCompiledFound_104, regexCompiledFind as regexCompiledFind_109, regexCompiledReplace as regexCompiledReplace_114, regexCompiledSplit as regexCompiledSplit_117, listedGet as listedGet_169, stringFromCodePoint as stringFromCodePoint_171, regexFormatterPushCodeTo as regexFormatterPushCodeTo_172, stringGet as stringGet_180, stringNext as stringNext_181, regexFormatterAdjustCodeSet as regexFormatterAdjustCodeSet_195, listBuilderAdd as listBuilderAdd_304, listBuilderToList as listBuilderToList_305
3
3
  } from "@temperlang/core";
4
4
  export class RegexNode extends type__10() {
5
5
  /** @returns {Regex} */
@@ -41,6 +41,16 @@ export class Capture extends type__10(RegexNode) {
41
41
  #name_11;
42
42
  /** @type {RegexNode} */
43
43
  #item_12;
44
+ /**
45
+ * @param {{
46
+ * name: string, item: RegexNode
47
+ * }}
48
+ * props
49
+ * @returns {Capture}
50
+ */
51
+ static["new"](props) {
52
+ return new Capture(props.name, props.item);
53
+ }
44
54
  /**
45
55
  * @param {string} name_13
46
56
  * @param {RegexNode} item_14
@@ -85,6 +95,16 @@ export class CodeRange extends type__10(CodePart) {
85
95
  #min_20;
86
96
  /** @type {number} */
87
97
  #max_21;
98
+ /**
99
+ * @param {{
100
+ * min: number, max: number
101
+ * }}
102
+ * props
103
+ * @returns {CodeRange}
104
+ */
105
+ static["new"](props) {
106
+ return new CodeRange(props.min, props.max);
107
+ }
88
108
  /**
89
109
  * @param {number} min_22
90
110
  * @param {number} max_23
@@ -104,986 +124,1035 @@ export class CodeRange extends type__10(CodePart) {
104
124
  return this.#max_21;
105
125
  }
106
126
  };
107
- /** @template ITEM_27 */
108
- export class ItemizedRegex extends type__10(RegexNode) {
109
- };
110
- export class CodeSet extends type__10(ItemizedRegex) {
127
+ export class CodeSet extends type__10(RegexNode) {
111
128
  /** @type {Array<CodePart>} */
112
- #items_28;
129
+ #items_26;
113
130
  /** @type {boolean} */
114
- #negated_29;
131
+ #negated_27;
115
132
  /**
116
- * @param {Array<CodePart>} items_30
117
- * @param {boolean | null} [negated_31]
133
+ * @param {{
134
+ * items: Array<CodePart>, negated ?: boolean | null
135
+ * }}
136
+ * props
137
+ * @returns {CodeSet}
118
138
  */
119
- constructor(items_30, negated_31) {
139
+ static["new"](props) {
140
+ return new CodeSet(props.items, props.negated);
141
+ }
142
+ /**
143
+ * @param {Array<CodePart>} items_28
144
+ * @param {boolean | null} [negated_29]
145
+ */
146
+ constructor(items_28, negated_29) {
120
147
  super ();
121
- let negated_32;
122
- if (negated_31 == null) {
123
- negated_32 = false;
148
+ let negated_30;
149
+ if (negated_29 == null) {
150
+ negated_30 = false;
124
151
  } else {
125
- negated_32 = negated_31;
152
+ negated_30 = negated_29;
126
153
  }
127
- this.#items_28 = items_30;
128
- this.#negated_29 = negated_32;
154
+ this.#items_26 = items_28;
155
+ this.#negated_27 = negated_30;
129
156
  return;
130
157
  }
131
158
  /** @returns {Array<CodePart>} */
132
159
  get items() {
133
- return this.#items_28;
160
+ return this.#items_26;
134
161
  }
135
162
  /** @returns {boolean} */
136
163
  get negated() {
137
- return this.#negated_29;
164
+ return this.#negated_27;
138
165
  }
139
166
  };
140
- export class Or extends type__10(ItemizedRegex) {
167
+ export class Or extends type__10(RegexNode) {
141
168
  /** @type {Array<RegexNode>} */
142
- #items_35;
143
- /** @param {Array<RegexNode>} items_36 */
144
- constructor(items_36) {
169
+ #items_33;
170
+ /** @param {Array<RegexNode>} items_34 */
171
+ constructor(items_34) {
145
172
  super ();
146
- this.#items_35 = items_36;
173
+ this.#items_33 = items_34;
147
174
  return;
148
175
  }
149
176
  /** @returns {Array<RegexNode>} */
150
177
  get items() {
151
- return this.#items_35;
178
+ return this.#items_33;
152
179
  }
153
180
  };
154
181
  export class Repeat extends type__10(RegexNode) {
155
182
  /** @type {RegexNode} */
156
- #item_38;
183
+ #item_36;
157
184
  /** @type {number} */
158
- #min_39;
185
+ #min_37;
159
186
  /** @type {number | null} */
160
- #max_40;
187
+ #max_38;
161
188
  /** @type {boolean} */
162
- #reluctant_41;
189
+ #reluctant_39;
163
190
  /**
164
- * @param {RegexNode} item_42
165
- * @param {number} min_43
166
- * @param {number | null} max_44
167
- * @param {boolean | null} [reluctant_45]
191
+ * @param {{
192
+ * item: RegexNode, min: number, max: number | null, reluctant ?: boolean | null
193
+ * }}
194
+ * props
195
+ * @returns {Repeat}
168
196
  */
169
- constructor(item_42, min_43, max_44, reluctant_45) {
197
+ static["new"](props) {
198
+ return new Repeat(props.item, props.min, props.max, props.reluctant);
199
+ }
200
+ /**
201
+ * @param {RegexNode} item_40
202
+ * @param {number} min_41
203
+ * @param {number | null} max_42
204
+ * @param {boolean | null} [reluctant_43]
205
+ */
206
+ constructor(item_40, min_41, max_42, reluctant_43) {
170
207
  super ();
171
- let reluctant_46;
172
- if (reluctant_45 == null) {
173
- reluctant_46 = false;
208
+ let reluctant_44;
209
+ if (reluctant_43 == null) {
210
+ reluctant_44 = false;
174
211
  } else {
175
- reluctant_46 = reluctant_45;
212
+ reluctant_44 = reluctant_43;
176
213
  }
177
- this.#item_38 = item_42;
178
- this.#min_39 = min_43;
179
- this.#max_40 = max_44;
180
- this.#reluctant_41 = reluctant_46;
214
+ this.#item_36 = item_40;
215
+ this.#min_37 = min_41;
216
+ this.#max_38 = max_42;
217
+ this.#reluctant_39 = reluctant_44;
181
218
  return;
182
219
  }
183
220
  /** @returns {RegexNode} */
184
221
  get item() {
185
- return this.#item_38;
222
+ return this.#item_36;
186
223
  }
187
224
  /** @returns {number} */
188
225
  get min() {
189
- return this.#min_39;
226
+ return this.#min_37;
190
227
  }
191
228
  /** @returns {number | null} */
192
229
  get max() {
193
- return this.#max_40;
230
+ return this.#max_38;
194
231
  }
195
232
  /** @returns {boolean} */
196
233
  get reluctant() {
197
- return this.#reluctant_41;
234
+ return this.#reluctant_39;
198
235
  }
199
236
  };
200
- export class Sequence extends type__10(ItemizedRegex) {
237
+ export class Sequence extends type__10(RegexNode) {
201
238
  /** @type {Array<RegexNode>} */
202
- #items_51;
203
- /** @param {Array<RegexNode>} items_52 */
204
- constructor(items_52) {
239
+ #items_49;
240
+ /** @param {Array<RegexNode>} items_50 */
241
+ constructor(items_50) {
205
242
  super ();
206
- this.#items_51 = items_52;
243
+ this.#items_49 = items_50;
207
244
  return;
208
245
  }
209
246
  /** @returns {Array<RegexNode>} */
210
247
  get items() {
211
- return this.#items_51;
248
+ return this.#items_49;
212
249
  }
213
250
  };
214
251
  export class Match extends type__10() {
215
252
  /** @type {Group} */
216
- #full_54;
253
+ #full_52;
217
254
  /** @type {Map<string, Group>} */
218
- #groups_55;
255
+ #groups_53;
219
256
  /**
220
- * @param {Group} full_56
221
- * @param {Map<string, Group>} groups_57
257
+ * @param {{
258
+ * full: Group, groups: Map<string, Group>
259
+ * }}
260
+ * props
261
+ * @returns {Match}
222
262
  */
223
- constructor(full_56, groups_57) {
263
+ static["new"](props) {
264
+ return new Match(props.full, props.groups);
265
+ }
266
+ /**
267
+ * @param {Group} full_54
268
+ * @param {Map<string, Group>} groups_55
269
+ */
270
+ constructor(full_54, groups_55) {
224
271
  super ();
225
- this.#full_54 = full_56;
226
- this.#groups_55 = groups_57;
272
+ this.#full_52 = full_54;
273
+ this.#groups_53 = groups_55;
227
274
  return;
228
275
  }
229
276
  /** @returns {Group} */
230
277
  get full() {
231
- return this.#full_54;
278
+ return this.#full_52;
232
279
  }
233
280
  /** @returns {Map<string, Group>} */
234
281
  get groups() {
235
- return this.#groups_55;
282
+ return this.#groups_53;
236
283
  }
237
284
  };
238
285
  export class Group extends type__10() {
239
286
  /** @type {string} */
240
- #name_60;
287
+ #name_58;
241
288
  /** @type {string} */
242
- #value_61;
289
+ #value_59;
243
290
  /** @type {globalThis.number} */
244
- #begin_62;
291
+ #begin_60;
245
292
  /** @type {globalThis.number} */
246
- #end_63;
293
+ #end_61;
247
294
  /**
248
- * @param {string} name_64
249
- * @param {string} value_65
250
- * @param {globalThis.number} begin_66
251
- * @param {globalThis.number} end_67
295
+ * @param {{
296
+ * name: string, value: string, begin: globalThis.number, end: globalThis.number
297
+ * }}
298
+ * props
299
+ * @returns {Group}
252
300
  */
253
- constructor(name_64, value_65, begin_66, end_67) {
301
+ static["new"](props) {
302
+ return new Group(props.name, props.value, props.begin, props.end);
303
+ }
304
+ /**
305
+ * @param {string} name_62
306
+ * @param {string} value_63
307
+ * @param {globalThis.number} begin_64
308
+ * @param {globalThis.number} end_65
309
+ */
310
+ constructor(name_62, value_63, begin_64, end_65) {
254
311
  super ();
255
- this.#name_60 = name_64;
256
- this.#value_61 = value_65;
257
- this.#begin_62 = begin_66;
258
- this.#end_63 = end_67;
312
+ this.#name_58 = name_62;
313
+ this.#value_59 = value_63;
314
+ this.#begin_60 = begin_64;
315
+ this.#end_61 = end_65;
259
316
  return;
260
317
  }
261
318
  /** @returns {string} */
262
319
  get name() {
263
- return this.#name_60;
320
+ return this.#name_58;
264
321
  }
265
322
  /** @returns {string} */
266
323
  get value() {
267
- return this.#value_61;
324
+ return this.#value_59;
268
325
  }
269
326
  /** @returns {globalThis.number} */
270
327
  get begin() {
271
- return this.#begin_62;
328
+ return this.#begin_60;
272
329
  }
273
330
  /** @returns {globalThis.number} */
274
331
  get end() {
275
- return this.#end_63;
332
+ return this.#end_61;
276
333
  }
277
334
  };
278
- class RegexRefs_72 extends type__10() {
335
+ class RegexRefs_70 extends type__10() {
279
336
  /** @type {CodePoints} */
280
- #codePoints_73;
337
+ #codePoints_71;
281
338
  /** @type {Group} */
282
- #group_74;
339
+ #group_72;
283
340
  /** @type {Match} */
284
- #match_75;
341
+ #match_73;
285
342
  /** @type {Or} */
286
- #orObject_76;
343
+ #orObject_74;
287
344
  /**
288
- * @param {CodePoints | null} [codePoints_77]
289
- * @param {Group | null} [group_78]
290
- * @param {Match | null} [match_79]
291
- * @param {Or | null} [orObject_80]
345
+ * @param {{
346
+ * codePoints ?: CodePoints | null, group ?: Group | null, match ?: Match | null, orObject ?: Or | null
347
+ * }}
348
+ * props
349
+ * @returns {RegexRefs_70}
292
350
  */
293
- constructor(codePoints_77, group_78, match_79, orObject_80) {
351
+ static["new"](props) {
352
+ return new RegexRefs_70(props.codePoints, props.group, props.match, props.orObject);
353
+ }
354
+ /**
355
+ * @param {CodePoints | null} [codePoints_75]
356
+ * @param {Group | null} [group_76]
357
+ * @param {Match | null} [match_77]
358
+ * @param {Or | null} [orObject_78]
359
+ */
360
+ constructor(codePoints_75, group_76, match_77, orObject_78) {
294
361
  super ();
362
+ let t_79;
363
+ let t_80;
295
364
  let t_81;
296
365
  let t_82;
297
366
  let t_83;
298
- let t_84;
299
- let t_85;
300
- let codePoints_86;
301
- if (codePoints_77 == null) {
302
- t_81 = new CodePoints("");
303
- codePoints_86 = t_81;
367
+ let codePoints_84;
368
+ if (codePoints_75 == null) {
369
+ t_79 = new CodePoints("");
370
+ codePoints_84 = t_79;
304
371
  } else {
305
- codePoints_86 = codePoints_77;
372
+ codePoints_84 = codePoints_75;
306
373
  }
307
- let group_87;
308
- if (group_78 == null) {
309
- t_82 = new Group("", "", 0, 0);
310
- group_87 = t_82;
374
+ let group_85;
375
+ if (group_76 == null) {
376
+ t_80 = new Group("", "", 0, 0);
377
+ group_85 = t_80;
311
378
  } else {
312
- group_87 = group_78;
379
+ group_85 = group_76;
313
380
  }
314
- let match_88;
315
- if (match_79 == null) {
316
- t_83 = mapConstructor_89(Object.freeze([pairConstructor_90("", group_87)]));
317
- t_84 = new Match(group_87, t_83);
318
- match_88 = t_84;
381
+ let match_86;
382
+ if (match_77 == null) {
383
+ t_81 = mapConstructor_87(Object.freeze([pairConstructor_88("", group_85)]));
384
+ t_82 = new Match(group_85, t_81);
385
+ match_86 = t_82;
319
386
  } else {
320
- match_88 = match_79;
387
+ match_86 = match_77;
321
388
  }
322
- let orObject_91;
323
- if (orObject_80 == null) {
324
- t_85 = new Or(Object.freeze([]));
325
- orObject_91 = t_85;
389
+ let orObject_89;
390
+ if (orObject_78 == null) {
391
+ t_83 = new Or(Object.freeze([]));
392
+ orObject_89 = t_83;
326
393
  } else {
327
- orObject_91 = orObject_80;
394
+ orObject_89 = orObject_78;
328
395
  }
329
- this.#codePoints_73 = codePoints_86;
330
- this.#group_74 = group_87;
331
- this.#match_75 = match_88;
332
- this.#orObject_76 = orObject_91;
396
+ this.#codePoints_71 = codePoints_84;
397
+ this.#group_72 = group_85;
398
+ this.#match_73 = match_86;
399
+ this.#orObject_74 = orObject_89;
333
400
  return;
334
401
  }
335
402
  /** @returns {CodePoints} */
336
403
  get codePoints() {
337
- return this.#codePoints_73;
404
+ return this.#codePoints_71;
338
405
  }
339
406
  /** @returns {Group} */
340
407
  get group() {
341
- return this.#group_74;
408
+ return this.#group_72;
342
409
  }
343
410
  /** @returns {Match} */
344
411
  get match() {
345
- return this.#match_75;
412
+ return this.#match_73;
346
413
  }
347
414
  /** @returns {Or} */
348
415
  get orObject() {
349
- return this.#orObject_76;
416
+ return this.#orObject_74;
350
417
  }
351
418
  }
352
419
  export class Regex extends type__10() {
353
420
  /** @type {RegexNode} */
354
- #data_96;
355
- /** @param {RegexNode} data_97 */
356
- constructor(data_97) {
421
+ #data_94;
422
+ /** @param {RegexNode} data_95 */
423
+ constructor(data_95) {
357
424
  super ();
358
- this.#data_96 = data_97;
359
- let t_98 = this.#format_99();
360
- let t_100 = regexCompileFormatted_101(this, t_98);
361
- this.#compiled_102 = t_100;
425
+ const t_96 = data_95;
426
+ this.#data_94 = t_96;
427
+ const formatted_97 = RegexFormatter_98.regexFormat(data_95);
428
+ let t_99 = regexCompileFormatted_100(data_95, formatted_97);
429
+ this.#compiled_101 = t_99;
362
430
  return;
363
431
  }
364
432
  /**
365
- * @param {string} text_104
433
+ * @param {string} text_103
366
434
  * @returns {boolean}
367
435
  */
368
- found(text_104) {
369
- return regexCompiledFound_105(this, this.#compiled_102, text_104);
436
+ found(text_103) {
437
+ return regexCompiledFound_104(this, this.#compiled_101, text_103);
370
438
  }
371
439
  /**
372
- * @param {string} text_107
373
- * @param {globalThis.number | null} [begin_108]
440
+ * @param {string} text_106
441
+ * @param {globalThis.number | null} [begin_107]
374
442
  * @returns {Match}
375
443
  */
376
- find(text_107, begin_108) {
377
- let begin_109;
378
- if (begin_108 == null) {
379
- begin_109 = 0;
444
+ find(text_106, begin_107) {
445
+ let begin_108;
446
+ if (begin_107 == null) {
447
+ begin_108 = 0;
380
448
  } else {
381
- begin_109 = begin_108;
449
+ begin_108 = begin_107;
382
450
  }
383
- return regexCompiledFind_110(this, this.#compiled_102, text_107, begin_109, regexRefs_111);
451
+ return regexCompiledFind_109(this, this.#compiled_101, text_106, begin_108, regexRefs_110);
384
452
  }
385
453
  /**
386
- * @param {string} text_113
387
- * @param {(arg0: Match) => string} format_114
454
+ * @param {string} text_112
455
+ * @param {(arg0: Match) => string} format_113
388
456
  * @returns {string}
389
457
  */
390
- replace(text_113, format_114) {
391
- return regexCompiledReplace_115(this, this.#compiled_102, text_113, format_114, regexRefs_111);
458
+ replace(text_112, format_113) {
459
+ return regexCompiledReplace_114(this, this.#compiled_101, text_112, format_113, regexRefs_110);
392
460
  }
393
461
  /**
394
- * @param {string} text_117
462
+ * @param {string} text_116
395
463
  * @returns {Array<string>}
396
464
  */
397
- split(text_117) {
398
- return regexCompiledSplit_118(this, this.#compiled_102, text_117, regexRefs_111);
465
+ split(text_116) {
466
+ return regexCompiledSplit_117(this, this.#compiled_101, text_116, regexRefs_110);
399
467
  }
400
468
  /** @type {unknown} */
401
- #compiled_102;
402
- /** @returns {string} */
403
- #format_99() {
404
- return new RegexFormatter_120().format(this.#data_96);
405
- }
469
+ #compiled_101;
406
470
  /** @returns {RegexNode} */
407
471
  get data() {
408
- return this.#data_96;
472
+ return this.#data_94;
409
473
  }
410
474
  };
411
- class RegexFormatter_120 extends type__10() {
412
- /** @type {Array<string>} */
413
- #out_122;
475
+ class RegexFormatter_98 extends type__10() {
476
+ /** @type {globalThis.Array<string>} */
477
+ #out_119;
414
478
  /**
415
- * @param {RegexNode} regex_124
479
+ * @param {RegexNode} data_121
416
480
  * @returns {string}
417
481
  */
418
- format(regex_124) {
419
- this.#pushRegex_125(regex_124);
420
- function fn_126(x_127) {
421
- return x_127;
422
- }
423
- return listedJoin_128(this.#out_122, "", fn_126);
482
+ static regexFormat(data_121) {
483
+ return new RegexFormatter_98().format(data_121);
424
484
  }
425
- /** @param {RegexNode} regex_130 */
426
- #pushRegex_125(regex_130) {
485
+ /**
486
+ * @param {RegexNode} regex_123
487
+ * @returns {string}
488
+ */
489
+ format(regex_123) {
490
+ this.#pushRegex_124(regex_123);
491
+ return this.#out_119[0];
492
+ }
493
+ /** @param {RegexNode} regex_126 */
494
+ #pushRegex_124(regex_126) {
495
+ let t_127;
496
+ let t_128;
497
+ let t_129;
498
+ let t_130;
427
499
  let t_131;
428
500
  let t_132;
429
501
  let t_133;
430
- let t_134;
431
- let t_135;
432
- let t_136;
433
- let t_137;
434
- if (regex_130 instanceof Capture) {
435
- t_131 = requireInstanceOf__138(regex_130, Capture);
436
- this.#pushCapture_139(t_131);
437
- } else if (regex_130 instanceof CodePoints) {
438
- t_132 = requireInstanceOf__138(regex_130, CodePoints);
439
- this.#pushCodePoints_140(t_132, false);
440
- } else if (regex_130 instanceof CodeRange) {
441
- t_133 = requireInstanceOf__138(regex_130, CodeRange);
442
- this.#pushCodeRange_141(t_133);
443
- } else if (regex_130 instanceof CodeSet) {
444
- t_134 = requireInstanceOf__138(regex_130, CodeSet);
445
- this.#pushCodeSet_142(t_134);
446
- } else if (regex_130 instanceof Or) {
447
- t_135 = requireInstanceOf__138(regex_130, Or);
448
- this.#pushOr_143(t_135);
449
- } else if (regex_130 instanceof Repeat) {
450
- t_136 = requireInstanceOf__138(regex_130, Repeat);
451
- this.#pushRepeat_144(t_136);
452
- } else if (regex_130 instanceof Sequence) {
453
- t_137 = requireInstanceOf__138(regex_130, Sequence);
454
- this.#pushSequence_145(t_137);
455
- } else if (Object.is(regex_130, Begin)) {
456
- listBuilderAdd_146(this.#out_122, "^");
457
- } else if (Object.is(regex_130, Dot)) {
458
- listBuilderAdd_146(this.#out_122, ".");
459
- } else if (Object.is(regex_130, End)) {
460
- listBuilderAdd_146(this.#out_122, "\u0024");
461
- } else if (Object.is(regex_130, WordBoundary)) {
462
- listBuilderAdd_146(this.#out_122, "\\b");
463
- } else if (Object.is(regex_130, Digit)) {
464
- listBuilderAdd_146(this.#out_122, "\\d");
465
- } else if (Object.is(regex_130, Space)) {
466
- listBuilderAdd_146(this.#out_122, "\\s");
467
- } else if (Object.is(regex_130, Word)) {
468
- listBuilderAdd_146(this.#out_122, "\\w");
502
+ if (regex_126 instanceof Capture) {
503
+ t_127 = requireInstanceOf__134(regex_126, Capture);
504
+ this.#pushCapture_135(t_127);
505
+ } else if (regex_126 instanceof CodePoints) {
506
+ t_128 = requireInstanceOf__134(regex_126, CodePoints);
507
+ this.#pushCodePoints_136(t_128, false);
508
+ } else if (regex_126 instanceof CodeRange) {
509
+ t_129 = requireInstanceOf__134(regex_126, CodeRange);
510
+ this.#pushCodeRange_137(t_129);
511
+ } else if (regex_126 instanceof CodeSet) {
512
+ t_130 = requireInstanceOf__134(regex_126, CodeSet);
513
+ this.#pushCodeSet_138(t_130);
514
+ } else if (regex_126 instanceof Or) {
515
+ t_131 = requireInstanceOf__134(regex_126, Or);
516
+ this.#pushOr_139(t_131);
517
+ } else if (regex_126 instanceof Repeat) {
518
+ t_132 = requireInstanceOf__134(regex_126, Repeat);
519
+ this.#pushRepeat_140(t_132);
520
+ } else if (regex_126 instanceof Sequence) {
521
+ t_133 = requireInstanceOf__134(regex_126, Sequence);
522
+ this.#pushSequence_141(t_133);
523
+ } else if (Object.is(regex_126, Begin)) {
524
+ this.#out_119[0] += "^";
525
+ } else if (Object.is(regex_126, Dot)) {
526
+ this.#out_119[0] += ".";
527
+ } else if (Object.is(regex_126, End)) {
528
+ this.#out_119[0] += "\u0024";
529
+ } else if (Object.is(regex_126, WordBoundary)) {
530
+ this.#out_119[0] += "\\b";
531
+ } else if (Object.is(regex_126, Digit)) {
532
+ this.#out_119[0] += "\\d";
533
+ } else if (Object.is(regex_126, Space)) {
534
+ this.#out_119[0] += "\\s";
535
+ } else if (Object.is(regex_126, Word)) {
536
+ this.#out_119[0] += "\\w";
469
537
  }
470
538
  return;
471
539
  }
472
- /** @param {Capture} capture_148 */
473
- #pushCapture_139(capture_148) {
474
- listBuilderAdd_146(this.#out_122, "(");
475
- let t_149 = this.#out_122;
476
- let t_150 = capture_148.name;
477
- this.#pushCaptureName_151(t_149, t_150);
478
- let t_152 = capture_148.item;
479
- this.#pushRegex_125(t_152);
480
- listBuilderAdd_146(this.#out_122, ")");
540
+ /** @param {Capture} capture_143 */
541
+ #pushCapture_135(capture_143) {
542
+ this.#out_119[0] += "(";
543
+ let t_144 = this.#out_119;
544
+ let t_145 = capture_143.name;
545
+ this.#pushCaptureName_146(t_144, t_145);
546
+ let t_147 = capture_143.item;
547
+ this.#pushRegex_124(t_147);
548
+ this.#out_119[0] += ")";
481
549
  return;
482
550
  }
483
551
  /**
484
- * @param {Array<string>} out_154
485
- * @param {string} name_155
552
+ * @param {globalThis.Array<string>} out_149
553
+ * @param {string} name_150
486
554
  */
487
- #pushCaptureName_151(out_154, name_155) {
488
- listBuilderAdd_146(out_154, "?\u003c" + name_155 + "\u003e");
555
+ #pushCaptureName_146(out_149, name_150) {
556
+ out_149[0] += "?\u003c" + name_150 + "\u003e";
489
557
  return;
490
558
  }
491
559
  /**
492
- * @param {number} code_158
493
- * @param {boolean} insideCodeSet_159
560
+ * @param {number} code_153
561
+ * @param {boolean} insideCodeSet_154
494
562
  */
495
- #pushCode_157(code_158, insideCodeSet_159) {
496
- let return_160;
563
+ #pushCode_152(code_153, insideCodeSet_154) {
564
+ let return_155;
565
+ let t_156;
566
+ let t_157;
567
+ let t_158;
568
+ let t_159;
569
+ let t_160;
497
570
  let t_161;
498
571
  let t_162;
499
572
  let t_163;
500
573
  let t_164;
501
- let t_165;
502
- let t_166;
503
- let t_167;
504
- let t_168;
505
- let t_169;
506
- fn_170: {
507
- let specialEscape_171;
508
- if (code_158 === Codes_172.carriageReturn) {
509
- specialEscape_171 = "r";
510
- } else if (code_158 === Codes_172.newline) {
511
- specialEscape_171 = "n";
512
- } else if (code_158 === Codes_172.tab) {
513
- specialEscape_171 = "t";
514
- } else {
515
- specialEscape_171 = "";
516
- }
517
- if (specialEscape_171 !== "") {
518
- listBuilderAdd_146(this.#out_122, "\\");
519
- listBuilderAdd_146(this.#out_122, specialEscape_171);
520
- return_160 = void 0;
521
- break fn_170;
522
- }
523
- if (code_158 <= 127) {
524
- let escapeNeed_173;
525
- escapeNeed_173 = listedGet_174(escapeNeeds_175, code_158);
526
- if (escapeNeed_173 === 2) {
527
- t_162 = true;
574
+ fn_165: {
575
+ try {
576
+ let specialEscape_166;
577
+ if (code_153 === Codes_167.carriageReturn) {
578
+ specialEscape_166 = "r";
579
+ } else if (code_153 === Codes_167.newline) {
580
+ specialEscape_166 = "n";
581
+ } else if (code_153 === Codes_167.tab) {
582
+ specialEscape_166 = "t";
528
583
  } else {
529
- if (insideCodeSet_159) {
530
- t_161 = code_158 === Codes_172.dash;
531
- } else {
532
- t_161 = false;
533
- }
534
- t_162 = t_161;
584
+ specialEscape_166 = "";
535
585
  }
536
- if (t_162) {
537
- listBuilderAdd_146(this.#out_122, "\\");
538
- t_163 = String.fromCodePoint(code_158);
539
- listBuilderAdd_146(this.#out_122, t_163);
540
- return_160 = void 0;
541
- break fn_170;
542
- } else if (escapeNeed_173 === 0) {
543
- t_164 = String.fromCodePoint(code_158);
544
- listBuilderAdd_146(this.#out_122, t_164);
545
- return_160 = void 0;
546
- break fn_170;
586
+ if (specialEscape_166 !== "") {
587
+ this.#out_119[0] += "\\";
588
+ this.#out_119[0] += specialEscape_166;
589
+ return_155 = void 0;
590
+ break fn_165;
547
591
  }
548
- }
549
- if (code_158 >= Codes_172.supplementalMin) {
550
- t_168 = true;
551
- } else {
552
- if (code_158 > Codes_172.highControlMax) {
553
- if (Codes_172.surrogateMin <= code_158) {
554
- t_165 = code_158 <= Codes_172.surrogateMax;
592
+ if (code_153 <= 127) {
593
+ const escapeNeed_168 = listedGet_169(escapeNeeds_170, code_153);
594
+ if (escapeNeed_168 === 2) {
595
+ t_157 = true;
555
596
  } else {
556
- t_165 = false;
597
+ if (insideCodeSet_154) {
598
+ t_156 = code_153 === Codes_167.dash;
599
+ } else {
600
+ t_156 = false;
601
+ }
602
+ t_157 = t_156;
557
603
  }
558
- if (t_165) {
559
- t_166 = true;
604
+ if (t_157) {
605
+ this.#out_119[0] += "\\";
606
+ t_158 = stringFromCodePoint_171(code_153);
607
+ this.#out_119[0] += t_158;
608
+ return_155 = void 0;
609
+ break fn_165;
610
+ } else if (escapeNeed_168 === 0) {
611
+ t_159 = stringFromCodePoint_171(code_153);
612
+ this.#out_119[0] += t_159;
613
+ return_155 = void 0;
614
+ break fn_165;
615
+ }
616
+ }
617
+ if (code_153 >= Codes_167.supplementalMin) {
618
+ t_163 = true;
619
+ } else {
620
+ if (code_153 > Codes_167.highControlMax) {
621
+ if (Codes_167.surrogateMin <= code_153) {
622
+ t_160 = code_153 <= Codes_167.surrogateMax;
623
+ } else {
624
+ t_160 = false;
625
+ }
626
+ if (t_160) {
627
+ t_161 = true;
628
+ } else {
629
+ t_161 = code_153 === Codes_167.uint16Max;
630
+ }
631
+ t_162 = ! t_161;
560
632
  } else {
561
- t_166 = code_158 === Codes_172.uint16Max;
633
+ t_162 = false;
562
634
  }
563
- t_167 = ! t_166;
635
+ t_163 = t_162;
636
+ }
637
+ if (t_163) {
638
+ t_164 = stringFromCodePoint_171(code_153);
639
+ this.#out_119[0] += t_164;
564
640
  } else {
565
- t_167 = false;
641
+ regexFormatterPushCodeTo_172(this, this.#out_119, code_153, insideCodeSet_154);
566
642
  }
567
- t_168 = t_167;
568
- }
569
- if (t_168) {
570
- t_169 = String.fromCodePoint(code_158);
571
- listBuilderAdd_146(this.#out_122, t_169);
572
- } else {
573
- regexFormatterPushCodeTo_176(this, this.#out_122, code_158, insideCodeSet_159);
643
+ } catch {
644
+ throw Error();
574
645
  }
575
- return_160 = void 0;
646
+ return_155 = void 0;
576
647
  }
577
- return return_160;
648
+ return return_155;
578
649
  }
579
650
  /**
580
- * @param {CodePoints} codePoints_178
581
- * @param {boolean} insideCodeSet_179
651
+ * @param {CodePoints} codePoints_174
652
+ * @param {boolean} insideCodeSet_175
582
653
  */
583
- #pushCodePoints_140(codePoints_178, insideCodeSet_179) {
584
- let t_180;
585
- let t_181;
586
- const value_182 = codePoints_178.value;
587
- let index_183 = 0;
654
+ #pushCodePoints_136(codePoints_174, insideCodeSet_175) {
655
+ let t_176;
656
+ let t_177;
657
+ const value_178 = codePoints_174.value;
658
+ let index_179 = 0;
588
659
  while (true) {
589
- if (!(value_182.length > index_183)) {
660
+ if (!(value_178.length > index_179)) {
590
661
  break;
591
662
  }
592
- t_181 = stringGet_184(value_182, index_183);
593
- this.#pushCode_157(t_181, insideCodeSet_179);
594
- t_180 = stringNext_185(value_182, index_183);
595
- index_183 = t_180;
663
+ t_176 = stringGet_180(value_178, index_179);
664
+ this.#pushCode_152(t_176, insideCodeSet_175);
665
+ t_177 = stringNext_181(value_178, index_179);
666
+ index_179 = t_177;
596
667
  }
597
668
  return;
598
669
  }
599
- /** @param {CodeRange} codeRange_187 */
600
- #pushCodeRange_141(codeRange_187) {
601
- listBuilderAdd_146(this.#out_122, "[");
602
- this.#pushCodeRangeUnwrapped_188(codeRange_187);
603
- listBuilderAdd_146(this.#out_122, "]");
670
+ /** @param {CodeRange} codeRange_183 */
671
+ #pushCodeRange_137(codeRange_183) {
672
+ this.#out_119[0] += "[";
673
+ this.#pushCodeRangeUnwrapped_184(codeRange_183);
674
+ this.#out_119[0] += "]";
604
675
  return;
605
676
  }
606
- /** @param {CodeRange} codeRange_190 */
607
- #pushCodeRangeUnwrapped_188(codeRange_190) {
608
- let t_191 = codeRange_190.min;
609
- this.#pushCode_157(t_191, true);
610
- listBuilderAdd_146(this.#out_122, "-");
611
- let t_192 = codeRange_190.max;
612
- this.#pushCode_157(t_192, true);
677
+ /** @param {CodeRange} codeRange_186 */
678
+ #pushCodeRangeUnwrapped_184(codeRange_186) {
679
+ let t_187 = codeRange_186.min;
680
+ this.#pushCode_152(t_187, true);
681
+ this.#out_119[0] += "-";
682
+ let t_188 = codeRange_186.max;
683
+ this.#pushCode_152(t_188, true);
613
684
  return;
614
685
  }
615
- /** @param {CodeSet} codeSet_194 */
616
- #pushCodeSet_142(codeSet_194) {
617
- let t_195;
618
- let t_196;
619
- let t_197;
620
- const adjusted_198 = regexFormatterAdjustCodeSet_199(this, codeSet_194, regexRefs_111);
621
- if (adjusted_198 instanceof CodeSet) {
622
- t_196 = requireInstanceOf__138(adjusted_198, CodeSet);
623
- listBuilderAdd_146(this.#out_122, "[");
624
- if (t_196.negated) {
625
- listBuilderAdd_146(this.#out_122, "^");
686
+ /** @param {CodeSet} codeSet_190 */
687
+ #pushCodeSet_138(codeSet_190) {
688
+ let t_191;
689
+ let t_192;
690
+ let t_193;
691
+ const adjusted_194 = regexFormatterAdjustCodeSet_195(this, codeSet_190, regexRefs_110);
692
+ if (adjusted_194 instanceof CodeSet) {
693
+ t_193 = requireInstanceOf__134(adjusted_194, CodeSet);
694
+ this.#out_119[0] += "[";
695
+ if (t_193.negated) {
696
+ this.#out_119[0] += "^";
626
697
  }
627
- let i_200 = 0;
698
+ let i_196 = 0;
628
699
  while (true) {
629
- t_195 = t_196.items.length;
630
- if (!(i_200 < t_195)) {
700
+ t_191 = t_193.items.length;
701
+ if (!(i_196 < t_191)) {
631
702
  break;
632
703
  }
633
- t_197 = listedGet_174(t_196.items, i_200);
634
- this.#pushCodeSetItem_201(t_197);
635
- i_200 = i_200 + 1;
704
+ t_192 = listedGet_169(t_193.items, i_196);
705
+ this.#pushCodeSetItem_197(t_192);
706
+ i_196 = i_196 + 1;
636
707
  }
637
- listBuilderAdd_146(this.#out_122, "]");
708
+ this.#out_119[0] += "]";
638
709
  } else {
639
- this.#pushRegex_125(adjusted_198);
710
+ this.#pushRegex_124(adjusted_194);
640
711
  }
641
712
  return;
642
713
  }
643
- /** @param {CodePart} codePart_203 */
644
- #pushCodeSetItem_201(codePart_203) {
645
- let t_204;
646
- let t_205;
647
- let t_206;
648
- if (codePart_203 instanceof CodePoints) {
649
- t_204 = requireInstanceOf__138(codePart_203, CodePoints);
650
- this.#pushCodePoints_140(t_204, true);
651
- } else if (codePart_203 instanceof CodeRange) {
652
- t_205 = requireInstanceOf__138(codePart_203, CodeRange);
653
- this.#pushCodeRangeUnwrapped_188(t_205);
654
- } else if (codePart_203 instanceof SpecialSet) {
655
- t_206 = requireInstanceOf__138(codePart_203, SpecialSet);
656
- this.#pushRegex_125(t_206);
714
+ /** @param {CodePart} codePart_199 */
715
+ #pushCodeSetItem_197(codePart_199) {
716
+ let t_200;
717
+ let t_201;
718
+ let t_202;
719
+ if (codePart_199 instanceof CodePoints) {
720
+ t_200 = requireInstanceOf__134(codePart_199, CodePoints);
721
+ this.#pushCodePoints_136(t_200, true);
722
+ } else if (codePart_199 instanceof CodeRange) {
723
+ t_201 = requireInstanceOf__134(codePart_199, CodeRange);
724
+ this.#pushCodeRangeUnwrapped_184(t_201);
725
+ } else if (codePart_199 instanceof SpecialSet) {
726
+ t_202 = requireInstanceOf__134(codePart_199, SpecialSet);
727
+ this.#pushRegex_124(t_202);
657
728
  }
658
729
  return;
659
730
  }
660
- /** @param {Or} or_208 */
661
- #pushOr_143(or_208) {
662
- let t_209;
663
- let t_210;
664
- let t_211;
665
- if (! ! or_208.items.length) {
666
- listBuilderAdd_146(this.#out_122, "(?:");
667
- t_210 = listedGet_174(or_208.items, 0);
668
- this.#pushRegex_125(t_210);
669
- let i_212 = 1;
731
+ /** @param {Or} or_204 */
732
+ #pushOr_139(or_204) {
733
+ let t_205;
734
+ let t_206;
735
+ let t_207;
736
+ if (! ! or_204.items.length) {
737
+ this.#out_119[0] += "(?:";
738
+ t_205 = listedGet_169(or_204.items, 0);
739
+ this.#pushRegex_124(t_205);
740
+ let i_208 = 1;
670
741
  while (true) {
671
- t_209 = or_208.items.length;
672
- if (!(i_212 < t_209)) {
742
+ t_206 = or_204.items.length;
743
+ if (!(i_208 < t_206)) {
673
744
  break;
674
745
  }
675
- listBuilderAdd_146(this.#out_122, "|");
676
- t_211 = listedGet_174(or_208.items, i_212);
677
- this.#pushRegex_125(t_211);
678
- i_212 = i_212 + 1;
746
+ this.#out_119[0] += "|";
747
+ t_207 = listedGet_169(or_204.items, i_208);
748
+ this.#pushRegex_124(t_207);
749
+ i_208 = i_208 + 1;
679
750
  }
680
- listBuilderAdd_146(this.#out_122, ")");
751
+ this.#out_119[0] += ")";
681
752
  }
682
753
  return;
683
754
  }
684
- /** @param {Repeat} repeat_214 */
685
- #pushRepeat_144(repeat_214) {
755
+ /** @param {Repeat} repeat_210 */
756
+ #pushRepeat_140(repeat_210) {
757
+ let t_211;
758
+ let t_212;
759
+ let t_213;
760
+ let t_214;
686
761
  let t_215;
687
- let t_216;
688
- let t_217;
689
- let t_218;
690
- let t_219;
691
- listBuilderAdd_146(this.#out_122, "(?:");
692
- let t_220 = repeat_214.item;
693
- this.#pushRegex_125(t_220);
694
- listBuilderAdd_146(this.#out_122, ")");
695
- const min_221 = repeat_214.min;
696
- let max_222;
697
- max_222 = repeat_214.max;
698
- if (min_221 === 0) {
699
- t_217 = max_222 === 1;
762
+ this.#out_119[0] += "(?:";
763
+ let t_216 = repeat_210.item;
764
+ this.#pushRegex_124(t_216);
765
+ this.#out_119[0] += ")";
766
+ const min_217 = repeat_210.min;
767
+ const max_218 = repeat_210.max;
768
+ if (min_217 === 0) {
769
+ t_213 = max_218 === 1;
700
770
  } else {
701
- t_217 = false;
771
+ t_213 = false;
702
772
  }
703
- if (t_217) {
704
- listBuilderAdd_146(this.#out_122, "?");
773
+ if (t_213) {
774
+ this.#out_119[0] += "?";
705
775
  } else {
706
- if (min_221 === 0) {
707
- t_218 = max_222 == null;
776
+ if (min_217 === 0) {
777
+ t_214 = max_218 == null;
708
778
  } else {
709
- t_218 = false;
779
+ t_214 = false;
710
780
  }
711
- if (t_218) {
712
- listBuilderAdd_146(this.#out_122, "*");
781
+ if (t_214) {
782
+ this.#out_119[0] += "*";
713
783
  } else {
714
- if (min_221 === 1) {
715
- t_219 = max_222 == null;
784
+ if (min_217 === 1) {
785
+ t_215 = max_218 == null;
716
786
  } else {
717
- t_219 = false;
787
+ t_215 = false;
718
788
  }
719
- if (t_219) {
720
- listBuilderAdd_146(this.#out_122, "+");
789
+ if (t_215) {
790
+ this.#out_119[0] += "+";
721
791
  } else {
722
- t_215 = min_221.toString();
723
- listBuilderAdd_146(this.#out_122, "{" + t_215);
724
- if (min_221 !== max_222) {
725
- listBuilderAdd_146(this.#out_122, ",");
726
- if (!(max_222 == null)) {
727
- t_216 = max_222.toString();
728
- listBuilderAdd_146(this.#out_122, t_216);
792
+ t_211 = min_217.toString();
793
+ this.#out_119[0] += "{" + t_211;
794
+ if (min_217 !== max_218) {
795
+ this.#out_119[0] += ",";
796
+ if (!(max_218 == null)) {
797
+ t_212 = max_218.toString();
798
+ this.#out_119[0] += t_212;
729
799
  }
730
800
  }
731
- listBuilderAdd_146(this.#out_122, "}");
801
+ this.#out_119[0] += "}";
732
802
  }
733
803
  }
734
804
  }
735
- if (repeat_214.reluctant) {
736
- listBuilderAdd_146(this.#out_122, "?");
805
+ if (repeat_210.reluctant) {
806
+ this.#out_119[0] += "?";
737
807
  }
738
808
  return;
739
809
  }
740
- /** @param {Sequence} sequence_224 */
741
- #pushSequence_145(sequence_224) {
742
- let t_225;
743
- let t_226;
744
- let i_227 = 0;
810
+ /** @param {Sequence} sequence_220 */
811
+ #pushSequence_141(sequence_220) {
812
+ let t_221;
813
+ let t_222;
814
+ let i_223 = 0;
745
815
  while (true) {
746
- t_225 = sequence_224.items.length;
747
- if (!(i_227 < t_225)) {
816
+ t_221 = sequence_220.items.length;
817
+ if (!(i_223 < t_221)) {
748
818
  break;
749
819
  }
750
- t_226 = listedGet_174(sequence_224.items, i_227);
751
- this.#pushRegex_125(t_226);
752
- i_227 = i_227 + 1;
820
+ t_222 = listedGet_169(sequence_220.items, i_223);
821
+ this.#pushRegex_124(t_222);
822
+ i_223 = i_223 + 1;
753
823
  }
754
824
  return;
755
825
  }
756
826
  /**
757
- * @param {CodePart} codePart_229
827
+ * @param {CodePart} codePart_225
758
828
  * @returns {number | null}
759
829
  */
760
- maxCode(codePart_229) {
761
- let return_230;
762
- let t_231;
763
- let t_232;
764
- let t_233;
765
- let t_234;
766
- let t_235;
767
- if (codePart_229 instanceof CodePoints) {
768
- t_233 = requireInstanceOf__138(codePart_229, CodePoints);
769
- const value_236 = t_233.value;
770
- if (! value_236) {
771
- return_230 = null;
830
+ maxCode(codePart_225) {
831
+ let return_226;
832
+ let t_227;
833
+ let t_228;
834
+ if (codePart_225 instanceof CodePoints) {
835
+ t_228 = requireInstanceOf__134(codePart_225, CodePoints);
836
+ const value_229 = t_228.value;
837
+ if (! value_229) {
838
+ return_226 = null;
772
839
  } else {
773
- let max_237 = 0;
774
- let index_238 = 0;
840
+ let max_230 = 0;
841
+ let index_231 = 0;
775
842
  while (true) {
776
- if (!(value_236.length > index_238)) {
843
+ if (!(value_229.length > index_231)) {
777
844
  break;
778
845
  }
779
- t_234 = stringGet_184(value_236, index_238);
780
- const next_239 = t_234;
781
- if (next_239 > max_237) {
782
- max_237 = next_239;
846
+ const next_232 = stringGet_180(value_229, index_231);
847
+ if (next_232 > max_230) {
848
+ max_230 = next_232;
783
849
  }
784
- t_231 = stringNext_185(value_236, index_238);
785
- index_238 = t_231;
850
+ t_227 = stringNext_181(value_229, index_231);
851
+ index_231 = t_227;
786
852
  }
787
- return_230 = max_237;
853
+ return_226 = max_230;
788
854
  }
789
- } else if (codePart_229 instanceof CodeRange) {
790
- t_235 = requireInstanceOf__138(codePart_229, CodeRange);
791
- t_232 = t_235.max;
792
- return_230 = t_232;
793
- } else if (Object.is(codePart_229, Digit)) {
794
- return_230 = Codes_172.digit9;
795
- } else if (Object.is(codePart_229, Space)) {
796
- return_230 = Codes_172.space;
797
- } else if (Object.is(codePart_229, Word)) {
798
- return_230 = Codes_172.lowerZ;
855
+ } else if (codePart_225 instanceof CodeRange) {
856
+ return_226 = requireInstanceOf__134(codePart_225, CodeRange).max;
857
+ } else if (Object.is(codePart_225, Digit)) {
858
+ return_226 = Codes_167.digit9;
859
+ } else if (Object.is(codePart_225, Space)) {
860
+ return_226 = Codes_167.space;
861
+ } else if (Object.is(codePart_225, Word)) {
862
+ return_226 = Codes_167.lowerZ;
799
863
  } else {
800
- return_230 = null;
864
+ return_226 = null;
801
865
  }
802
- return return_230;
866
+ return return_226;
803
867
  }
804
868
  constructor() {
805
869
  super ();
806
- let t_240 = [];
807
- this.#out_122 = t_240;
870
+ let t_233 = [""];
871
+ this.#out_119 = t_233;
808
872
  return;
809
873
  }
810
874
  }
811
- class Codes_172 extends type__10() {
875
+ class Codes_167 extends type__10() {
812
876
  /** @type {number} */
813
- static #ampersand_241 = 38;
877
+ static #ampersand_234 = 38;
814
878
  /** @returns {number} */
815
879
  static get ampersand() {
816
- return this.#ampersand_241;
880
+ return this.#ampersand_234;
817
881
  }
818
882
  /** @type {number} */
819
- static #backslash_242 = 92;
883
+ static #backslash_235 = 92;
820
884
  /** @returns {number} */
821
885
  static get backslash() {
822
- return this.#backslash_242;
886
+ return this.#backslash_235;
823
887
  }
824
888
  /** @type {number} */
825
- static #caret_243 = 94;
889
+ static #caret_236 = 94;
826
890
  /** @returns {number} */
827
891
  static get caret() {
828
- return this.#caret_243;
892
+ return this.#caret_236;
829
893
  }
830
894
  /** @type {number} */
831
- static #carriageReturn_244 = 13;
895
+ static #carriageReturn_237 = 13;
832
896
  /** @returns {number} */
833
897
  static get carriageReturn() {
834
- return this.#carriageReturn_244;
898
+ return this.#carriageReturn_237;
835
899
  }
836
900
  /** @type {number} */
837
- static #curlyLeft_245 = 123;
901
+ static #curlyLeft_238 = 123;
838
902
  /** @returns {number} */
839
903
  static get curlyLeft() {
840
- return this.#curlyLeft_245;
904
+ return this.#curlyLeft_238;
841
905
  }
842
906
  /** @type {number} */
843
- static #curlyRight_246 = 125;
907
+ static #curlyRight_239 = 125;
844
908
  /** @returns {number} */
845
909
  static get curlyRight() {
846
- return this.#curlyRight_246;
910
+ return this.#curlyRight_239;
847
911
  }
848
912
  /** @type {number} */
849
- static #dash_247 = 45;
913
+ static #dash_240 = 45;
850
914
  /** @returns {number} */
851
915
  static get dash() {
852
- return this.#dash_247;
916
+ return this.#dash_240;
853
917
  }
854
918
  /** @type {number} */
855
- static #dot_248 = 46;
919
+ static #dot_241 = 46;
856
920
  /** @returns {number} */
857
921
  static get dot() {
858
- return this.#dot_248;
922
+ return this.#dot_241;
859
923
  }
860
924
  /** @type {number} */
861
- static #highControlMin_249 = 127;
925
+ static #highControlMin_242 = 127;
862
926
  /** @returns {number} */
863
927
  static get highControlMin() {
864
- return this.#highControlMin_249;
928
+ return this.#highControlMin_242;
865
929
  }
866
930
  /** @type {number} */
867
- static #highControlMax_250 = 159;
931
+ static #highControlMax_243 = 159;
868
932
  /** @returns {number} */
869
933
  static get highControlMax() {
870
- return this.#highControlMax_250;
934
+ return this.#highControlMax_243;
871
935
  }
872
936
  /** @type {number} */
873
- static #digit0_251 = 48;
937
+ static #digit0_244 = 48;
874
938
  /** @returns {number} */
875
939
  static get digit0() {
876
- return this.#digit0_251;
940
+ return this.#digit0_244;
877
941
  }
878
942
  /** @type {number} */
879
- static #digit9_252 = 57;
943
+ static #digit9_245 = 57;
880
944
  /** @returns {number} */
881
945
  static get digit9() {
882
- return this.#digit9_252;
946
+ return this.#digit9_245;
883
947
  }
884
948
  /** @type {number} */
885
- static #lowerA_253 = 97;
949
+ static #lowerA_246 = 97;
886
950
  /** @returns {number} */
887
951
  static get lowerA() {
888
- return this.#lowerA_253;
952
+ return this.#lowerA_246;
889
953
  }
890
954
  /** @type {number} */
891
- static #lowerZ_254 = 122;
955
+ static #lowerZ_247 = 122;
892
956
  /** @returns {number} */
893
957
  static get lowerZ() {
894
- return this.#lowerZ_254;
958
+ return this.#lowerZ_247;
895
959
  }
896
960
  /** @type {number} */
897
- static #newline_255 = 10;
961
+ static #newline_248 = 10;
898
962
  /** @returns {number} */
899
963
  static get newline() {
900
- return this.#newline_255;
964
+ return this.#newline_248;
901
965
  }
902
966
  /** @type {number} */
903
- static #peso_256 = 36;
967
+ static #peso_249 = 36;
904
968
  /** @returns {number} */
905
969
  static get peso() {
906
- return this.#peso_256;
970
+ return this.#peso_249;
907
971
  }
908
972
  /** @type {number} */
909
- static #pipe_257 = 124;
973
+ static #pipe_250 = 124;
910
974
  /** @returns {number} */
911
975
  static get pipe() {
912
- return this.#pipe_257;
976
+ return this.#pipe_250;
913
977
  }
914
978
  /** @type {number} */
915
- static #plus_258 = 43;
979
+ static #plus_251 = 43;
916
980
  /** @returns {number} */
917
981
  static get plus() {
918
- return this.#plus_258;
982
+ return this.#plus_251;
919
983
  }
920
984
  /** @type {number} */
921
- static #question_259 = 63;
985
+ static #question_252 = 63;
922
986
  /** @returns {number} */
923
987
  static get question() {
924
- return this.#question_259;
988
+ return this.#question_252;
925
989
  }
926
990
  /** @type {number} */
927
- static #roundLeft_260 = 40;
991
+ static #roundLeft_253 = 40;
928
992
  /** @returns {number} */
929
993
  static get roundLeft() {
930
- return this.#roundLeft_260;
994
+ return this.#roundLeft_253;
931
995
  }
932
996
  /** @type {number} */
933
- static #roundRight_261 = 41;
997
+ static #roundRight_254 = 41;
934
998
  /** @returns {number} */
935
999
  static get roundRight() {
936
- return this.#roundRight_261;
1000
+ return this.#roundRight_254;
937
1001
  }
938
1002
  /** @type {number} */
939
- static #slash_262 = 47;
1003
+ static #slash_255 = 47;
940
1004
  /** @returns {number} */
941
1005
  static get slash() {
942
- return this.#slash_262;
1006
+ return this.#slash_255;
943
1007
  }
944
1008
  /** @type {number} */
945
- static #squareLeft_263 = 91;
1009
+ static #squareLeft_256 = 91;
946
1010
  /** @returns {number} */
947
1011
  static get squareLeft() {
948
- return this.#squareLeft_263;
1012
+ return this.#squareLeft_256;
949
1013
  }
950
1014
  /** @type {number} */
951
- static #squareRight_264 = 93;
1015
+ static #squareRight_257 = 93;
952
1016
  /** @returns {number} */
953
1017
  static get squareRight() {
954
- return this.#squareRight_264;
1018
+ return this.#squareRight_257;
955
1019
  }
956
1020
  /** @type {number} */
957
- static #star_265 = 42;
1021
+ static #star_258 = 42;
958
1022
  /** @returns {number} */
959
1023
  static get star() {
960
- return this.#star_265;
1024
+ return this.#star_258;
961
1025
  }
962
1026
  /** @type {number} */
963
- static #tab_266 = 9;
1027
+ static #tab_259 = 9;
964
1028
  /** @returns {number} */
965
1029
  static get tab() {
966
- return this.#tab_266;
1030
+ return this.#tab_259;
967
1031
  }
968
1032
  /** @type {number} */
969
- static #tilde_267 = 42;
1033
+ static #tilde_260 = 42;
970
1034
  /** @returns {number} */
971
1035
  static get tilde() {
972
- return this.#tilde_267;
1036
+ return this.#tilde_260;
973
1037
  }
974
1038
  /** @type {number} */
975
- static #upperA_268 = 65;
1039
+ static #upperA_261 = 65;
976
1040
  /** @returns {number} */
977
1041
  static get upperA() {
978
- return this.#upperA_268;
1042
+ return this.#upperA_261;
979
1043
  }
980
1044
  /** @type {number} */
981
- static #upperZ_269 = 90;
1045
+ static #upperZ_262 = 90;
982
1046
  /** @returns {number} */
983
1047
  static get upperZ() {
984
- return this.#upperZ_269;
1048
+ return this.#upperZ_262;
985
1049
  }
986
1050
  /** @type {number} */
987
- static #space_270 = 32;
1051
+ static #space_263 = 32;
988
1052
  /** @returns {number} */
989
1053
  static get space() {
990
- return this.#space_270;
1054
+ return this.#space_263;
991
1055
  }
992
1056
  /** @type {number} */
993
- static #surrogateMin_271 = 55296;
1057
+ static #surrogateMin_264 = 55296;
994
1058
  /** @returns {number} */
995
1059
  static get surrogateMin() {
996
- return this.#surrogateMin_271;
1060
+ return this.#surrogateMin_264;
997
1061
  }
998
1062
  /** @type {number} */
999
- static #surrogateMax_272 = 57343;
1063
+ static #surrogateMax_265 = 57343;
1000
1064
  /** @returns {number} */
1001
1065
  static get surrogateMax() {
1002
- return this.#surrogateMax_272;
1066
+ return this.#surrogateMax_265;
1003
1067
  }
1004
1068
  /** @type {number} */
1005
- static #supplementalMin_273 = 65536;
1069
+ static #supplementalMin_266 = 65536;
1006
1070
  /** @returns {number} */
1007
1071
  static get supplementalMin() {
1008
- return this.#supplementalMin_273;
1072
+ return this.#supplementalMin_266;
1009
1073
  }
1010
1074
  /** @type {number} */
1011
- static #uint16Max_274 = 65535;
1075
+ static #uint16Max_267 = 65535;
1012
1076
  /** @returns {number} */
1013
1077
  static get uint16Max() {
1014
- return this.#uint16Max_274;
1078
+ return this.#uint16Max_267;
1015
1079
  }
1016
1080
  /** @type {number} */
1017
- static #underscore_275 = 95;
1081
+ static #underscore_268 = 95;
1018
1082
  /** @returns {number} */
1019
1083
  static get underscore() {
1020
- return this.#underscore_275;
1084
+ return this.#underscore_268;
1021
1085
  }
1022
1086
  constructor() {
1023
1087
  super ();
1024
1088
  return;
1025
1089
  }
1026
1090
  }
1027
- /** @type {RegexRefs_72} */
1028
- const regexRefs_111 = new RegexRefs_72();
1029
- class Begin_276 extends type__10(Special) {
1091
+ class Begin_269 extends type__10(Special) {
1030
1092
  constructor() {
1031
1093
  super ();
1032
1094
  return;
1033
1095
  }
1034
1096
  }
1035
1097
  /** @type {Special} */
1036
- export const Begin = new Begin_276();
1037
- class Dot_277 extends type__10(Special) {
1098
+ export const Begin = new Begin_269();
1099
+ class Dot_270 extends type__10(Special) {
1038
1100
  constructor() {
1039
1101
  super ();
1040
1102
  return;
1041
1103
  }
1042
1104
  }
1043
1105
  /** @type {Special} */
1044
- export const Dot = new Dot_277();
1045
- class End_278 extends type__10(Special) {
1106
+ export const Dot = new Dot_270();
1107
+ class End_271 extends type__10(Special) {
1046
1108
  constructor() {
1047
1109
  super ();
1048
1110
  return;
1049
1111
  }
1050
1112
  }
1051
1113
  /** @type {Special} */
1052
- export const End = new End_278();
1053
- class WordBoundary_279 extends type__10(Special) {
1114
+ export const End = new End_271();
1115
+ class WordBoundary_272 extends type__10(Special) {
1054
1116
  constructor() {
1055
1117
  super ();
1056
1118
  return;
1057
1119
  }
1058
1120
  }
1059
1121
  /** @type {Special} */
1060
- export const WordBoundary = new WordBoundary_279();
1061
- class Digit_280 extends type__10(SpecialSet) {
1122
+ export const WordBoundary = new WordBoundary_272();
1123
+ class Digit_273 extends type__10(SpecialSet) {
1062
1124
  constructor() {
1063
1125
  super ();
1064
1126
  return;
1065
1127
  }
1066
1128
  }
1067
1129
  /** @type {SpecialSet} */
1068
- export const Digit = new Digit_280();
1069
- class Space_281 extends type__10(SpecialSet) {
1130
+ export const Digit = new Digit_273();
1131
+ class Space_274 extends type__10(SpecialSet) {
1070
1132
  constructor() {
1071
1133
  super ();
1072
1134
  return;
1073
1135
  }
1074
1136
  }
1075
1137
  /** @type {SpecialSet} */
1076
- export const Space = new Space_281();
1077
- class Word_282 extends type__10(SpecialSet) {
1138
+ export const Space = new Space_274();
1139
+ class Word_275 extends type__10(SpecialSet) {
1078
1140
  constructor() {
1079
1141
  super ();
1080
1142
  return;
1081
1143
  }
1082
1144
  }
1083
1145
  /** @type {SpecialSet} */
1084
- export const Word = new Word_282();
1146
+ export const Word = new Word_275();
1085
1147
  /** @returns {Array<number>} */
1086
- function buildEscapeNeeds_283() {
1148
+ function buildEscapeNeeds_276() {
1149
+ let t_277;
1150
+ let t_278;
1151
+ let t_279;
1152
+ let t_280;
1153
+ let t_281;
1154
+ let t_282;
1155
+ let t_283;
1087
1156
  let t_284;
1088
1157
  let t_285;
1089
1158
  let t_286;
@@ -1102,184 +1171,179 @@ function buildEscapeNeeds_283() {
1102
1171
  let t_299;
1103
1172
  let t_300;
1104
1173
  let t_301;
1105
- let t_302;
1106
- let t_303;
1107
- let t_304;
1108
- let t_305;
1109
- let t_306;
1110
- let t_307;
1111
- let t_308;
1112
- const escapeNeeds_309 = [];
1113
- let code_310 = 0;
1114
- while (code_310 < 127) {
1115
- if (code_310 === Codes_172.dash) {
1116
- t_291 = true;
1174
+ const escapeNeeds_302 = [];
1175
+ let code_303 = 0;
1176
+ while (code_303 < 127) {
1177
+ if (code_303 === Codes_167.dash) {
1178
+ t_284 = true;
1117
1179
  } else {
1118
- if (code_310 === Codes_172.space) {
1119
- t_290 = true;
1180
+ if (code_303 === Codes_167.space) {
1181
+ t_283 = true;
1120
1182
  } else {
1121
- if (code_310 === Codes_172.underscore) {
1122
- t_289 = true;
1183
+ if (code_303 === Codes_167.underscore) {
1184
+ t_282 = true;
1123
1185
  } else {
1124
- if (Codes_172.digit0 <= code_310) {
1125
- t_284 = code_310 <= Codes_172.digit9;
1186
+ if (Codes_167.digit0 <= code_303) {
1187
+ t_277 = code_303 <= Codes_167.digit9;
1126
1188
  } else {
1127
- t_284 = false;
1189
+ t_277 = false;
1128
1190
  }
1129
- if (t_284) {
1130
- t_288 = true;
1191
+ if (t_277) {
1192
+ t_281 = true;
1131
1193
  } else {
1132
- if (Codes_172.upperA <= code_310) {
1133
- t_285 = code_310 <= Codes_172.upperZ;
1194
+ if (Codes_167.upperA <= code_303) {
1195
+ t_278 = code_303 <= Codes_167.upperZ;
1134
1196
  } else {
1135
- t_285 = false;
1197
+ t_278 = false;
1136
1198
  }
1137
- if (t_285) {
1138
- t_287 = true;
1199
+ if (t_278) {
1200
+ t_280 = true;
1139
1201
  } else {
1140
- if (Codes_172.lowerA <= code_310) {
1141
- t_286 = code_310 <= Codes_172.lowerZ;
1202
+ if (Codes_167.lowerA <= code_303) {
1203
+ t_279 = code_303 <= Codes_167.lowerZ;
1142
1204
  } else {
1143
- t_286 = false;
1205
+ t_279 = false;
1144
1206
  }
1145
- t_287 = t_286;
1207
+ t_280 = t_279;
1146
1208
  }
1147
- t_288 = t_287;
1209
+ t_281 = t_280;
1148
1210
  }
1149
- t_289 = t_288;
1211
+ t_282 = t_281;
1150
1212
  }
1151
- t_290 = t_289;
1213
+ t_283 = t_282;
1152
1214
  }
1153
- t_291 = t_290;
1215
+ t_284 = t_283;
1154
1216
  }
1155
- if (t_291) {
1156
- t_308 = 0;
1217
+ if (t_284) {
1218
+ t_301 = 0;
1157
1219
  } else {
1158
- if (code_310 === Codes_172.ampersand) {
1159
- t_307 = true;
1220
+ if (code_303 === Codes_167.ampersand) {
1221
+ t_300 = true;
1160
1222
  } else {
1161
- if (code_310 === Codes_172.backslash) {
1162
- t_306 = true;
1223
+ if (code_303 === Codes_167.backslash) {
1224
+ t_299 = true;
1163
1225
  } else {
1164
- if (code_310 === Codes_172.caret) {
1165
- t_305 = true;
1226
+ if (code_303 === Codes_167.caret) {
1227
+ t_298 = true;
1166
1228
  } else {
1167
- if (code_310 === Codes_172.curlyLeft) {
1168
- t_304 = true;
1229
+ if (code_303 === Codes_167.curlyLeft) {
1230
+ t_297 = true;
1169
1231
  } else {
1170
- if (code_310 === Codes_172.curlyRight) {
1171
- t_303 = true;
1232
+ if (code_303 === Codes_167.curlyRight) {
1233
+ t_296 = true;
1172
1234
  } else {
1173
- if (code_310 === Codes_172.dot) {
1174
- t_302 = true;
1235
+ if (code_303 === Codes_167.dot) {
1236
+ t_295 = true;
1175
1237
  } else {
1176
- if (code_310 === Codes_172.peso) {
1177
- t_301 = true;
1238
+ if (code_303 === Codes_167.peso) {
1239
+ t_294 = true;
1178
1240
  } else {
1179
- if (code_310 === Codes_172.pipe) {
1180
- t_300 = true;
1241
+ if (code_303 === Codes_167.pipe) {
1242
+ t_293 = true;
1181
1243
  } else {
1182
- if (code_310 === Codes_172.plus) {
1183
- t_299 = true;
1244
+ if (code_303 === Codes_167.plus) {
1245
+ t_292 = true;
1184
1246
  } else {
1185
- if (code_310 === Codes_172.question) {
1186
- t_298 = true;
1247
+ if (code_303 === Codes_167.question) {
1248
+ t_291 = true;
1187
1249
  } else {
1188
- if (code_310 === Codes_172.roundLeft) {
1189
- t_297 = true;
1250
+ if (code_303 === Codes_167.roundLeft) {
1251
+ t_290 = true;
1190
1252
  } else {
1191
- if (code_310 === Codes_172.roundRight) {
1192
- t_296 = true;
1253
+ if (code_303 === Codes_167.roundRight) {
1254
+ t_289 = true;
1193
1255
  } else {
1194
- if (code_310 === Codes_172.slash) {
1195
- t_295 = true;
1256
+ if (code_303 === Codes_167.slash) {
1257
+ t_288 = true;
1196
1258
  } else {
1197
- if (code_310 === Codes_172.squareLeft) {
1198
- t_294 = true;
1259
+ if (code_303 === Codes_167.squareLeft) {
1260
+ t_287 = true;
1199
1261
  } else {
1200
- if (code_310 === Codes_172.squareRight) {
1201
- t_293 = true;
1262
+ if (code_303 === Codes_167.squareRight) {
1263
+ t_286 = true;
1202
1264
  } else {
1203
- if (code_310 === Codes_172.star) {
1204
- t_292 = true;
1265
+ if (code_303 === Codes_167.star) {
1266
+ t_285 = true;
1205
1267
  } else {
1206
- t_292 = code_310 === Codes_172.tilde;
1268
+ t_285 = code_303 === Codes_167.tilde;
1207
1269
  }
1208
- t_293 = t_292;
1270
+ t_286 = t_285;
1209
1271
  }
1210
- t_294 = t_293;
1272
+ t_287 = t_286;
1211
1273
  }
1212
- t_295 = t_294;
1274
+ t_288 = t_287;
1213
1275
  }
1214
- t_296 = t_295;
1276
+ t_289 = t_288;
1215
1277
  }
1216
- t_297 = t_296;
1278
+ t_290 = t_289;
1217
1279
  }
1218
- t_298 = t_297;
1280
+ t_291 = t_290;
1219
1281
  }
1220
- t_299 = t_298;
1282
+ t_292 = t_291;
1221
1283
  }
1222
- t_300 = t_299;
1284
+ t_293 = t_292;
1223
1285
  }
1224
- t_301 = t_300;
1286
+ t_294 = t_293;
1225
1287
  }
1226
- t_302 = t_301;
1288
+ t_295 = t_294;
1227
1289
  }
1228
- t_303 = t_302;
1290
+ t_296 = t_295;
1229
1291
  }
1230
- t_304 = t_303;
1292
+ t_297 = t_296;
1231
1293
  }
1232
- t_305 = t_304;
1294
+ t_298 = t_297;
1233
1295
  }
1234
- t_306 = t_305;
1296
+ t_299 = t_298;
1235
1297
  }
1236
- t_307 = t_306;
1298
+ t_300 = t_299;
1237
1299
  }
1238
- if (t_307) {
1239
- t_308 = 2;
1300
+ if (t_300) {
1301
+ t_301 = 2;
1240
1302
  } else {
1241
- t_308 = 1;
1303
+ t_301 = 1;
1242
1304
  }
1243
1305
  }
1244
- listBuilderAdd_146(escapeNeeds_309, t_308);
1245
- code_310 = code_310 + 1;
1306
+ listBuilderAdd_304(escapeNeeds_302, t_301);
1307
+ code_303 = code_303 + 1;
1246
1308
  }
1247
- return listBuilderToList_311(escapeNeeds_309);
1309
+ return listBuilderToList_305(escapeNeeds_302);
1248
1310
  }
1249
1311
  /** @type {Array<number>} */
1250
- const escapeNeeds_175 = buildEscapeNeeds_283();
1312
+ const escapeNeeds_170 = buildEscapeNeeds_276();
1313
+ /** @type {RegexRefs_70} */
1314
+ const regexRefs_110 = new RegexRefs_70();
1251
1315
  /**
1252
- * @param {RegexNode} item_312
1316
+ * @param {RegexNode} item_306
1253
1317
  * @returns {RegexNode}
1254
1318
  */
1255
- export function entire(item_312) {
1256
- return new Sequence(Object.freeze([Begin, item_312, End]));
1319
+ export function entire(item_306) {
1320
+ return new Sequence(Object.freeze([Begin, item_306, End]));
1257
1321
  };
1258
1322
  /**
1259
- * @param {RegexNode} item_313
1260
- * @param {boolean | null} [reluctant_314]
1323
+ * @param {RegexNode} item_307
1324
+ * @param {boolean | null} [reluctant_308]
1261
1325
  * @returns {Repeat}
1262
1326
  */
1263
- export function oneOrMore(item_313, reluctant_314) {
1264
- let reluctant_315;
1265
- if (reluctant_314 == null) {
1266
- reluctant_315 = false;
1327
+ export function oneOrMore(item_307, reluctant_308) {
1328
+ let reluctant_309;
1329
+ if (reluctant_308 == null) {
1330
+ reluctant_309 = false;
1267
1331
  } else {
1268
- reluctant_315 = reluctant_314;
1332
+ reluctant_309 = reluctant_308;
1269
1333
  }
1270
- return new Repeat(item_313, 1, null, reluctant_315);
1334
+ return new Repeat(item_307, 1, null, reluctant_309);
1271
1335
  };
1272
1336
  /**
1273
- * @param {RegexNode} item_316
1274
- * @param {boolean | null} [reluctant_317]
1337
+ * @param {RegexNode} item_310
1338
+ * @param {boolean | null} [reluctant_311]
1275
1339
  * @returns {Repeat}
1276
1340
  */
1277
- export function optional(item_316, reluctant_317) {
1278
- let reluctant_318;
1279
- if (reluctant_317 == null) {
1280
- reluctant_318 = false;
1341
+ export function optional(item_310, reluctant_311) {
1342
+ let reluctant_312;
1343
+ if (reluctant_311 == null) {
1344
+ reluctant_312 = false;
1281
1345
  } else {
1282
- reluctant_318 = reluctant_317;
1346
+ reluctant_312 = reluctant_311;
1283
1347
  }
1284
- return new Repeat(item_316, 0, 1, reluctant_318);
1348
+ return new Repeat(item_310, 0, 1, reluctant_312);
1285
1349
  };