@temperlang/std 0.2.0 → 0.3.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/package.json +2 -2
- package/regex.js +495 -484
- package/regex.js.map +1 -1
- package/temporal.js +39 -35
- package/temporal.js.map +1 -1
- package/testing.js +122 -122
- package/testing.js.map +1 -1
package/regex.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
InterfaceType as InterfaceType_0, requireInstanceOf as
|
|
2
|
+
InterfaceType as InterfaceType_0, requireInstanceOf as requireInstanceOf__117, requireIsSafeInteger as requireIsSafeInteger__191, listify as listify_69, regexCompileFormatted as regexCompileFormatted_77, regexCompiledFound as regexCompiledFound_81, regexCompiledFind as regexCompiledFind_84, regexCompiledReplace as regexCompiledReplace_89, listedJoin as listedJoin_99, eqGeneric as eqGeneric_119, listBuilderAdd as listBuilderAdd_120, strCat as strCat_129, regexFormatterPushCodeTo as regexFormatterPushCodeTo_133, stringCodePoints as stringCodePoints_140, regexFormatterAdjustCodeSet as regexFormatterAdjustCodeSet_155, listedGet as listedGet_159, intToString as intToString_190
|
|
3
3
|
} from "@temperlang/core";
|
|
4
4
|
function methodCompiled1() {
|
|
5
|
-
return new
|
|
5
|
+
return new Regex(this);
|
|
6
6
|
}
|
|
7
7
|
function methodFound2(text_3) {
|
|
8
8
|
return this.compiled().found(text_3);
|
|
@@ -15,19 +15,19 @@ function methodReplace6(text_7, format_8) {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* @typedef {{
|
|
18
|
-
* compiled: () =>
|
|
18
|
+
* compiled: () => Regex, found: (text_3: string) => boolean, find: (text_5: string) => Map<string, Group>, replace: (text_7: string, format_8: (arg0: Map<string, Group>) => string) => string
|
|
19
19
|
* }}
|
|
20
|
-
*
|
|
20
|
+
* RegexNode
|
|
21
21
|
*/
|
|
22
|
-
export const
|
|
22
|
+
export const RegexNode = new InterfaceType_0("RegexNode", [["m", "compiled", methodCompiled1], ["m", "found", methodFound2], ["m", "find", methodFind4], ["m", "replace", methodReplace6]], [], 1);
|
|
23
23
|
export class Capture {
|
|
24
24
|
/** @type {string} */
|
|
25
25
|
#name_9;
|
|
26
|
-
/** @type {
|
|
26
|
+
/** @type {RegexNode} */
|
|
27
27
|
#item_10;
|
|
28
28
|
/**
|
|
29
29
|
* @param {string} name_11
|
|
30
|
-
* @param {
|
|
30
|
+
* @param {RegexNode} item_12
|
|
31
31
|
*/
|
|
32
32
|
constructor(name_11, item_12) {
|
|
33
33
|
this.#name_9 = name_11;
|
|
@@ -38,17 +38,17 @@ export class Capture {
|
|
|
38
38
|
get name() {
|
|
39
39
|
return this.#name_9;
|
|
40
40
|
}
|
|
41
|
-
/** @returns {
|
|
41
|
+
/** @returns {RegexNode} */
|
|
42
42
|
get item() {
|
|
43
43
|
return this.#item_10;
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
RegexNode.implementedBy(Capture);
|
|
47
47
|
/**
|
|
48
48
|
* @typedef {{}}
|
|
49
49
|
* CodePart
|
|
50
50
|
*/
|
|
51
|
-
export const CodePart = new InterfaceType_0("CodePart", [], [
|
|
51
|
+
export const CodePart = new InterfaceType_0("CodePart", [], [RegexNode], 2);
|
|
52
52
|
export class CodePoints {
|
|
53
53
|
/** @type {string} */
|
|
54
54
|
#value_15;
|
|
@@ -67,7 +67,7 @@ CodePart.implementedBy(CodePoints);
|
|
|
67
67
|
* @typedef {{}}
|
|
68
68
|
* Special
|
|
69
69
|
*/
|
|
70
|
-
export const Special = new InterfaceType_0("Special", [], [
|
|
70
|
+
export const Special = new InterfaceType_0("Special", [], [RegexNode], 2);
|
|
71
71
|
/**
|
|
72
72
|
* @typedef {{}}
|
|
73
73
|
* SpecialSet
|
|
@@ -97,245 +97,254 @@ export class CodeRange {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
CodePart.implementedBy(CodeRange);
|
|
100
|
+
function getterItems24() {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @template ITEM_25
|
|
105
|
+
* @typedef {{
|
|
106
|
+
* get items(): Array<ITEM_25>
|
|
107
|
+
* }}
|
|
108
|
+
* ItemizedRegex
|
|
109
|
+
*/
|
|
110
|
+
export const ItemizedRegex = new InterfaceType_0("ItemizedRegex", [["g", "items", getterItems24]], [RegexNode], 2);
|
|
100
111
|
export class CodeSet {
|
|
101
112
|
/** @type {Array<CodePart>} */
|
|
102
|
-
#
|
|
113
|
+
#items_26;
|
|
103
114
|
/** @type {boolean} */
|
|
104
|
-
#
|
|
115
|
+
#negated_27;
|
|
105
116
|
/**
|
|
106
|
-
* @param {Array<CodePart>}
|
|
107
|
-
* @param {boolean}
|
|
117
|
+
* @param {Array<CodePart>} items_28
|
|
118
|
+
* @param {boolean} negated_29
|
|
108
119
|
*/
|
|
109
|
-
constructor(
|
|
110
|
-
if (!(
|
|
111
|
-
|
|
120
|
+
constructor(items_28, negated_29) {
|
|
121
|
+
if (!(negated_29 !== void 0)) {
|
|
122
|
+
negated_29 = false;
|
|
112
123
|
}
|
|
113
|
-
this.#
|
|
114
|
-
this.#
|
|
124
|
+
this.#items_26 = items_28;
|
|
125
|
+
this.#negated_27 = negated_29;
|
|
115
126
|
return;
|
|
116
127
|
}
|
|
117
128
|
/** @returns {Array<CodePart>} */
|
|
118
129
|
get items() {
|
|
119
|
-
return this.#
|
|
130
|
+
return this.#items_26;
|
|
120
131
|
}
|
|
121
132
|
/** @returns {boolean} */
|
|
122
133
|
get negated() {
|
|
123
|
-
return this.#
|
|
134
|
+
return this.#negated_27;
|
|
124
135
|
}
|
|
125
136
|
};
|
|
126
|
-
|
|
137
|
+
ItemizedRegex.implementedBy(CodeSet);
|
|
127
138
|
export class Or {
|
|
128
|
-
/** @type {Array<
|
|
129
|
-
#
|
|
130
|
-
/** @param {Array<
|
|
131
|
-
constructor(
|
|
132
|
-
this.#
|
|
139
|
+
/** @type {Array<RegexNode>} */
|
|
140
|
+
#items_32;
|
|
141
|
+
/** @param {Array<RegexNode>} items_33 */
|
|
142
|
+
constructor(items_33) {
|
|
143
|
+
this.#items_32 = items_33;
|
|
133
144
|
return;
|
|
134
145
|
}
|
|
135
|
-
/** @returns {Array<
|
|
146
|
+
/** @returns {Array<RegexNode>} */
|
|
136
147
|
get items() {
|
|
137
|
-
return this.#
|
|
148
|
+
return this.#items_32;
|
|
138
149
|
}
|
|
139
150
|
};
|
|
140
|
-
|
|
151
|
+
ItemizedRegex.implementedBy(Or);
|
|
141
152
|
export class Repeat {
|
|
142
|
-
/** @type {
|
|
143
|
-
#
|
|
153
|
+
/** @type {RegexNode} */
|
|
154
|
+
#item_35;
|
|
144
155
|
/** @type {number} */
|
|
145
|
-
#
|
|
156
|
+
#min_36;
|
|
146
157
|
/** @type {number | null} */
|
|
147
|
-
#
|
|
158
|
+
#max_37;
|
|
148
159
|
/** @type {boolean} */
|
|
149
|
-
#
|
|
160
|
+
#reluctant_38;
|
|
150
161
|
/**
|
|
151
|
-
* @param {
|
|
152
|
-
* @param {number}
|
|
153
|
-
* @param {number | null}
|
|
154
|
-
* @param {boolean}
|
|
162
|
+
* @param {RegexNode} item_39
|
|
163
|
+
* @param {number} min_40
|
|
164
|
+
* @param {number | null} max_41
|
|
165
|
+
* @param {boolean} reluctant_42
|
|
155
166
|
*/
|
|
156
|
-
constructor(
|
|
157
|
-
if (!(
|
|
158
|
-
|
|
167
|
+
constructor(item_39, min_40, max_41, reluctant_42) {
|
|
168
|
+
if (!(reluctant_42 !== void 0)) {
|
|
169
|
+
reluctant_42 = false;
|
|
159
170
|
}
|
|
160
|
-
this.#
|
|
161
|
-
this.#
|
|
162
|
-
this.#
|
|
163
|
-
this.#
|
|
171
|
+
this.#item_35 = item_39;
|
|
172
|
+
this.#min_36 = min_40;
|
|
173
|
+
this.#max_37 = max_41;
|
|
174
|
+
this.#reluctant_38 = reluctant_42;
|
|
164
175
|
return;
|
|
165
176
|
}
|
|
166
|
-
/** @returns {
|
|
177
|
+
/** @returns {RegexNode} */
|
|
167
178
|
get item() {
|
|
168
|
-
return this.#
|
|
179
|
+
return this.#item_35;
|
|
169
180
|
}
|
|
170
181
|
/** @returns {number} */
|
|
171
182
|
get min() {
|
|
172
|
-
return this.#
|
|
183
|
+
return this.#min_36;
|
|
173
184
|
}
|
|
174
185
|
/** @returns {number | null} */
|
|
175
186
|
get max() {
|
|
176
|
-
return this.#
|
|
187
|
+
return this.#max_37;
|
|
177
188
|
}
|
|
178
189
|
/** @returns {boolean} */
|
|
179
190
|
get reluctant() {
|
|
180
|
-
return this.#
|
|
191
|
+
return this.#reluctant_38;
|
|
181
192
|
}
|
|
182
193
|
};
|
|
183
|
-
|
|
194
|
+
RegexNode.implementedBy(Repeat);
|
|
184
195
|
export class Sequence {
|
|
185
|
-
/** @type {Array<
|
|
186
|
-
#
|
|
187
|
-
/** @param {Array<
|
|
188
|
-
constructor(
|
|
189
|
-
this.#
|
|
196
|
+
/** @type {Array<RegexNode>} */
|
|
197
|
+
#items_47;
|
|
198
|
+
/** @param {Array<RegexNode>} items_48 */
|
|
199
|
+
constructor(items_48) {
|
|
200
|
+
this.#items_47 = items_48;
|
|
190
201
|
return;
|
|
191
202
|
}
|
|
192
|
-
/** @returns {Array<
|
|
203
|
+
/** @returns {Array<RegexNode>} */
|
|
193
204
|
get items() {
|
|
194
|
-
return this.#
|
|
205
|
+
return this.#items_47;
|
|
195
206
|
}
|
|
196
207
|
};
|
|
197
|
-
|
|
208
|
+
ItemizedRegex.implementedBy(Sequence);
|
|
198
209
|
export class Group {
|
|
199
210
|
/** @type {string} */
|
|
200
|
-
#
|
|
211
|
+
#name_50;
|
|
201
212
|
/** @type {string} */
|
|
202
|
-
#
|
|
213
|
+
#value_51;
|
|
203
214
|
/** @type {number} */
|
|
204
|
-
#
|
|
215
|
+
#codePointsBegin_52;
|
|
205
216
|
/**
|
|
206
|
-
* @param {string}
|
|
207
|
-
* @param {string}
|
|
208
|
-
* @param {number}
|
|
217
|
+
* @param {string} name_53
|
|
218
|
+
* @param {string} value_54
|
|
219
|
+
* @param {number} codePointsBegin_55
|
|
209
220
|
*/
|
|
210
|
-
constructor(
|
|
211
|
-
this.#
|
|
212
|
-
this.#
|
|
213
|
-
this.#
|
|
221
|
+
constructor(name_53, value_54, codePointsBegin_55) {
|
|
222
|
+
this.#name_50 = name_53;
|
|
223
|
+
this.#value_51 = value_54;
|
|
224
|
+
this.#codePointsBegin_52 = codePointsBegin_55;
|
|
214
225
|
return;
|
|
215
226
|
}
|
|
216
227
|
/** @returns {string} */
|
|
217
228
|
get name() {
|
|
218
|
-
return this.#
|
|
229
|
+
return this.#name_50;
|
|
219
230
|
}
|
|
220
231
|
/** @returns {string} */
|
|
221
232
|
get value() {
|
|
222
|
-
return this.#
|
|
233
|
+
return this.#value_51;
|
|
223
234
|
}
|
|
224
235
|
/** @returns {number} */
|
|
225
236
|
get codePointsBegin() {
|
|
226
|
-
return this.#
|
|
237
|
+
return this.#codePointsBegin_52;
|
|
227
238
|
}
|
|
228
239
|
};
|
|
229
|
-
class
|
|
240
|
+
class RegexRefs_59 {
|
|
230
241
|
/** @type {CodePoints} */
|
|
231
|
-
#
|
|
242
|
+
#codePoints_60;
|
|
232
243
|
/** @type {Group} */
|
|
233
|
-
#
|
|
244
|
+
#group_61;
|
|
234
245
|
/** @type {Or} */
|
|
235
|
-
#
|
|
246
|
+
#orObject_62;
|
|
236
247
|
/**
|
|
237
|
-
* @param {CodePoints}
|
|
238
|
-
* @param {Group}
|
|
239
|
-
* @param {Or}
|
|
248
|
+
* @param {CodePoints} codePoints_63
|
|
249
|
+
* @param {Group} group_64
|
|
250
|
+
* @param {Or} orObject_65
|
|
240
251
|
*/
|
|
241
|
-
constructor(
|
|
242
|
-
let t_64;
|
|
243
|
-
let t_65;
|
|
252
|
+
constructor(codePoints_63, group_64, orObject_65) {
|
|
244
253
|
let t_66;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
254
|
+
let t_67;
|
|
255
|
+
let t_68;
|
|
256
|
+
if (!(codePoints_63 !== void 0)) {
|
|
257
|
+
t_66 = new CodePoints("");
|
|
258
|
+
codePoints_63 = t_66;
|
|
248
259
|
}
|
|
249
|
-
if (!(
|
|
250
|
-
|
|
251
|
-
|
|
260
|
+
if (!(group_64 !== void 0)) {
|
|
261
|
+
t_67 = new Group("", "", 0);
|
|
262
|
+
group_64 = t_67;
|
|
252
263
|
}
|
|
253
|
-
if (!(
|
|
254
|
-
|
|
255
|
-
|
|
264
|
+
if (!(orObject_65 !== void 0)) {
|
|
265
|
+
t_68 = new Or(listify_69());
|
|
266
|
+
orObject_65 = t_68;
|
|
256
267
|
}
|
|
257
|
-
this.#
|
|
258
|
-
this.#
|
|
259
|
-
this.#
|
|
268
|
+
this.#codePoints_60 = codePoints_63;
|
|
269
|
+
this.#group_61 = group_64;
|
|
270
|
+
this.#orObject_62 = orObject_65;
|
|
260
271
|
return;
|
|
261
272
|
}
|
|
262
273
|
/** @returns {CodePoints} */
|
|
263
274
|
get codePoints() {
|
|
264
|
-
return this.#
|
|
275
|
+
return this.#codePoints_60;
|
|
265
276
|
}
|
|
266
277
|
/** @returns {Group} */
|
|
267
278
|
get group() {
|
|
268
|
-
return this.#
|
|
279
|
+
return this.#group_61;
|
|
269
280
|
}
|
|
270
281
|
/** @returns {Or} */
|
|
271
282
|
get orObject() {
|
|
272
|
-
return this.#
|
|
283
|
+
return this.#orObject_62;
|
|
273
284
|
}
|
|
274
285
|
}
|
|
275
|
-
export class
|
|
276
|
-
/** @type {
|
|
277
|
-
#
|
|
278
|
-
/** @param {
|
|
279
|
-
constructor(
|
|
280
|
-
this.#
|
|
281
|
-
let
|
|
282
|
-
let
|
|
283
|
-
this.#
|
|
286
|
+
export class Regex {
|
|
287
|
+
/** @type {RegexNode} */
|
|
288
|
+
#data_73;
|
|
289
|
+
/** @param {RegexNode} data_74 */
|
|
290
|
+
constructor(data_74) {
|
|
291
|
+
this.#data_73 = data_74;
|
|
292
|
+
let t_75 = this.format();
|
|
293
|
+
let t_76 = regexCompileFormatted_77(this, t_75);
|
|
294
|
+
this.#compiled_78 = t_76;
|
|
284
295
|
return;
|
|
285
296
|
}
|
|
286
297
|
/**
|
|
287
|
-
* @param {string}
|
|
298
|
+
* @param {string} text_80
|
|
288
299
|
* @returns {boolean}
|
|
289
300
|
*/
|
|
290
|
-
found(
|
|
291
|
-
return
|
|
301
|
+
found(text_80) {
|
|
302
|
+
return regexCompiledFound_81(this, this.#compiled_78, text_80);
|
|
292
303
|
}
|
|
293
304
|
/**
|
|
294
|
-
* @param {string}
|
|
305
|
+
* @param {string} text_83
|
|
295
306
|
* @returns {Map<string, Group>}
|
|
296
307
|
*/
|
|
297
|
-
find(
|
|
298
|
-
return
|
|
308
|
+
find(text_83) {
|
|
309
|
+
return regexCompiledFind_84(this, this.#compiled_78, text_83, regexRefs_85);
|
|
299
310
|
}
|
|
300
311
|
/**
|
|
301
|
-
* @param {string}
|
|
302
|
-
* @param {(arg0: Map<string, Group>) => string}
|
|
312
|
+
* @param {string} text_87
|
|
313
|
+
* @param {(arg0: Map<string, Group>) => string} format_88
|
|
303
314
|
* @returns {string}
|
|
304
315
|
*/
|
|
305
|
-
replace(
|
|
306
|
-
return
|
|
316
|
+
replace(text_87, format_88) {
|
|
317
|
+
return regexCompiledReplace_89(this, this.#compiled_78, text_87, format_88, regexRefs_85);
|
|
307
318
|
}
|
|
308
319
|
/** @type {unknown} */
|
|
309
|
-
#
|
|
320
|
+
#compiled_78;
|
|
310
321
|
/** @returns {string} */
|
|
311
322
|
format() {
|
|
312
|
-
return new
|
|
323
|
+
return new RegexFormatter_91().format(this.#data_73);
|
|
313
324
|
}
|
|
314
|
-
/** @returns {
|
|
325
|
+
/** @returns {RegexNode} */
|
|
315
326
|
get data() {
|
|
316
|
-
return this.#
|
|
327
|
+
return this.#data_73;
|
|
317
328
|
}
|
|
318
329
|
};
|
|
319
|
-
class
|
|
330
|
+
class RegexFormatter_91 {
|
|
320
331
|
/** @type {Array<string>} */
|
|
321
|
-
#
|
|
332
|
+
#out_93;
|
|
322
333
|
/**
|
|
323
|
-
* @param {
|
|
334
|
+
* @param {RegexNode} regex_95
|
|
324
335
|
* @returns {string}
|
|
325
336
|
*/
|
|
326
|
-
format(
|
|
327
|
-
this.pushRegex(
|
|
328
|
-
let
|
|
329
|
-
function
|
|
330
|
-
return
|
|
337
|
+
format(regex_95) {
|
|
338
|
+
this.pushRegex(regex_95);
|
|
339
|
+
let t_96 = this.#out_93;
|
|
340
|
+
function fn_97(x_98) {
|
|
341
|
+
return x_98;
|
|
331
342
|
}
|
|
332
|
-
return
|
|
343
|
+
return listedJoin_99(t_96, "", fn_97);
|
|
333
344
|
}
|
|
334
|
-
/** @param {
|
|
335
|
-
pushRegex(
|
|
336
|
-
let
|
|
337
|
-
let t_101;
|
|
338
|
-
let t_102;
|
|
345
|
+
/** @param {RegexNode} regex_101 */
|
|
346
|
+
pushRegex(regex_101) {
|
|
347
|
+
let return_102;
|
|
339
348
|
let t_103;
|
|
340
349
|
let t_104;
|
|
341
350
|
let t_105;
|
|
@@ -348,145 +357,147 @@ class RegexFormatter_89 {
|
|
|
348
357
|
let t_112;
|
|
349
358
|
let t_113;
|
|
350
359
|
let t_114;
|
|
360
|
+
let t_115;
|
|
361
|
+
let t_116;
|
|
351
362
|
try {
|
|
352
|
-
|
|
353
|
-
|
|
363
|
+
requireInstanceOf__117(regex_101, Capture);
|
|
364
|
+
t_103 = true;
|
|
354
365
|
} catch {
|
|
355
|
-
|
|
366
|
+
t_103 = false;
|
|
356
367
|
}
|
|
357
|
-
|
|
358
|
-
if (
|
|
368
|
+
s__1253_118: {
|
|
369
|
+
if (t_103) {
|
|
359
370
|
try {
|
|
360
|
-
|
|
371
|
+
t_104 = requireInstanceOf__117(regex_101, Capture);
|
|
361
372
|
} catch {
|
|
362
|
-
break
|
|
373
|
+
break s__1253_118;
|
|
363
374
|
}
|
|
364
|
-
this.pushCapture(
|
|
375
|
+
this.pushCapture(t_104);
|
|
365
376
|
} else {
|
|
366
377
|
try {
|
|
367
|
-
|
|
368
|
-
|
|
378
|
+
requireInstanceOf__117(regex_101, CodePoints);
|
|
379
|
+
t_105 = true;
|
|
369
380
|
} catch {
|
|
370
|
-
|
|
381
|
+
t_105 = false;
|
|
371
382
|
}
|
|
372
|
-
if (
|
|
383
|
+
if (t_105) {
|
|
373
384
|
try {
|
|
374
|
-
|
|
385
|
+
t_106 = requireInstanceOf__117(regex_101, CodePoints);
|
|
375
386
|
} catch {
|
|
376
|
-
break
|
|
387
|
+
break s__1253_118;
|
|
377
388
|
}
|
|
378
|
-
this.pushCodePoints(
|
|
389
|
+
this.pushCodePoints(t_106, false);
|
|
379
390
|
} else {
|
|
380
391
|
try {
|
|
381
|
-
|
|
382
|
-
|
|
392
|
+
requireInstanceOf__117(regex_101, CodeRange);
|
|
393
|
+
t_107 = true;
|
|
383
394
|
} catch {
|
|
384
|
-
|
|
395
|
+
t_107 = false;
|
|
385
396
|
}
|
|
386
|
-
if (
|
|
397
|
+
if (t_107) {
|
|
387
398
|
try {
|
|
388
|
-
|
|
399
|
+
t_108 = requireInstanceOf__117(regex_101, CodeRange);
|
|
389
400
|
} catch {
|
|
390
|
-
break
|
|
401
|
+
break s__1253_118;
|
|
391
402
|
}
|
|
392
|
-
this.pushCodeRange(
|
|
403
|
+
this.pushCodeRange(t_108);
|
|
393
404
|
} else {
|
|
394
405
|
try {
|
|
395
|
-
|
|
396
|
-
|
|
406
|
+
requireInstanceOf__117(regex_101, CodeSet);
|
|
407
|
+
t_109 = true;
|
|
397
408
|
} catch {
|
|
398
|
-
|
|
409
|
+
t_109 = false;
|
|
399
410
|
}
|
|
400
|
-
if (
|
|
411
|
+
if (t_109) {
|
|
401
412
|
try {
|
|
402
|
-
|
|
413
|
+
t_110 = requireInstanceOf__117(regex_101, CodeSet);
|
|
403
414
|
} catch {
|
|
404
|
-
break
|
|
415
|
+
break s__1253_118;
|
|
405
416
|
}
|
|
406
|
-
this.pushCodeSet(
|
|
417
|
+
this.pushCodeSet(t_110);
|
|
407
418
|
} else {
|
|
408
419
|
try {
|
|
409
|
-
|
|
410
|
-
|
|
420
|
+
requireInstanceOf__117(regex_101, Or);
|
|
421
|
+
t_111 = true;
|
|
411
422
|
} catch {
|
|
412
|
-
|
|
423
|
+
t_111 = false;
|
|
413
424
|
}
|
|
414
|
-
if (
|
|
425
|
+
if (t_111) {
|
|
415
426
|
try {
|
|
416
|
-
|
|
427
|
+
t_112 = requireInstanceOf__117(regex_101, Or);
|
|
417
428
|
} catch {
|
|
418
|
-
break
|
|
429
|
+
break s__1253_118;
|
|
419
430
|
}
|
|
420
|
-
this.pushOr(
|
|
431
|
+
this.pushOr(t_112);
|
|
421
432
|
} else {
|
|
422
433
|
try {
|
|
423
|
-
|
|
424
|
-
|
|
434
|
+
requireInstanceOf__117(regex_101, Repeat);
|
|
435
|
+
t_113 = true;
|
|
425
436
|
} catch {
|
|
426
|
-
|
|
437
|
+
t_113 = false;
|
|
427
438
|
}
|
|
428
|
-
if (
|
|
439
|
+
if (t_113) {
|
|
429
440
|
try {
|
|
430
|
-
|
|
441
|
+
t_114 = requireInstanceOf__117(regex_101, Repeat);
|
|
431
442
|
} catch {
|
|
432
|
-
break
|
|
443
|
+
break s__1253_118;
|
|
433
444
|
}
|
|
434
|
-
this.pushRepeat(
|
|
445
|
+
this.pushRepeat(t_114);
|
|
435
446
|
} else {
|
|
436
447
|
try {
|
|
437
|
-
|
|
438
|
-
|
|
448
|
+
requireInstanceOf__117(regex_101, Sequence);
|
|
449
|
+
t_115 = true;
|
|
439
450
|
} catch {
|
|
440
|
-
|
|
451
|
+
t_115 = false;
|
|
441
452
|
}
|
|
442
|
-
if (
|
|
453
|
+
if (t_115) {
|
|
443
454
|
try {
|
|
444
|
-
|
|
455
|
+
t_116 = requireInstanceOf__117(regex_101, Sequence);
|
|
445
456
|
} catch {
|
|
446
|
-
break
|
|
457
|
+
break s__1253_118;
|
|
447
458
|
}
|
|
448
|
-
this.pushSequence(
|
|
449
|
-
} else if (
|
|
459
|
+
this.pushSequence(t_116);
|
|
460
|
+
} else if (eqGeneric_119(regex_101, Begin)) {
|
|
450
461
|
try {
|
|
451
|
-
|
|
462
|
+
listBuilderAdd_120(this.#out_93, "^");
|
|
452
463
|
} catch {
|
|
453
|
-
break
|
|
464
|
+
break s__1253_118;
|
|
454
465
|
}
|
|
455
|
-
} else if (
|
|
466
|
+
} else if (eqGeneric_119(regex_101, Dot)) {
|
|
456
467
|
try {
|
|
457
|
-
|
|
468
|
+
listBuilderAdd_120(this.#out_93, ".");
|
|
458
469
|
} catch {
|
|
459
|
-
break
|
|
470
|
+
break s__1253_118;
|
|
460
471
|
}
|
|
461
|
-
} else if (
|
|
472
|
+
} else if (eqGeneric_119(regex_101, End)) {
|
|
462
473
|
try {
|
|
463
|
-
|
|
474
|
+
listBuilderAdd_120(this.#out_93, "\u0024");
|
|
464
475
|
} catch {
|
|
465
|
-
break
|
|
476
|
+
break s__1253_118;
|
|
466
477
|
}
|
|
467
|
-
} else if (
|
|
478
|
+
} else if (eqGeneric_119(regex_101, WordBoundary)) {
|
|
468
479
|
try {
|
|
469
|
-
|
|
480
|
+
listBuilderAdd_120(this.#out_93, "\\b");
|
|
470
481
|
} catch {
|
|
471
|
-
break
|
|
482
|
+
break s__1253_118;
|
|
472
483
|
}
|
|
473
|
-
} else if (
|
|
484
|
+
} else if (eqGeneric_119(regex_101, Digit)) {
|
|
474
485
|
try {
|
|
475
|
-
|
|
486
|
+
listBuilderAdd_120(this.#out_93, "\\d");
|
|
476
487
|
} catch {
|
|
477
|
-
break
|
|
488
|
+
break s__1253_118;
|
|
478
489
|
}
|
|
479
|
-
} else if (
|
|
490
|
+
} else if (eqGeneric_119(regex_101, Space)) {
|
|
480
491
|
try {
|
|
481
|
-
|
|
492
|
+
listBuilderAdd_120(this.#out_93, "\\s");
|
|
482
493
|
} catch {
|
|
483
|
-
break
|
|
494
|
+
break s__1253_118;
|
|
484
495
|
}
|
|
485
|
-
} else if (
|
|
496
|
+
} else if (eqGeneric_119(regex_101, Word)) {
|
|
486
497
|
try {
|
|
487
|
-
|
|
498
|
+
listBuilderAdd_120(this.#out_93, "\\w");
|
|
488
499
|
} catch {
|
|
489
|
-
break
|
|
500
|
+
break s__1253_118;
|
|
490
501
|
}
|
|
491
502
|
} else {
|
|
492
503
|
void 0;
|
|
@@ -497,227 +508,227 @@ class RegexFormatter_89 {
|
|
|
497
508
|
}
|
|
498
509
|
}
|
|
499
510
|
}
|
|
500
|
-
|
|
501
|
-
return
|
|
511
|
+
return_102 = void 0;
|
|
512
|
+
return return_102;
|
|
502
513
|
}
|
|
503
514
|
throw Error();
|
|
504
515
|
}
|
|
505
|
-
/** @param {Capture}
|
|
506
|
-
pushCapture(
|
|
507
|
-
|
|
508
|
-
let
|
|
509
|
-
let
|
|
510
|
-
this.pushCaptureName(
|
|
511
|
-
let
|
|
512
|
-
this.pushRegex(
|
|
513
|
-
|
|
516
|
+
/** @param {Capture} capture_122 */
|
|
517
|
+
pushCapture(capture_122) {
|
|
518
|
+
listBuilderAdd_120(this.#out_93, "(");
|
|
519
|
+
let t_123 = this.#out_93;
|
|
520
|
+
let t_124 = capture_122.name;
|
|
521
|
+
this.pushCaptureName(t_123, t_124);
|
|
522
|
+
let t_125 = capture_122.item;
|
|
523
|
+
this.pushRegex(t_125);
|
|
524
|
+
listBuilderAdd_120(this.#out_93, ")");
|
|
514
525
|
return;
|
|
515
526
|
}
|
|
516
527
|
/**
|
|
517
|
-
* @param {Array<string>}
|
|
518
|
-
* @param {string}
|
|
528
|
+
* @param {Array<string>} out_127
|
|
529
|
+
* @param {string} name_128
|
|
519
530
|
*/
|
|
520
|
-
pushCaptureName(
|
|
521
|
-
|
|
531
|
+
pushCaptureName(out_127, name_128) {
|
|
532
|
+
listBuilderAdd_120(out_127, strCat_129("?\u003c", name_128, "\u003e"));
|
|
522
533
|
return;
|
|
523
534
|
}
|
|
524
535
|
/**
|
|
525
|
-
* @param {number}
|
|
526
|
-
* @param {boolean}
|
|
536
|
+
* @param {number} code_131
|
|
537
|
+
* @param {boolean} insideCodeSet_132
|
|
527
538
|
*/
|
|
528
|
-
pushCode(
|
|
529
|
-
|
|
539
|
+
pushCode(code_131, insideCodeSet_132) {
|
|
540
|
+
regexFormatterPushCodeTo_133(this, this.#out_93, code_131, insideCodeSet_132);
|
|
530
541
|
return;
|
|
531
542
|
}
|
|
532
543
|
/**
|
|
533
|
-
* @param {CodePoints}
|
|
534
|
-
* @param {boolean}
|
|
544
|
+
* @param {CodePoints} codePoints_135
|
|
545
|
+
* @param {boolean} insideCodeSet_136
|
|
535
546
|
*/
|
|
536
|
-
pushCodePoints(
|
|
537
|
-
let
|
|
538
|
-
let
|
|
539
|
-
let
|
|
540
|
-
let
|
|
547
|
+
pushCodePoints(codePoints_135, insideCodeSet_136) {
|
|
548
|
+
let t_137;
|
|
549
|
+
let t_138;
|
|
550
|
+
let t_139 = stringCodePoints_140(codePoints_135.value);
|
|
551
|
+
let slice_141 = t_139;
|
|
541
552
|
while (true) {
|
|
542
|
-
if (!
|
|
543
|
-
|
|
544
|
-
this.pushCode(
|
|
545
|
-
|
|
546
|
-
|
|
553
|
+
if (! slice_141.isEmpty) {
|
|
554
|
+
t_137 = slice_141.read();
|
|
555
|
+
this.pushCode(t_137, insideCodeSet_136);
|
|
556
|
+
t_138 = slice_141.advance(1);
|
|
557
|
+
slice_141 = t_138;
|
|
547
558
|
} else {
|
|
548
559
|
break;
|
|
549
560
|
}
|
|
550
561
|
}
|
|
551
562
|
return;
|
|
552
563
|
}
|
|
553
|
-
/** @param {CodeRange}
|
|
554
|
-
pushCodeRange(
|
|
555
|
-
|
|
556
|
-
this.pushCodeRangeUnwrapped(
|
|
557
|
-
|
|
564
|
+
/** @param {CodeRange} codeRange_143 */
|
|
565
|
+
pushCodeRange(codeRange_143) {
|
|
566
|
+
listBuilderAdd_120(this.#out_93, "[");
|
|
567
|
+
this.pushCodeRangeUnwrapped(codeRange_143);
|
|
568
|
+
listBuilderAdd_120(this.#out_93, "]");
|
|
558
569
|
return;
|
|
559
570
|
}
|
|
560
|
-
/** @param {CodeRange}
|
|
561
|
-
pushCodeRangeUnwrapped(
|
|
562
|
-
let
|
|
563
|
-
this.pushCode(
|
|
564
|
-
|
|
565
|
-
let
|
|
566
|
-
this.pushCode(
|
|
571
|
+
/** @param {CodeRange} codeRange_145 */
|
|
572
|
+
pushCodeRangeUnwrapped(codeRange_145) {
|
|
573
|
+
let t_146 = codeRange_145.min;
|
|
574
|
+
this.pushCode(t_146, true);
|
|
575
|
+
listBuilderAdd_120(this.#out_93, "-");
|
|
576
|
+
let t_147 = codeRange_145.max;
|
|
577
|
+
this.pushCode(t_147, true);
|
|
567
578
|
return;
|
|
568
579
|
}
|
|
569
|
-
/** @param {CodeSet}
|
|
570
|
-
pushCodeSet(
|
|
571
|
-
let t_148;
|
|
572
|
-
let t_149;
|
|
580
|
+
/** @param {CodeSet} codeSet_149 */
|
|
581
|
+
pushCodeSet(codeSet_149) {
|
|
573
582
|
let t_150;
|
|
574
583
|
let t_151;
|
|
575
|
-
|
|
584
|
+
let t_152;
|
|
585
|
+
let t_153;
|
|
586
|
+
const adjusted_154 = regexFormatterAdjustCodeSet_155(this, codeSet_149, regexRefs_85);
|
|
576
587
|
try {
|
|
577
|
-
|
|
578
|
-
|
|
588
|
+
requireInstanceOf__117(adjusted_154, CodeSet);
|
|
589
|
+
t_151 = true;
|
|
579
590
|
} catch {
|
|
580
|
-
|
|
591
|
+
t_151 = false;
|
|
581
592
|
}
|
|
582
|
-
|
|
583
|
-
if (
|
|
584
|
-
|
|
593
|
+
s__1260_156: {
|
|
594
|
+
if (t_151) {
|
|
595
|
+
s__1261_157: {
|
|
585
596
|
try {
|
|
586
|
-
|
|
587
|
-
|
|
597
|
+
t_152 = requireInstanceOf__117(adjusted_154, CodeSet);
|
|
598
|
+
listBuilderAdd_120(this.#out_93, "[");
|
|
588
599
|
} catch {
|
|
589
|
-
break
|
|
600
|
+
break s__1261_157;
|
|
590
601
|
}
|
|
591
|
-
if (
|
|
602
|
+
if (t_152.negated) {
|
|
592
603
|
try {
|
|
593
|
-
|
|
604
|
+
listBuilderAdd_120(this.#out_93, "^");
|
|
594
605
|
} catch {
|
|
595
|
-
break
|
|
606
|
+
break s__1261_157;
|
|
596
607
|
}
|
|
597
608
|
} else {
|
|
598
609
|
void 0;
|
|
599
610
|
}
|
|
600
|
-
let
|
|
611
|
+
let i_158 = 0;
|
|
601
612
|
while (true) {
|
|
602
|
-
|
|
603
|
-
if (
|
|
613
|
+
t_150 = t_152.items.length;
|
|
614
|
+
if (i_158 < t_150) {
|
|
604
615
|
try {
|
|
605
|
-
|
|
616
|
+
t_153 = listedGet_159(t_152.items, i_158);
|
|
606
617
|
} catch {
|
|
607
|
-
break
|
|
618
|
+
break s__1261_157;
|
|
608
619
|
}
|
|
609
|
-
this.pushCodeSetItem(
|
|
610
|
-
|
|
620
|
+
this.pushCodeSetItem(t_153);
|
|
621
|
+
i_158 = i_158 + 1;
|
|
611
622
|
} else {
|
|
612
623
|
break;
|
|
613
624
|
}
|
|
614
625
|
}
|
|
615
626
|
try {
|
|
616
|
-
|
|
617
|
-
break
|
|
627
|
+
listBuilderAdd_120(this.#out_93, "]");
|
|
628
|
+
break s__1260_156;
|
|
618
629
|
} catch {
|
|
619
630
|
}
|
|
620
631
|
}
|
|
621
632
|
throw Error();
|
|
622
633
|
}
|
|
623
|
-
this.pushRegex(
|
|
634
|
+
this.pushRegex(adjusted_154);
|
|
624
635
|
}
|
|
625
636
|
return;
|
|
626
637
|
}
|
|
627
|
-
/** @param {CodePart}
|
|
628
|
-
pushCodeSetItem(
|
|
629
|
-
let
|
|
630
|
-
let t_161;
|
|
631
|
-
let t_162;
|
|
638
|
+
/** @param {CodePart} codePart_161 */
|
|
639
|
+
pushCodeSetItem(codePart_161) {
|
|
640
|
+
let return_162;
|
|
632
641
|
let t_163;
|
|
633
642
|
let t_164;
|
|
634
643
|
let t_165;
|
|
635
644
|
let t_166;
|
|
645
|
+
let t_167;
|
|
646
|
+
let t_168;
|
|
636
647
|
try {
|
|
637
|
-
|
|
638
|
-
|
|
648
|
+
requireInstanceOf__117(codePart_161, CodePoints);
|
|
649
|
+
t_163 = true;
|
|
639
650
|
} catch {
|
|
640
|
-
|
|
651
|
+
t_163 = false;
|
|
641
652
|
}
|
|
642
|
-
|
|
643
|
-
if (
|
|
653
|
+
s__1266_169: {
|
|
654
|
+
if (t_163) {
|
|
644
655
|
try {
|
|
645
|
-
|
|
656
|
+
t_164 = requireInstanceOf__117(codePart_161, CodePoints);
|
|
646
657
|
} catch {
|
|
647
|
-
break
|
|
658
|
+
break s__1266_169;
|
|
648
659
|
}
|
|
649
|
-
this.pushCodePoints(
|
|
660
|
+
this.pushCodePoints(t_164, true);
|
|
650
661
|
} else {
|
|
651
662
|
try {
|
|
652
|
-
|
|
653
|
-
|
|
663
|
+
requireInstanceOf__117(codePart_161, CodeRange);
|
|
664
|
+
t_165 = true;
|
|
654
665
|
} catch {
|
|
655
|
-
|
|
666
|
+
t_165 = false;
|
|
656
667
|
}
|
|
657
|
-
if (
|
|
668
|
+
if (t_165) {
|
|
658
669
|
try {
|
|
659
|
-
|
|
670
|
+
t_166 = requireInstanceOf__117(codePart_161, CodeRange);
|
|
660
671
|
} catch {
|
|
661
|
-
break
|
|
672
|
+
break s__1266_169;
|
|
662
673
|
}
|
|
663
|
-
this.pushCodeRangeUnwrapped(
|
|
674
|
+
this.pushCodeRangeUnwrapped(t_166);
|
|
664
675
|
} else {
|
|
665
676
|
try {
|
|
666
|
-
|
|
667
|
-
|
|
677
|
+
requireInstanceOf__117(codePart_161, SpecialSet);
|
|
678
|
+
t_167 = true;
|
|
668
679
|
} catch {
|
|
669
|
-
|
|
680
|
+
t_167 = false;
|
|
670
681
|
}
|
|
671
|
-
if (
|
|
682
|
+
if (t_167) {
|
|
672
683
|
try {
|
|
673
|
-
|
|
684
|
+
t_168 = requireInstanceOf__117(codePart_161, SpecialSet);
|
|
674
685
|
} catch {
|
|
675
|
-
break
|
|
686
|
+
break s__1266_169;
|
|
676
687
|
}
|
|
677
|
-
this.pushRegex(
|
|
688
|
+
this.pushRegex(t_168);
|
|
678
689
|
} else {
|
|
679
690
|
void 0;
|
|
680
691
|
}
|
|
681
692
|
}
|
|
682
693
|
}
|
|
683
|
-
|
|
684
|
-
return
|
|
694
|
+
return_162 = void 0;
|
|
695
|
+
return return_162;
|
|
685
696
|
}
|
|
686
697
|
throw Error();
|
|
687
698
|
}
|
|
688
|
-
/** @param {Or}
|
|
689
|
-
pushOr(
|
|
690
|
-
let t_170;
|
|
691
|
-
let t_171;
|
|
699
|
+
/** @param {Or} or_171 */
|
|
700
|
+
pushOr(or_171) {
|
|
692
701
|
let t_172;
|
|
693
|
-
|
|
694
|
-
|
|
702
|
+
let t_173;
|
|
703
|
+
let t_174;
|
|
704
|
+
s__1268_175: if (! ! or_171.items.length) {
|
|
705
|
+
s__1269_176: {
|
|
695
706
|
try {
|
|
696
|
-
|
|
697
|
-
|
|
707
|
+
listBuilderAdd_120(this.#out_93, "(?:");
|
|
708
|
+
t_173 = listedGet_159(or_171.items, 0);
|
|
698
709
|
} catch {
|
|
699
|
-
break
|
|
710
|
+
break s__1269_176;
|
|
700
711
|
}
|
|
701
|
-
this.pushRegex(
|
|
702
|
-
let
|
|
712
|
+
this.pushRegex(t_173);
|
|
713
|
+
let i_177 = 1;
|
|
703
714
|
while (true) {
|
|
704
|
-
|
|
705
|
-
if (
|
|
715
|
+
t_172 = or_171.items.length;
|
|
716
|
+
if (i_177 < t_172) {
|
|
706
717
|
try {
|
|
707
|
-
|
|
708
|
-
|
|
718
|
+
listBuilderAdd_120(this.#out_93, "|");
|
|
719
|
+
t_174 = listedGet_159(or_171.items, i_177);
|
|
709
720
|
} catch {
|
|
710
721
|
break;
|
|
711
722
|
}
|
|
712
|
-
this.pushRegex(
|
|
713
|
-
|
|
723
|
+
this.pushRegex(t_174);
|
|
724
|
+
i_177 = i_177 + 1;
|
|
714
725
|
} else {
|
|
715
726
|
try {
|
|
716
|
-
|
|
727
|
+
listBuilderAdd_120(this.#out_93, ")");
|
|
717
728
|
} catch {
|
|
718
|
-
break
|
|
729
|
+
break s__1269_176;
|
|
719
730
|
}
|
|
720
|
-
break
|
|
731
|
+
break s__1268_175;
|
|
721
732
|
}
|
|
722
733
|
}
|
|
723
734
|
}
|
|
@@ -725,82 +736,82 @@ class RegexFormatter_89 {
|
|
|
725
736
|
}
|
|
726
737
|
return;
|
|
727
738
|
}
|
|
728
|
-
/** @param {Repeat}
|
|
729
|
-
pushRepeat(
|
|
730
|
-
let
|
|
731
|
-
let t_179;
|
|
732
|
-
let t_180;
|
|
739
|
+
/** @param {Repeat} repeat_179 */
|
|
740
|
+
pushRepeat(repeat_179) {
|
|
741
|
+
let return_180;
|
|
733
742
|
let t_181;
|
|
734
743
|
let t_182;
|
|
735
744
|
let t_183;
|
|
736
745
|
let t_184;
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
746
|
+
let t_185;
|
|
747
|
+
let t_186;
|
|
748
|
+
s__1273_187: {
|
|
749
|
+
let min_188;
|
|
750
|
+
let max_189;
|
|
740
751
|
try {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
this.pushRegex(
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
752
|
+
listBuilderAdd_120(this.#out_93, "(?:");
|
|
753
|
+
t_181 = repeat_179.item;
|
|
754
|
+
this.pushRegex(t_181);
|
|
755
|
+
listBuilderAdd_120(this.#out_93, ")");
|
|
756
|
+
min_188 = repeat_179.min;
|
|
757
|
+
max_189 = repeat_179.max;
|
|
747
758
|
} catch {
|
|
748
|
-
break
|
|
759
|
+
break s__1273_187;
|
|
749
760
|
}
|
|
750
|
-
if (
|
|
751
|
-
|
|
761
|
+
if (min_188 === 0) {
|
|
762
|
+
t_182 = max_189 === 1;
|
|
752
763
|
} else {
|
|
753
|
-
|
|
764
|
+
t_182 = false;
|
|
754
765
|
}
|
|
755
|
-
if (
|
|
766
|
+
if (t_182) {
|
|
756
767
|
try {
|
|
757
|
-
|
|
768
|
+
listBuilderAdd_120(this.#out_93, "?");
|
|
758
769
|
} catch {
|
|
759
|
-
break
|
|
770
|
+
break s__1273_187;
|
|
760
771
|
}
|
|
761
772
|
} else {
|
|
762
|
-
if (
|
|
763
|
-
|
|
773
|
+
if (min_188 === 0) {
|
|
774
|
+
t_183 = max_189 === null;
|
|
764
775
|
} else {
|
|
765
|
-
|
|
776
|
+
t_183 = false;
|
|
766
777
|
}
|
|
767
|
-
if (
|
|
778
|
+
if (t_183) {
|
|
768
779
|
try {
|
|
769
|
-
|
|
780
|
+
listBuilderAdd_120(this.#out_93, "*");
|
|
770
781
|
} catch {
|
|
771
|
-
break
|
|
782
|
+
break s__1273_187;
|
|
772
783
|
}
|
|
773
784
|
} else {
|
|
774
|
-
if (
|
|
775
|
-
|
|
785
|
+
if (min_188 === 1) {
|
|
786
|
+
t_184 = max_189 === null;
|
|
776
787
|
} else {
|
|
777
|
-
|
|
788
|
+
t_184 = false;
|
|
778
789
|
}
|
|
779
|
-
if (
|
|
790
|
+
if (t_184) {
|
|
780
791
|
try {
|
|
781
|
-
|
|
792
|
+
listBuilderAdd_120(this.#out_93, "+");
|
|
782
793
|
} catch {
|
|
783
|
-
break
|
|
794
|
+
break s__1273_187;
|
|
784
795
|
}
|
|
785
796
|
} else {
|
|
786
797
|
try {
|
|
787
|
-
|
|
798
|
+
listBuilderAdd_120(this.#out_93, strCat_129("{", intToString_190(min_188)));
|
|
788
799
|
} catch {
|
|
789
|
-
break
|
|
800
|
+
break s__1273_187;
|
|
790
801
|
}
|
|
791
|
-
if (
|
|
802
|
+
if (min_188 !== max_189) {
|
|
792
803
|
try {
|
|
793
|
-
|
|
804
|
+
listBuilderAdd_120(this.#out_93, ",");
|
|
794
805
|
} catch {
|
|
795
|
-
break
|
|
806
|
+
break s__1273_187;
|
|
796
807
|
}
|
|
797
|
-
if (
|
|
798
|
-
|
|
808
|
+
if (max_189 !== null) {
|
|
809
|
+
t_186 = this.#out_93;
|
|
799
810
|
try {
|
|
800
|
-
|
|
801
|
-
|
|
811
|
+
t_185 = requireIsSafeInteger__191(max_189);
|
|
812
|
+
listBuilderAdd_120(t_186, intToString_190(t_185));
|
|
802
813
|
} catch {
|
|
803
|
-
break
|
|
814
|
+
break s__1273_187;
|
|
804
815
|
}
|
|
805
816
|
} else {
|
|
806
817
|
void 0;
|
|
@@ -809,61 +820,59 @@ class RegexFormatter_89 {
|
|
|
809
820
|
void 0;
|
|
810
821
|
}
|
|
811
822
|
try {
|
|
812
|
-
|
|
823
|
+
listBuilderAdd_120(this.#out_93, "}");
|
|
813
824
|
} catch {
|
|
814
|
-
break
|
|
825
|
+
break s__1273_187;
|
|
815
826
|
}
|
|
816
827
|
}
|
|
817
828
|
}
|
|
818
829
|
}
|
|
819
|
-
if (
|
|
830
|
+
if (repeat_179.reluctant) {
|
|
820
831
|
try {
|
|
821
|
-
|
|
832
|
+
listBuilderAdd_120(this.#out_93, "?");
|
|
822
833
|
} catch {
|
|
823
|
-
break
|
|
834
|
+
break s__1273_187;
|
|
824
835
|
}
|
|
825
836
|
} else {
|
|
826
837
|
void 0;
|
|
827
838
|
}
|
|
828
|
-
|
|
829
|
-
return
|
|
839
|
+
return_180 = void 0;
|
|
840
|
+
return return_180;
|
|
830
841
|
}
|
|
831
842
|
throw Error();
|
|
832
843
|
}
|
|
833
|
-
/** @param {Sequence}
|
|
834
|
-
pushSequence(
|
|
835
|
-
let
|
|
836
|
-
let
|
|
837
|
-
let
|
|
838
|
-
let
|
|
839
|
-
|
|
844
|
+
/** @param {Sequence} sequence_193 */
|
|
845
|
+
pushSequence(sequence_193) {
|
|
846
|
+
let return_194;
|
|
847
|
+
let t_195;
|
|
848
|
+
let t_196;
|
|
849
|
+
let i_197 = 0;
|
|
850
|
+
s__1276_198: {
|
|
840
851
|
while (true) {
|
|
841
|
-
|
|
842
|
-
if (
|
|
852
|
+
t_195 = sequence_193.items.length;
|
|
853
|
+
if (i_197 < t_195) {
|
|
843
854
|
try {
|
|
844
|
-
|
|
855
|
+
t_196 = listedGet_159(sequence_193.items, i_197);
|
|
845
856
|
} catch {
|
|
846
857
|
break;
|
|
847
858
|
}
|
|
848
|
-
this.pushRegex(
|
|
849
|
-
|
|
859
|
+
this.pushRegex(t_196);
|
|
860
|
+
i_197 = i_197 + 1;
|
|
850
861
|
} else {
|
|
851
|
-
|
|
852
|
-
break
|
|
862
|
+
return_194 = void 0;
|
|
863
|
+
break s__1276_198;
|
|
853
864
|
}
|
|
854
865
|
}
|
|
855
866
|
throw Error();
|
|
856
867
|
}
|
|
857
|
-
return
|
|
868
|
+
return return_194;
|
|
858
869
|
}
|
|
859
870
|
/**
|
|
860
|
-
* @param {CodePart}
|
|
871
|
+
* @param {CodePart} codePart_200
|
|
861
872
|
* @returns {number | null}
|
|
862
873
|
*/
|
|
863
|
-
maxCode(
|
|
864
|
-
let
|
|
865
|
-
let t_200;
|
|
866
|
-
let t_201;
|
|
874
|
+
maxCode(codePart_200) {
|
|
875
|
+
let return_201;
|
|
867
876
|
let t_202;
|
|
868
877
|
let t_203;
|
|
869
878
|
let t_204;
|
|
@@ -872,181 +881,183 @@ class RegexFormatter_89 {
|
|
|
872
881
|
let t_207;
|
|
873
882
|
let t_208;
|
|
874
883
|
let t_209;
|
|
884
|
+
let t_210;
|
|
885
|
+
let t_211;
|
|
875
886
|
try {
|
|
876
|
-
|
|
877
|
-
|
|
887
|
+
requireInstanceOf__117(codePart_200, CodePoints);
|
|
888
|
+
t_208 = true;
|
|
878
889
|
} catch {
|
|
879
|
-
|
|
890
|
+
t_208 = false;
|
|
880
891
|
}
|
|
881
|
-
|
|
882
|
-
if (
|
|
892
|
+
s__1278_212: {
|
|
893
|
+
if (t_208) {
|
|
883
894
|
try {
|
|
884
|
-
|
|
895
|
+
t_209 = requireInstanceOf__117(codePart_200, CodePoints);
|
|
885
896
|
} catch {
|
|
886
|
-
break
|
|
897
|
+
break s__1278_212;
|
|
887
898
|
}
|
|
888
|
-
const
|
|
889
|
-
if (!
|
|
890
|
-
|
|
899
|
+
const value_213 = t_209.value;
|
|
900
|
+
if (! value_213) {
|
|
901
|
+
return_201 = null;
|
|
891
902
|
} else {
|
|
892
|
-
let
|
|
893
|
-
|
|
894
|
-
let
|
|
903
|
+
let max_214 = 0;
|
|
904
|
+
t_202 = stringCodePoints_140(value_213);
|
|
905
|
+
let slice_215 = t_202;
|
|
895
906
|
while (true) {
|
|
896
|
-
if (!
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
|
|
907
|
+
if (! slice_215.isEmpty) {
|
|
908
|
+
const next_216 = slice_215.read();
|
|
909
|
+
if (next_216 > max_214) {
|
|
910
|
+
max_214 = next_216;
|
|
900
911
|
} else {
|
|
901
912
|
void 0;
|
|
902
913
|
}
|
|
903
|
-
|
|
904
|
-
|
|
914
|
+
t_203 = slice_215.advance(1);
|
|
915
|
+
slice_215 = t_203;
|
|
905
916
|
} else {
|
|
906
917
|
break;
|
|
907
918
|
}
|
|
908
919
|
}
|
|
909
|
-
|
|
920
|
+
return_201 = max_214;
|
|
910
921
|
}
|
|
911
922
|
} else {
|
|
912
923
|
try {
|
|
913
|
-
|
|
914
|
-
|
|
924
|
+
requireInstanceOf__117(codePart_200, CodeRange);
|
|
925
|
+
t_210 = true;
|
|
915
926
|
} catch {
|
|
916
|
-
|
|
927
|
+
t_210 = false;
|
|
917
928
|
}
|
|
918
|
-
if (
|
|
929
|
+
if (t_210) {
|
|
919
930
|
try {
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
931
|
+
t_211 = requireInstanceOf__117(codePart_200, CodeRange);
|
|
932
|
+
t_204 = t_211.max;
|
|
933
|
+
return_201 = t_204;
|
|
923
934
|
} catch {
|
|
924
|
-
break
|
|
935
|
+
break s__1278_212;
|
|
925
936
|
}
|
|
926
|
-
} else if (
|
|
927
|
-
|
|
937
|
+
} else if (eqGeneric_119(codePart_200, Digit)) {
|
|
938
|
+
t_205 = stringCodePoints_140("9").read();
|
|
928
939
|
try {
|
|
929
|
-
|
|
940
|
+
return_201 = t_205;
|
|
930
941
|
} catch {
|
|
931
|
-
break
|
|
942
|
+
break s__1278_212;
|
|
932
943
|
}
|
|
933
|
-
} else if (
|
|
934
|
-
|
|
944
|
+
} else if (eqGeneric_119(codePart_200, Space)) {
|
|
945
|
+
t_206 = stringCodePoints_140(" ").read();
|
|
935
946
|
try {
|
|
936
|
-
|
|
947
|
+
return_201 = t_206;
|
|
937
948
|
} catch {
|
|
938
|
-
break
|
|
949
|
+
break s__1278_212;
|
|
939
950
|
}
|
|
940
|
-
} else if (
|
|
941
|
-
|
|
951
|
+
} else if (eqGeneric_119(codePart_200, Word)) {
|
|
952
|
+
t_207 = stringCodePoints_140("z").read();
|
|
942
953
|
try {
|
|
943
|
-
|
|
954
|
+
return_201 = t_207;
|
|
944
955
|
} catch {
|
|
945
|
-
break
|
|
956
|
+
break s__1278_212;
|
|
946
957
|
}
|
|
947
958
|
} else {
|
|
948
|
-
|
|
959
|
+
return_201 = null;
|
|
949
960
|
}
|
|
950
961
|
}
|
|
951
|
-
return
|
|
962
|
+
return return_201;
|
|
952
963
|
}
|
|
953
964
|
throw Error();
|
|
954
965
|
}
|
|
955
|
-
/** @param {Array<string>}
|
|
956
|
-
constructor(
|
|
957
|
-
let
|
|
958
|
-
if (!(
|
|
959
|
-
|
|
960
|
-
|
|
966
|
+
/** @param {Array<string>} out_217 */
|
|
967
|
+
constructor(out_217) {
|
|
968
|
+
let t_218;
|
|
969
|
+
if (!(out_217 !== void 0)) {
|
|
970
|
+
t_218 = [];
|
|
971
|
+
out_217 = t_218;
|
|
961
972
|
}
|
|
962
|
-
this.#
|
|
973
|
+
this.#out_93 = out_217;
|
|
963
974
|
return;
|
|
964
975
|
}
|
|
965
976
|
}
|
|
966
|
-
/** @type {
|
|
967
|
-
const
|
|
968
|
-
class
|
|
977
|
+
/** @type {RegexRefs_59} */
|
|
978
|
+
const regexRefs_85 = new RegexRefs_59();
|
|
979
|
+
class Begin_219 {
|
|
969
980
|
constructor() {
|
|
970
981
|
return;
|
|
971
982
|
}
|
|
972
983
|
}
|
|
973
|
-
Special.implementedBy(
|
|
984
|
+
Special.implementedBy(Begin_219);
|
|
974
985
|
/** @type {Special} */
|
|
975
|
-
export const Begin = new
|
|
976
|
-
class
|
|
986
|
+
export const Begin = new Begin_219();
|
|
987
|
+
class Dot_220 {
|
|
977
988
|
constructor() {
|
|
978
989
|
return;
|
|
979
990
|
}
|
|
980
991
|
}
|
|
981
|
-
Special.implementedBy(
|
|
992
|
+
Special.implementedBy(Dot_220);
|
|
982
993
|
/** @type {Special} */
|
|
983
|
-
export const Dot = new
|
|
984
|
-
class
|
|
994
|
+
export const Dot = new Dot_220();
|
|
995
|
+
class End_221 {
|
|
985
996
|
constructor() {
|
|
986
997
|
return;
|
|
987
998
|
}
|
|
988
999
|
}
|
|
989
|
-
Special.implementedBy(
|
|
1000
|
+
Special.implementedBy(End_221);
|
|
990
1001
|
/** @type {Special} */
|
|
991
|
-
export const End = new
|
|
992
|
-
class
|
|
1002
|
+
export const End = new End_221();
|
|
1003
|
+
class WordBoundary_222 {
|
|
993
1004
|
constructor() {
|
|
994
1005
|
return;
|
|
995
1006
|
}
|
|
996
1007
|
}
|
|
997
|
-
Special.implementedBy(
|
|
1008
|
+
Special.implementedBy(WordBoundary_222);
|
|
998
1009
|
/** @type {Special} */
|
|
999
|
-
export const WordBoundary = new
|
|
1000
|
-
class
|
|
1010
|
+
export const WordBoundary = new WordBoundary_222();
|
|
1011
|
+
class Digit_223 {
|
|
1001
1012
|
constructor() {
|
|
1002
1013
|
return;
|
|
1003
1014
|
}
|
|
1004
1015
|
}
|
|
1005
|
-
SpecialSet.implementedBy(
|
|
1016
|
+
SpecialSet.implementedBy(Digit_223);
|
|
1006
1017
|
/** @type {SpecialSet} */
|
|
1007
|
-
export const Digit = new
|
|
1008
|
-
class
|
|
1018
|
+
export const Digit = new Digit_223();
|
|
1019
|
+
class Space_224 {
|
|
1009
1020
|
constructor() {
|
|
1010
1021
|
return;
|
|
1011
1022
|
}
|
|
1012
1023
|
}
|
|
1013
|
-
SpecialSet.implementedBy(
|
|
1024
|
+
SpecialSet.implementedBy(Space_224);
|
|
1014
1025
|
/** @type {SpecialSet} */
|
|
1015
|
-
export const Space = new
|
|
1016
|
-
class
|
|
1026
|
+
export const Space = new Space_224();
|
|
1027
|
+
class Word_225 {
|
|
1017
1028
|
constructor() {
|
|
1018
1029
|
return;
|
|
1019
1030
|
}
|
|
1020
1031
|
}
|
|
1021
|
-
SpecialSet.implementedBy(
|
|
1032
|
+
SpecialSet.implementedBy(Word_225);
|
|
1022
1033
|
/** @type {SpecialSet} */
|
|
1023
|
-
export const Word = new
|
|
1034
|
+
export const Word = new Word_225();
|
|
1024
1035
|
/**
|
|
1025
|
-
* @param {
|
|
1026
|
-
* @returns {
|
|
1036
|
+
* @param {RegexNode} item_226
|
|
1037
|
+
* @returns {RegexNode}
|
|
1027
1038
|
*/
|
|
1028
|
-
export function entire(
|
|
1029
|
-
return new Sequence(
|
|
1039
|
+
export function entire(item_226) {
|
|
1040
|
+
return new Sequence(listify_69(Begin, item_226, End));
|
|
1030
1041
|
};
|
|
1031
1042
|
/**
|
|
1032
|
-
* @param {
|
|
1033
|
-
* @param {boolean}
|
|
1043
|
+
* @param {RegexNode} item_227
|
|
1044
|
+
* @param {boolean} reluctant_228
|
|
1034
1045
|
* @returns {Repeat}
|
|
1035
1046
|
*/
|
|
1036
|
-
export function oneOrMore(
|
|
1037
|
-
if (!(
|
|
1038
|
-
|
|
1047
|
+
export function oneOrMore(item_227, reluctant_228) {
|
|
1048
|
+
if (!(reluctant_228 !== void 0)) {
|
|
1049
|
+
reluctant_228 = false;
|
|
1039
1050
|
}
|
|
1040
|
-
return new Repeat(
|
|
1051
|
+
return new Repeat(item_227, 1, null, reluctant_228);
|
|
1041
1052
|
};
|
|
1042
1053
|
/**
|
|
1043
|
-
* @param {
|
|
1044
|
-
* @param {boolean}
|
|
1054
|
+
* @param {RegexNode} item_229
|
|
1055
|
+
* @param {boolean} reluctant_230
|
|
1045
1056
|
* @returns {Repeat}
|
|
1046
1057
|
*/
|
|
1047
|
-
export function optional(
|
|
1048
|
-
if (!(
|
|
1049
|
-
|
|
1058
|
+
export function optional(item_229, reluctant_230) {
|
|
1059
|
+
if (!(reluctant_230 !== void 0)) {
|
|
1060
|
+
reluctant_230 = false;
|
|
1050
1061
|
}
|
|
1051
|
-
return new Repeat(
|
|
1062
|
+
return new Repeat(item_229, 0, 1, reluctant_230);
|
|
1052
1063
|
};
|