@temperlang/std 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -0
- package/json.js +2033 -0
- package/json.js.map +1 -0
- package/package.json +4 -2
- package/regex.js +1040 -807
- package/regex.js.map +1 -1
- package/strings.js +1 -0
- package/strings.js.map +1 -0
- package/temporal.js +90 -38
- package/temporal.js.map +1 -1
- package/testing.js +117 -147
- package/testing.js.map +1 -1
package/regex.js
CHANGED
|
@@ -1,631 +1,498 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
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
|
|
3
3
|
} from "@temperlang/core";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
export class RegexNode extends type__10() {
|
|
5
|
+
/** @returns {Regex} */
|
|
6
|
+
compiled() {
|
|
7
|
+
return new Regex(this);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} text_2
|
|
11
|
+
* @returns {boolean}
|
|
12
|
+
*/
|
|
13
|
+
found(text_2) {
|
|
14
|
+
return this.compiled().found(text_2);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @param {string} text_4
|
|
18
|
+
* @returns {Match}
|
|
19
|
+
*/
|
|
20
|
+
find(text_4) {
|
|
21
|
+
return this.compiled().find(text_4);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @param {string} text_6
|
|
25
|
+
* @param {(arg0: Match) => string} format_7
|
|
26
|
+
* @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
replace(text_6, format_7) {
|
|
29
|
+
return this.compiled().replace(text_6, format_7);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} text_9
|
|
33
|
+
* @returns {Array<string>}
|
|
34
|
+
*/
|
|
35
|
+
split(text_9) {
|
|
36
|
+
return this.compiled().split(text_9);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export class Capture extends type__10(RegexNode) {
|
|
24
40
|
/** @type {string} */
|
|
25
|
-
#
|
|
26
|
-
/** @type {
|
|
27
|
-
#
|
|
41
|
+
#name_11;
|
|
42
|
+
/** @type {RegexNode} */
|
|
43
|
+
#item_12;
|
|
28
44
|
/**
|
|
29
|
-
* @param {string}
|
|
30
|
-
* @param {
|
|
45
|
+
* @param {string} name_13
|
|
46
|
+
* @param {RegexNode} item_14
|
|
31
47
|
*/
|
|
32
|
-
constructor(
|
|
33
|
-
|
|
34
|
-
this.#
|
|
48
|
+
constructor(name_13, item_14) {
|
|
49
|
+
super ();
|
|
50
|
+
this.#name_11 = name_13;
|
|
51
|
+
this.#item_12 = item_14;
|
|
35
52
|
return;
|
|
36
53
|
}
|
|
37
54
|
/** @returns {string} */
|
|
38
55
|
get name() {
|
|
39
|
-
return this.#
|
|
56
|
+
return this.#name_11;
|
|
40
57
|
}
|
|
41
|
-
/** @returns {
|
|
58
|
+
/** @returns {RegexNode} */
|
|
42
59
|
get item() {
|
|
43
|
-
return this.#
|
|
60
|
+
return this.#item_12;
|
|
44
61
|
}
|
|
45
62
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* CodePart
|
|
50
|
-
*/
|
|
51
|
-
export const CodePart = new InterfaceType_0("CodePart", [], [Regex], 2);
|
|
52
|
-
export class CodePoints {
|
|
63
|
+
export class CodePart extends type__10(RegexNode) {
|
|
64
|
+
};
|
|
65
|
+
export class CodePoints extends type__10(CodePart) {
|
|
53
66
|
/** @type {string} */
|
|
54
|
-
#
|
|
55
|
-
/** @param {string}
|
|
56
|
-
constructor(
|
|
57
|
-
|
|
67
|
+
#value_17;
|
|
68
|
+
/** @param {string} value_18 */
|
|
69
|
+
constructor(value_18) {
|
|
70
|
+
super ();
|
|
71
|
+
this.#value_17 = value_18;
|
|
58
72
|
return;
|
|
59
73
|
}
|
|
60
74
|
/** @returns {string} */
|
|
61
75
|
get value() {
|
|
62
|
-
return this.#
|
|
76
|
+
return this.#value_17;
|
|
63
77
|
}
|
|
64
78
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export const Special = new InterfaceType_0("Special", [], [Regex], 2);
|
|
71
|
-
/**
|
|
72
|
-
* @typedef {{}}
|
|
73
|
-
* SpecialSet
|
|
74
|
-
*/
|
|
75
|
-
export const SpecialSet = new InterfaceType_0("SpecialSet", [], [CodePart, Special], 3);
|
|
76
|
-
export class CodeRange {
|
|
79
|
+
export class Special extends type__10(RegexNode) {
|
|
80
|
+
};
|
|
81
|
+
export class SpecialSet extends type__10(CodePart, Special) {
|
|
82
|
+
};
|
|
83
|
+
export class CodeRange extends type__10(CodePart) {
|
|
77
84
|
/** @type {number} */
|
|
78
|
-
#
|
|
85
|
+
#min_20;
|
|
79
86
|
/** @type {number} */
|
|
80
|
-
#
|
|
87
|
+
#max_21;
|
|
81
88
|
/**
|
|
82
|
-
* @param {number}
|
|
83
|
-
* @param {number}
|
|
89
|
+
* @param {number} min_22
|
|
90
|
+
* @param {number} max_23
|
|
84
91
|
*/
|
|
85
|
-
constructor(
|
|
86
|
-
|
|
87
|
-
this.#
|
|
92
|
+
constructor(min_22, max_23) {
|
|
93
|
+
super ();
|
|
94
|
+
this.#min_20 = min_22;
|
|
95
|
+
this.#max_21 = max_23;
|
|
88
96
|
return;
|
|
89
97
|
}
|
|
90
98
|
/** @returns {number} */
|
|
91
99
|
get min() {
|
|
92
|
-
return this.#
|
|
100
|
+
return this.#min_20;
|
|
93
101
|
}
|
|
94
102
|
/** @returns {number} */
|
|
95
103
|
get max() {
|
|
96
|
-
return this.#
|
|
104
|
+
return this.#max_21;
|
|
97
105
|
}
|
|
98
106
|
};
|
|
99
|
-
|
|
100
|
-
export class
|
|
107
|
+
/** @template ITEM_27 */
|
|
108
|
+
export class ItemizedRegex extends type__10(RegexNode) {
|
|
109
|
+
};
|
|
110
|
+
export class CodeSet extends type__10(ItemizedRegex) {
|
|
101
111
|
/** @type {Array<CodePart>} */
|
|
102
|
-
#
|
|
112
|
+
#items_28;
|
|
103
113
|
/** @type {boolean} */
|
|
104
|
-
#
|
|
114
|
+
#negated_29;
|
|
105
115
|
/**
|
|
106
|
-
* @param {Array<CodePart>}
|
|
107
|
-
* @param {boolean}
|
|
116
|
+
* @param {Array<CodePart>} items_30
|
|
117
|
+
* @param {boolean | null} [negated_31]
|
|
108
118
|
*/
|
|
109
|
-
constructor(
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
constructor(items_30, negated_31) {
|
|
120
|
+
super ();
|
|
121
|
+
let negated_32;
|
|
122
|
+
if (negated_31 == null) {
|
|
123
|
+
negated_32 = false;
|
|
124
|
+
} else {
|
|
125
|
+
negated_32 = negated_31;
|
|
112
126
|
}
|
|
113
|
-
this.#
|
|
114
|
-
this.#
|
|
127
|
+
this.#items_28 = items_30;
|
|
128
|
+
this.#negated_29 = negated_32;
|
|
115
129
|
return;
|
|
116
130
|
}
|
|
117
131
|
/** @returns {Array<CodePart>} */
|
|
118
132
|
get items() {
|
|
119
|
-
return this.#
|
|
133
|
+
return this.#items_28;
|
|
120
134
|
}
|
|
121
135
|
/** @returns {boolean} */
|
|
122
136
|
get negated() {
|
|
123
|
-
return this.#
|
|
137
|
+
return this.#negated_29;
|
|
124
138
|
}
|
|
125
139
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.#
|
|
140
|
+
export class Or extends type__10(ItemizedRegex) {
|
|
141
|
+
/** @type {Array<RegexNode>} */
|
|
142
|
+
#items_35;
|
|
143
|
+
/** @param {Array<RegexNode>} items_36 */
|
|
144
|
+
constructor(items_36) {
|
|
145
|
+
super ();
|
|
146
|
+
this.#items_35 = items_36;
|
|
133
147
|
return;
|
|
134
148
|
}
|
|
135
|
-
/** @returns {Array<
|
|
149
|
+
/** @returns {Array<RegexNode>} */
|
|
136
150
|
get items() {
|
|
137
|
-
return this.#
|
|
151
|
+
return this.#items_35;
|
|
138
152
|
}
|
|
139
153
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
#item_33;
|
|
154
|
+
export class Repeat extends type__10(RegexNode) {
|
|
155
|
+
/** @type {RegexNode} */
|
|
156
|
+
#item_38;
|
|
144
157
|
/** @type {number} */
|
|
145
|
-
#
|
|
158
|
+
#min_39;
|
|
146
159
|
/** @type {number | null} */
|
|
147
|
-
#
|
|
160
|
+
#max_40;
|
|
148
161
|
/** @type {boolean} */
|
|
149
|
-
#
|
|
162
|
+
#reluctant_41;
|
|
150
163
|
/**
|
|
151
|
-
* @param {
|
|
152
|
-
* @param {number}
|
|
153
|
-
* @param {number | null}
|
|
154
|
-
* @param {boolean}
|
|
164
|
+
* @param {RegexNode} item_42
|
|
165
|
+
* @param {number} min_43
|
|
166
|
+
* @param {number | null} max_44
|
|
167
|
+
* @param {boolean | null} [reluctant_45]
|
|
155
168
|
*/
|
|
156
|
-
constructor(
|
|
157
|
-
|
|
158
|
-
|
|
169
|
+
constructor(item_42, min_43, max_44, reluctant_45) {
|
|
170
|
+
super ();
|
|
171
|
+
let reluctant_46;
|
|
172
|
+
if (reluctant_45 == null) {
|
|
173
|
+
reluctant_46 = false;
|
|
174
|
+
} else {
|
|
175
|
+
reluctant_46 = reluctant_45;
|
|
159
176
|
}
|
|
160
|
-
this.#
|
|
161
|
-
this.#
|
|
162
|
-
this.#
|
|
163
|
-
this.#
|
|
177
|
+
this.#item_38 = item_42;
|
|
178
|
+
this.#min_39 = min_43;
|
|
179
|
+
this.#max_40 = max_44;
|
|
180
|
+
this.#reluctant_41 = reluctant_46;
|
|
164
181
|
return;
|
|
165
182
|
}
|
|
166
|
-
/** @returns {
|
|
183
|
+
/** @returns {RegexNode} */
|
|
167
184
|
get item() {
|
|
168
|
-
return this.#
|
|
185
|
+
return this.#item_38;
|
|
169
186
|
}
|
|
170
187
|
/** @returns {number} */
|
|
171
188
|
get min() {
|
|
172
|
-
return this.#
|
|
189
|
+
return this.#min_39;
|
|
173
190
|
}
|
|
174
191
|
/** @returns {number | null} */
|
|
175
192
|
get max() {
|
|
176
|
-
return this.#
|
|
193
|
+
return this.#max_40;
|
|
177
194
|
}
|
|
178
195
|
/** @returns {boolean} */
|
|
179
196
|
get reluctant() {
|
|
180
|
-
return this.#
|
|
197
|
+
return this.#reluctant_41;
|
|
181
198
|
}
|
|
182
199
|
};
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
this.#
|
|
200
|
+
export class Sequence extends type__10(ItemizedRegex) {
|
|
201
|
+
/** @type {Array<RegexNode>} */
|
|
202
|
+
#items_51;
|
|
203
|
+
/** @param {Array<RegexNode>} items_52 */
|
|
204
|
+
constructor(items_52) {
|
|
205
|
+
super ();
|
|
206
|
+
this.#items_51 = items_52;
|
|
190
207
|
return;
|
|
191
208
|
}
|
|
192
|
-
/** @returns {Array<
|
|
209
|
+
/** @returns {Array<RegexNode>} */
|
|
193
210
|
get items() {
|
|
194
|
-
return this.#
|
|
211
|
+
return this.#items_51;
|
|
195
212
|
}
|
|
196
213
|
};
|
|
197
|
-
|
|
198
|
-
|
|
214
|
+
export class Match extends type__10() {
|
|
215
|
+
/** @type {Group} */
|
|
216
|
+
#full_54;
|
|
217
|
+
/** @type {Map<string, Group>} */
|
|
218
|
+
#groups_55;
|
|
219
|
+
/**
|
|
220
|
+
* @param {Group} full_56
|
|
221
|
+
* @param {Map<string, Group>} groups_57
|
|
222
|
+
*/
|
|
223
|
+
constructor(full_56, groups_57) {
|
|
224
|
+
super ();
|
|
225
|
+
this.#full_54 = full_56;
|
|
226
|
+
this.#groups_55 = groups_57;
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
/** @returns {Group} */
|
|
230
|
+
get full() {
|
|
231
|
+
return this.#full_54;
|
|
232
|
+
}
|
|
233
|
+
/** @returns {Map<string, Group>} */
|
|
234
|
+
get groups() {
|
|
235
|
+
return this.#groups_55;
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
export class Group extends type__10() {
|
|
199
239
|
/** @type {string} */
|
|
200
|
-
#
|
|
240
|
+
#name_60;
|
|
201
241
|
/** @type {string} */
|
|
202
|
-
#
|
|
203
|
-
/** @type {number} */
|
|
204
|
-
#
|
|
242
|
+
#value_61;
|
|
243
|
+
/** @type {globalThis.number} */
|
|
244
|
+
#begin_62;
|
|
245
|
+
/** @type {globalThis.number} */
|
|
246
|
+
#end_63;
|
|
205
247
|
/**
|
|
206
|
-
* @param {string}
|
|
207
|
-
* @param {string}
|
|
208
|
-
* @param {number}
|
|
248
|
+
* @param {string} name_64
|
|
249
|
+
* @param {string} value_65
|
|
250
|
+
* @param {globalThis.number} begin_66
|
|
251
|
+
* @param {globalThis.number} end_67
|
|
209
252
|
*/
|
|
210
|
-
constructor(
|
|
211
|
-
|
|
212
|
-
this.#
|
|
213
|
-
this.#
|
|
253
|
+
constructor(name_64, value_65, begin_66, end_67) {
|
|
254
|
+
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;
|
|
214
259
|
return;
|
|
215
260
|
}
|
|
216
261
|
/** @returns {string} */
|
|
217
262
|
get name() {
|
|
218
|
-
return this.#
|
|
263
|
+
return this.#name_60;
|
|
219
264
|
}
|
|
220
265
|
/** @returns {string} */
|
|
221
266
|
get value() {
|
|
222
|
-
return this.#
|
|
267
|
+
return this.#value_61;
|
|
223
268
|
}
|
|
224
|
-
/** @returns {number} */
|
|
225
|
-
get
|
|
226
|
-
return this.#
|
|
269
|
+
/** @returns {globalThis.number} */
|
|
270
|
+
get begin() {
|
|
271
|
+
return this.#begin_62;
|
|
272
|
+
}
|
|
273
|
+
/** @returns {globalThis.number} */
|
|
274
|
+
get end() {
|
|
275
|
+
return this.#end_63;
|
|
227
276
|
}
|
|
228
277
|
};
|
|
229
|
-
class
|
|
278
|
+
class RegexRefs_72 extends type__10() {
|
|
230
279
|
/** @type {CodePoints} */
|
|
231
|
-
#
|
|
280
|
+
#codePoints_73;
|
|
232
281
|
/** @type {Group} */
|
|
233
|
-
#
|
|
282
|
+
#group_74;
|
|
283
|
+
/** @type {Match} */
|
|
284
|
+
#match_75;
|
|
234
285
|
/** @type {Or} */
|
|
235
|
-
#
|
|
286
|
+
#orObject_76;
|
|
236
287
|
/**
|
|
237
|
-
* @param {CodePoints}
|
|
238
|
-
* @param {Group}
|
|
239
|
-
* @param {
|
|
288
|
+
* @param {CodePoints | null} [codePoints_77]
|
|
289
|
+
* @param {Group | null} [group_78]
|
|
290
|
+
* @param {Match | null} [match_79]
|
|
291
|
+
* @param {Or | null} [orObject_80]
|
|
240
292
|
*/
|
|
241
|
-
constructor(
|
|
242
|
-
|
|
243
|
-
let
|
|
244
|
-
let
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
293
|
+
constructor(codePoints_77, group_78, match_79, orObject_80) {
|
|
294
|
+
super ();
|
|
295
|
+
let t_81;
|
|
296
|
+
let t_82;
|
|
297
|
+
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;
|
|
304
|
+
} else {
|
|
305
|
+
codePoints_86 = codePoints_77;
|
|
248
306
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
307
|
+
let group_87;
|
|
308
|
+
if (group_78 == null) {
|
|
309
|
+
t_82 = new Group("", "", 0, 0);
|
|
310
|
+
group_87 = t_82;
|
|
311
|
+
} else {
|
|
312
|
+
group_87 = group_78;
|
|
252
313
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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;
|
|
319
|
+
} else {
|
|
320
|
+
match_88 = match_79;
|
|
256
321
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
322
|
+
let orObject_91;
|
|
323
|
+
if (orObject_80 == null) {
|
|
324
|
+
t_85 = new Or(Object.freeze([]));
|
|
325
|
+
orObject_91 = t_85;
|
|
326
|
+
} else {
|
|
327
|
+
orObject_91 = orObject_80;
|
|
328
|
+
}
|
|
329
|
+
this.#codePoints_73 = codePoints_86;
|
|
330
|
+
this.#group_74 = group_87;
|
|
331
|
+
this.#match_75 = match_88;
|
|
332
|
+
this.#orObject_76 = orObject_91;
|
|
260
333
|
return;
|
|
261
334
|
}
|
|
262
335
|
/** @returns {CodePoints} */
|
|
263
336
|
get codePoints() {
|
|
264
|
-
return this.#
|
|
337
|
+
return this.#codePoints_73;
|
|
265
338
|
}
|
|
266
339
|
/** @returns {Group} */
|
|
267
340
|
get group() {
|
|
268
|
-
return this.#
|
|
341
|
+
return this.#group_74;
|
|
342
|
+
}
|
|
343
|
+
/** @returns {Match} */
|
|
344
|
+
get match() {
|
|
345
|
+
return this.#match_75;
|
|
269
346
|
}
|
|
270
347
|
/** @returns {Or} */
|
|
271
348
|
get orObject() {
|
|
272
|
-
return this.#
|
|
349
|
+
return this.#orObject_76;
|
|
273
350
|
}
|
|
274
351
|
}
|
|
275
|
-
export class
|
|
276
|
-
/** @type {
|
|
277
|
-
#
|
|
278
|
-
/** @param {
|
|
279
|
-
constructor(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
let
|
|
283
|
-
|
|
352
|
+
export class Regex extends type__10() {
|
|
353
|
+
/** @type {RegexNode} */
|
|
354
|
+
#data_96;
|
|
355
|
+
/** @param {RegexNode} data_97 */
|
|
356
|
+
constructor(data_97) {
|
|
357
|
+
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;
|
|
284
362
|
return;
|
|
285
363
|
}
|
|
286
364
|
/**
|
|
287
|
-
* @param {string}
|
|
365
|
+
* @param {string} text_104
|
|
288
366
|
* @returns {boolean}
|
|
289
367
|
*/
|
|
290
|
-
found(
|
|
291
|
-
return
|
|
368
|
+
found(text_104) {
|
|
369
|
+
return regexCompiledFound_105(this, this.#compiled_102, text_104);
|
|
292
370
|
}
|
|
293
371
|
/**
|
|
294
|
-
* @param {string}
|
|
295
|
-
* @
|
|
372
|
+
* @param {string} text_107
|
|
373
|
+
* @param {globalThis.number | null} [begin_108]
|
|
374
|
+
* @returns {Match}
|
|
296
375
|
*/
|
|
297
|
-
find(
|
|
298
|
-
|
|
376
|
+
find(text_107, begin_108) {
|
|
377
|
+
let begin_109;
|
|
378
|
+
if (begin_108 == null) {
|
|
379
|
+
begin_109 = 0;
|
|
380
|
+
} else {
|
|
381
|
+
begin_109 = begin_108;
|
|
382
|
+
}
|
|
383
|
+
return regexCompiledFind_110(this, this.#compiled_102, text_107, begin_109, regexRefs_111);
|
|
299
384
|
}
|
|
300
385
|
/**
|
|
301
|
-
* @param {string}
|
|
302
|
-
* @param {(arg0:
|
|
386
|
+
* @param {string} text_113
|
|
387
|
+
* @param {(arg0: Match) => string} format_114
|
|
303
388
|
* @returns {string}
|
|
304
389
|
*/
|
|
305
|
-
replace(
|
|
306
|
-
return
|
|
390
|
+
replace(text_113, format_114) {
|
|
391
|
+
return regexCompiledReplace_115(this, this.#compiled_102, text_113, format_114, regexRefs_111);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* @param {string} text_117
|
|
395
|
+
* @returns {Array<string>}
|
|
396
|
+
*/
|
|
397
|
+
split(text_117) {
|
|
398
|
+
return regexCompiledSplit_118(this, this.#compiled_102, text_117, regexRefs_111);
|
|
307
399
|
}
|
|
308
400
|
/** @type {unknown} */
|
|
309
|
-
#
|
|
401
|
+
#compiled_102;
|
|
310
402
|
/** @returns {string} */
|
|
311
|
-
|
|
312
|
-
return new
|
|
403
|
+
#format_99() {
|
|
404
|
+
return new RegexFormatter_120().format(this.#data_96);
|
|
313
405
|
}
|
|
314
|
-
/** @returns {
|
|
406
|
+
/** @returns {RegexNode} */
|
|
315
407
|
get data() {
|
|
316
|
-
return this.#
|
|
408
|
+
return this.#data_96;
|
|
317
409
|
}
|
|
318
410
|
};
|
|
319
|
-
class
|
|
411
|
+
class RegexFormatter_120 extends type__10() {
|
|
320
412
|
/** @type {Array<string>} */
|
|
321
|
-
#
|
|
413
|
+
#out_122;
|
|
322
414
|
/**
|
|
323
|
-
* @param {
|
|
415
|
+
* @param {RegexNode} regex_124
|
|
324
416
|
* @returns {string}
|
|
325
417
|
*/
|
|
326
|
-
format(
|
|
327
|
-
this
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
return x_96;
|
|
331
|
-
}
|
|
332
|
-
return listJoin_97(t_94, "", fn_95);
|
|
333
|
-
}
|
|
334
|
-
/** @param {Regex} regex_99 */
|
|
335
|
-
pushRegex(regex_99) {
|
|
336
|
-
let return_100;
|
|
337
|
-
let t_101;
|
|
338
|
-
let t_102;
|
|
339
|
-
let t_103;
|
|
340
|
-
let t_104;
|
|
341
|
-
let t_105;
|
|
342
|
-
let t_106;
|
|
343
|
-
let t_107;
|
|
344
|
-
let t_108;
|
|
345
|
-
let t_109;
|
|
346
|
-
let t_110;
|
|
347
|
-
let t_111;
|
|
348
|
-
let t_112;
|
|
349
|
-
let t_113;
|
|
350
|
-
let t_114;
|
|
351
|
-
try {
|
|
352
|
-
requireInstanceOf__115(regex_99, Capture);
|
|
353
|
-
t_101 = true;
|
|
354
|
-
} catch {
|
|
355
|
-
t_101 = false;
|
|
418
|
+
format(regex_124) {
|
|
419
|
+
this.#pushRegex_125(regex_124);
|
|
420
|
+
function fn_126(x_127) {
|
|
421
|
+
return x_127;
|
|
356
422
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
} catch {
|
|
404
|
-
break s__1245_116;
|
|
405
|
-
}
|
|
406
|
-
this.pushCodeSet(t_108);
|
|
407
|
-
} else {
|
|
408
|
-
try {
|
|
409
|
-
requireInstanceOf__115(regex_99, Or);
|
|
410
|
-
t_109 = true;
|
|
411
|
-
} catch {
|
|
412
|
-
t_109 = false;
|
|
413
|
-
}
|
|
414
|
-
if (t_109) {
|
|
415
|
-
try {
|
|
416
|
-
t_110 = requireInstanceOf__115(regex_99, Or);
|
|
417
|
-
} catch {
|
|
418
|
-
break s__1245_116;
|
|
419
|
-
}
|
|
420
|
-
this.pushOr(t_110);
|
|
421
|
-
} else {
|
|
422
|
-
try {
|
|
423
|
-
requireInstanceOf__115(regex_99, Repeat);
|
|
424
|
-
t_111 = true;
|
|
425
|
-
} catch {
|
|
426
|
-
t_111 = false;
|
|
427
|
-
}
|
|
428
|
-
if (t_111) {
|
|
429
|
-
try {
|
|
430
|
-
t_112 = requireInstanceOf__115(regex_99, Repeat);
|
|
431
|
-
} catch {
|
|
432
|
-
break s__1245_116;
|
|
433
|
-
}
|
|
434
|
-
this.pushRepeat(t_112);
|
|
435
|
-
} else {
|
|
436
|
-
try {
|
|
437
|
-
requireInstanceOf__115(regex_99, Sequence);
|
|
438
|
-
t_113 = true;
|
|
439
|
-
} catch {
|
|
440
|
-
t_113 = false;
|
|
441
|
-
}
|
|
442
|
-
if (t_113) {
|
|
443
|
-
try {
|
|
444
|
-
t_114 = requireInstanceOf__115(regex_99, Sequence);
|
|
445
|
-
} catch {
|
|
446
|
-
break s__1245_116;
|
|
447
|
-
}
|
|
448
|
-
this.pushSequence(t_114);
|
|
449
|
-
} else if (eqGeneric_117(regex_99, Begin)) {
|
|
450
|
-
try {
|
|
451
|
-
listBuilderAdd_118(this.#out_91, "^");
|
|
452
|
-
} catch {
|
|
453
|
-
break s__1245_116;
|
|
454
|
-
}
|
|
455
|
-
} else if (eqGeneric_117(regex_99, Dot)) {
|
|
456
|
-
try {
|
|
457
|
-
listBuilderAdd_118(this.#out_91, ".");
|
|
458
|
-
} catch {
|
|
459
|
-
break s__1245_116;
|
|
460
|
-
}
|
|
461
|
-
} else if (eqGeneric_117(regex_99, End)) {
|
|
462
|
-
try {
|
|
463
|
-
listBuilderAdd_118(this.#out_91, "\u0024");
|
|
464
|
-
} catch {
|
|
465
|
-
break s__1245_116;
|
|
466
|
-
}
|
|
467
|
-
} else if (eqGeneric_117(regex_99, WordBoundary)) {
|
|
468
|
-
try {
|
|
469
|
-
listBuilderAdd_118(this.#out_91, "\\b");
|
|
470
|
-
} catch {
|
|
471
|
-
break s__1245_116;
|
|
472
|
-
}
|
|
473
|
-
} else if (eqGeneric_117(regex_99, Digit)) {
|
|
474
|
-
try {
|
|
475
|
-
listBuilderAdd_118(this.#out_91, "\\d");
|
|
476
|
-
} catch {
|
|
477
|
-
break s__1245_116;
|
|
478
|
-
}
|
|
479
|
-
} else if (eqGeneric_117(regex_99, Space)) {
|
|
480
|
-
try {
|
|
481
|
-
listBuilderAdd_118(this.#out_91, "\\s");
|
|
482
|
-
} catch {
|
|
483
|
-
break s__1245_116;
|
|
484
|
-
}
|
|
485
|
-
} else if (eqGeneric_117(regex_99, Word)) {
|
|
486
|
-
try {
|
|
487
|
-
listBuilderAdd_118(this.#out_91, "\\w");
|
|
488
|
-
} catch {
|
|
489
|
-
break s__1245_116;
|
|
490
|
-
}
|
|
491
|
-
} else {
|
|
492
|
-
void 0;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
return_100 = void 0;
|
|
501
|
-
return return_100;
|
|
423
|
+
return listedJoin_128(this.#out_122, "", fn_126);
|
|
424
|
+
}
|
|
425
|
+
/** @param {RegexNode} regex_130 */
|
|
426
|
+
#pushRegex_125(regex_130) {
|
|
427
|
+
let t_131;
|
|
428
|
+
let t_132;
|
|
429
|
+
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
469
|
}
|
|
503
|
-
throw Error();
|
|
504
|
-
}
|
|
505
|
-
/** @param {Capture} capture_120 */
|
|
506
|
-
pushCapture(capture_120) {
|
|
507
|
-
listBuilderAdd_118(this.#out_91, "(");
|
|
508
|
-
let t_121 = this.#out_91;
|
|
509
|
-
let t_122 = capture_120.name;
|
|
510
|
-
this.pushCaptureName(t_121, t_122);
|
|
511
|
-
let t_123 = capture_120.item;
|
|
512
|
-
this.pushRegex(t_123);
|
|
513
|
-
listBuilderAdd_118(this.#out_91, ")");
|
|
514
470
|
return;
|
|
515
471
|
}
|
|
516
|
-
/**
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
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, ")");
|
|
522
481
|
return;
|
|
523
482
|
}
|
|
524
483
|
/**
|
|
525
|
-
* @param {
|
|
526
|
-
* @param {
|
|
484
|
+
* @param {Array<string>} out_154
|
|
485
|
+
* @param {string} name_155
|
|
527
486
|
*/
|
|
528
|
-
|
|
529
|
-
|
|
487
|
+
#pushCaptureName_151(out_154, name_155) {
|
|
488
|
+
listBuilderAdd_146(out_154, "?\u003c" + name_155 + "\u003e");
|
|
530
489
|
return;
|
|
531
490
|
}
|
|
532
491
|
/**
|
|
533
|
-
* @param {
|
|
534
|
-
* @param {boolean}
|
|
492
|
+
* @param {number} code_158
|
|
493
|
+
* @param {boolean} insideCodeSet_159
|
|
535
494
|
*/
|
|
536
|
-
|
|
537
|
-
let t_135;
|
|
538
|
-
let t_136;
|
|
539
|
-
let t_137 = stringCodePoints_138(codePoints_133.value);
|
|
540
|
-
let slice_139 = t_137;
|
|
541
|
-
while (true) {
|
|
542
|
-
if (! slice_139.isEmpty) {
|
|
543
|
-
t_135 = slice_139.read();
|
|
544
|
-
this.pushCode(t_135, insideCodeSet_134);
|
|
545
|
-
t_136 = slice_139.advance(1);
|
|
546
|
-
slice_139 = t_136;
|
|
547
|
-
} else {
|
|
548
|
-
break;
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
/** @param {CodeRange} codeRange_141 */
|
|
554
|
-
pushCodeRange(codeRange_141) {
|
|
555
|
-
listBuilderAdd_118(this.#out_91, "[");
|
|
556
|
-
this.pushCodeRangeUnwrapped(codeRange_141);
|
|
557
|
-
listBuilderAdd_118(this.#out_91, "]");
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
/** @param {CodeRange} codeRange_143 */
|
|
561
|
-
pushCodeRangeUnwrapped(codeRange_143) {
|
|
562
|
-
let t_144 = codeRange_143.min;
|
|
563
|
-
this.pushCode(t_144, true);
|
|
564
|
-
listBuilderAdd_118(this.#out_91, "-");
|
|
565
|
-
let t_145 = codeRange_143.max;
|
|
566
|
-
this.pushCode(t_145, true);
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
/** @param {CodeSet} codeSet_147 */
|
|
570
|
-
pushCodeSet(codeSet_147) {
|
|
571
|
-
let t_148;
|
|
572
|
-
let t_149;
|
|
573
|
-
let t_150;
|
|
574
|
-
let t_151;
|
|
575
|
-
const adjusted_152 = regexFormatterAdjustCodeSet_153(this, codeSet_147, regexRefs_83);
|
|
576
|
-
try {
|
|
577
|
-
requireInstanceOf__115(adjusted_152, CodeSet);
|
|
578
|
-
t_149 = true;
|
|
579
|
-
} catch {
|
|
580
|
-
t_149 = false;
|
|
581
|
-
}
|
|
582
|
-
s__1252_154: {
|
|
583
|
-
if (t_149) {
|
|
584
|
-
s__1253_155: {
|
|
585
|
-
try {
|
|
586
|
-
t_150 = requireInstanceOf__115(adjusted_152, CodeSet);
|
|
587
|
-
listBuilderAdd_118(this.#out_91, "[");
|
|
588
|
-
} catch {
|
|
589
|
-
break s__1253_155;
|
|
590
|
-
}
|
|
591
|
-
if (t_150.negated) {
|
|
592
|
-
try {
|
|
593
|
-
listBuilderAdd_118(this.#out_91, "^");
|
|
594
|
-
} catch {
|
|
595
|
-
break s__1253_155;
|
|
596
|
-
}
|
|
597
|
-
} else {
|
|
598
|
-
void 0;
|
|
599
|
-
}
|
|
600
|
-
let i_156 = 0;
|
|
601
|
-
while (true) {
|
|
602
|
-
t_148 = t_150.items.length;
|
|
603
|
-
if (i_156 < t_148) {
|
|
604
|
-
try {
|
|
605
|
-
t_151 = listGet_157(t_150.items, i_156);
|
|
606
|
-
} catch {
|
|
607
|
-
break s__1253_155;
|
|
608
|
-
}
|
|
609
|
-
this.pushCodeSetItem(t_151);
|
|
610
|
-
i_156 = i_156 + 1;
|
|
611
|
-
} else {
|
|
612
|
-
break;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
try {
|
|
616
|
-
listBuilderAdd_118(this.#out_91, "]");
|
|
617
|
-
break s__1252_154;
|
|
618
|
-
} catch {
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
throw Error();
|
|
622
|
-
}
|
|
623
|
-
this.pushRegex(adjusted_152);
|
|
624
|
-
}
|
|
625
|
-
return;
|
|
626
|
-
}
|
|
627
|
-
/** @param {CodePart} codePart_159 */
|
|
628
|
-
pushCodeSetItem(codePart_159) {
|
|
495
|
+
#pushCode_157(code_158, insideCodeSet_159) {
|
|
629
496
|
let return_160;
|
|
630
497
|
let t_161;
|
|
631
498
|
let t_162;
|
|
@@ -633,420 +500,786 @@ class RegexFormatter_89 {
|
|
|
633
500
|
let t_164;
|
|
634
501
|
let t_165;
|
|
635
502
|
let t_166;
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
if (
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
break s__1259_167;
|
|
648
|
-
}
|
|
649
|
-
this.pushCodePoints(t_162, true);
|
|
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";
|
|
650
514
|
} else {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
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;
|
|
664
528
|
} else {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
529
|
+
if (insideCodeSet_159) {
|
|
530
|
+
t_161 = code_158 === Codes_172.dash;
|
|
531
|
+
} else {
|
|
532
|
+
t_161 = false;
|
|
533
|
+
}
|
|
534
|
+
t_162 = t_161;
|
|
535
|
+
}
|
|
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;
|
|
547
|
+
}
|
|
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;
|
|
555
|
+
} else {
|
|
669
556
|
t_165 = false;
|
|
670
557
|
}
|
|
671
558
|
if (t_165) {
|
|
672
|
-
|
|
673
|
-
t_166 = requireInstanceOf__115(codePart_159, SpecialSet);
|
|
674
|
-
} catch {
|
|
675
|
-
break s__1259_167;
|
|
676
|
-
}
|
|
677
|
-
this.pushRegex(t_166);
|
|
559
|
+
t_166 = true;
|
|
678
560
|
} else {
|
|
679
|
-
|
|
561
|
+
t_166 = code_158 === Codes_172.uint16Max;
|
|
680
562
|
}
|
|
563
|
+
t_167 = ! t_166;
|
|
564
|
+
} else {
|
|
565
|
+
t_167 = false;
|
|
681
566
|
}
|
|
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);
|
|
682
574
|
}
|
|
683
575
|
return_160 = void 0;
|
|
684
|
-
return return_160;
|
|
685
576
|
}
|
|
686
|
-
|
|
687
|
-
}
|
|
688
|
-
/**
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
577
|
+
return return_160;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* @param {CodePoints} codePoints_178
|
|
581
|
+
* @param {boolean} insideCodeSet_179
|
|
582
|
+
*/
|
|
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;
|
|
588
|
+
while (true) {
|
|
589
|
+
if (!(value_182.length > index_183)) {
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
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;
|
|
596
|
+
}
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
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, "]");
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
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);
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
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, "^");
|
|
626
|
+
}
|
|
627
|
+
let i_200 = 0;
|
|
628
|
+
while (true) {
|
|
629
|
+
t_195 = t_196.items.length;
|
|
630
|
+
if (!(i_200 < t_195)) {
|
|
631
|
+
break;
|
|
722
632
|
}
|
|
633
|
+
t_197 = listedGet_174(t_196.items, i_200);
|
|
634
|
+
this.#pushCodeSetItem_201(t_197);
|
|
635
|
+
i_200 = i_200 + 1;
|
|
723
636
|
}
|
|
724
|
-
|
|
637
|
+
listBuilderAdd_146(this.#out_122, "]");
|
|
638
|
+
} else {
|
|
639
|
+
this.#pushRegex_125(adjusted_198);
|
|
725
640
|
}
|
|
726
641
|
return;
|
|
727
642
|
}
|
|
728
|
-
/** @param {
|
|
729
|
-
|
|
730
|
-
let
|
|
731
|
-
let
|
|
732
|
-
let
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
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);
|
|
657
|
+
}
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
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;
|
|
670
|
+
while (true) {
|
|
671
|
+
t_209 = or_208.items.length;
|
|
672
|
+
if (!(i_212 < t_209)) {
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
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;
|
|
749
679
|
}
|
|
750
|
-
|
|
751
|
-
|
|
680
|
+
listBuilderAdd_146(this.#out_122, ")");
|
|
681
|
+
}
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
/** @param {Repeat} repeat_214 */
|
|
685
|
+
#pushRepeat_144(repeat_214) {
|
|
686
|
+
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;
|
|
700
|
+
} else {
|
|
701
|
+
t_217 = false;
|
|
702
|
+
}
|
|
703
|
+
if (t_217) {
|
|
704
|
+
listBuilderAdd_146(this.#out_122, "?");
|
|
705
|
+
} else {
|
|
706
|
+
if (min_221 === 0) {
|
|
707
|
+
t_218 = max_222 == null;
|
|
752
708
|
} else {
|
|
753
|
-
|
|
709
|
+
t_218 = false;
|
|
754
710
|
}
|
|
755
|
-
if (
|
|
756
|
-
|
|
757
|
-
listBuilderAdd_118(this.#out_91, "?");
|
|
758
|
-
} catch {
|
|
759
|
-
break s__1266_185;
|
|
760
|
-
}
|
|
711
|
+
if (t_218) {
|
|
712
|
+
listBuilderAdd_146(this.#out_122, "*");
|
|
761
713
|
} else {
|
|
762
|
-
if (
|
|
763
|
-
|
|
714
|
+
if (min_221 === 1) {
|
|
715
|
+
t_219 = max_222 == null;
|
|
764
716
|
} else {
|
|
765
|
-
|
|
717
|
+
t_219 = false;
|
|
766
718
|
}
|
|
767
|
-
if (
|
|
768
|
-
|
|
769
|
-
listBuilderAdd_118(this.#out_91, "*");
|
|
770
|
-
} catch {
|
|
771
|
-
break s__1266_185;
|
|
772
|
-
}
|
|
719
|
+
if (t_219) {
|
|
720
|
+
listBuilderAdd_146(this.#out_122, "+");
|
|
773
721
|
} else {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
listBuilderAdd_118(this.#out_91, "+");
|
|
782
|
-
} catch {
|
|
783
|
-
break s__1266_185;
|
|
784
|
-
}
|
|
785
|
-
} else {
|
|
786
|
-
try {
|
|
787
|
-
listBuilderAdd_118(this.#out_91, strCat_127("{", intToString_188(min_186)));
|
|
788
|
-
} catch {
|
|
789
|
-
break s__1266_185;
|
|
790
|
-
}
|
|
791
|
-
if (min_186 !== max_187) {
|
|
792
|
-
try {
|
|
793
|
-
listBuilderAdd_118(this.#out_91, ",");
|
|
794
|
-
} catch {
|
|
795
|
-
break s__1266_185;
|
|
796
|
-
}
|
|
797
|
-
if (max_187 !== null) {
|
|
798
|
-
t_184 = this.#out_91;
|
|
799
|
-
try {
|
|
800
|
-
t_183 = requireIsSafeInteger__189(max_187);
|
|
801
|
-
listBuilderAdd_118(t_184, intToString_188(t_183));
|
|
802
|
-
} catch {
|
|
803
|
-
break s__1266_185;
|
|
804
|
-
}
|
|
805
|
-
} else {
|
|
806
|
-
void 0;
|
|
807
|
-
}
|
|
808
|
-
} else {
|
|
809
|
-
void 0;
|
|
810
|
-
}
|
|
811
|
-
try {
|
|
812
|
-
listBuilderAdd_118(this.#out_91, "}");
|
|
813
|
-
} catch {
|
|
814
|
-
break s__1266_185;
|
|
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);
|
|
815
729
|
}
|
|
816
730
|
}
|
|
731
|
+
listBuilderAdd_146(this.#out_122, "}");
|
|
817
732
|
}
|
|
818
733
|
}
|
|
819
|
-
if (repeat_177.reluctant) {
|
|
820
|
-
try {
|
|
821
|
-
listBuilderAdd_118(this.#out_91, "?");
|
|
822
|
-
} catch {
|
|
823
|
-
break s__1266_185;
|
|
824
|
-
}
|
|
825
|
-
} else {
|
|
826
|
-
void 0;
|
|
827
|
-
}
|
|
828
|
-
return_178 = void 0;
|
|
829
|
-
return return_178;
|
|
830
734
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
let
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
} catch {
|
|
846
|
-
break;
|
|
847
|
-
}
|
|
848
|
-
this.pushRegex(t_194);
|
|
849
|
-
i_195 = i_195 + 1;
|
|
850
|
-
} else {
|
|
851
|
-
return_192 = void 0;
|
|
852
|
-
break s__1269_196;
|
|
853
|
-
}
|
|
735
|
+
if (repeat_214.reluctant) {
|
|
736
|
+
listBuilderAdd_146(this.#out_122, "?");
|
|
737
|
+
}
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
/** @param {Sequence} sequence_224 */
|
|
741
|
+
#pushSequence_145(sequence_224) {
|
|
742
|
+
let t_225;
|
|
743
|
+
let t_226;
|
|
744
|
+
let i_227 = 0;
|
|
745
|
+
while (true) {
|
|
746
|
+
t_225 = sequence_224.items.length;
|
|
747
|
+
if (!(i_227 < t_225)) {
|
|
748
|
+
break;
|
|
854
749
|
}
|
|
855
|
-
|
|
750
|
+
t_226 = listedGet_174(sequence_224.items, i_227);
|
|
751
|
+
this.#pushRegex_125(t_226);
|
|
752
|
+
i_227 = i_227 + 1;
|
|
856
753
|
}
|
|
857
|
-
return
|
|
754
|
+
return;
|
|
858
755
|
}
|
|
859
756
|
/**
|
|
860
|
-
* @param {CodePart}
|
|
757
|
+
* @param {CodePart} codePart_229
|
|
861
758
|
* @returns {number | null}
|
|
862
759
|
*/
|
|
863
|
-
maxCode(
|
|
864
|
-
let
|
|
865
|
-
let
|
|
866
|
-
let
|
|
867
|
-
let
|
|
868
|
-
let
|
|
869
|
-
let
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
try {
|
|
876
|
-
requireInstanceOf__115(codePart_198, CodePoints);
|
|
877
|
-
t_206 = true;
|
|
878
|
-
} catch {
|
|
879
|
-
t_206 = false;
|
|
880
|
-
}
|
|
881
|
-
s__1271_210: {
|
|
882
|
-
if (t_206) {
|
|
883
|
-
try {
|
|
884
|
-
t_207 = requireInstanceOf__115(codePart_198, CodePoints);
|
|
885
|
-
} catch {
|
|
886
|
-
break s__1271_210;
|
|
887
|
-
}
|
|
888
|
-
const value_211 = t_207.value;
|
|
889
|
-
if (! value_211) {
|
|
890
|
-
return_199 = null;
|
|
891
|
-
} else {
|
|
892
|
-
let max_212 = 0;
|
|
893
|
-
t_200 = stringCodePoints_138(value_211);
|
|
894
|
-
let slice_213 = t_200;
|
|
895
|
-
while (true) {
|
|
896
|
-
if (! slice_213.isEmpty) {
|
|
897
|
-
const next_214 = slice_213.read();
|
|
898
|
-
if (next_214 > max_212) {
|
|
899
|
-
max_212 = next_214;
|
|
900
|
-
} else {
|
|
901
|
-
void 0;
|
|
902
|
-
}
|
|
903
|
-
t_201 = slice_213.advance(1);
|
|
904
|
-
slice_213 = t_201;
|
|
905
|
-
} else {
|
|
906
|
-
break;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
return_199 = max_212;
|
|
910
|
-
}
|
|
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;
|
|
911
772
|
} else {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
}
|
|
918
|
-
if (t_208) {
|
|
919
|
-
try {
|
|
920
|
-
t_209 = requireInstanceOf__115(codePart_198, CodeRange);
|
|
921
|
-
t_202 = t_209.max;
|
|
922
|
-
return_199 = t_202;
|
|
923
|
-
} catch {
|
|
924
|
-
break s__1271_210;
|
|
925
|
-
}
|
|
926
|
-
} else if (eqGeneric_117(codePart_198, Digit)) {
|
|
927
|
-
t_203 = stringCodePoints_138("9").read();
|
|
928
|
-
try {
|
|
929
|
-
return_199 = t_203;
|
|
930
|
-
} catch {
|
|
931
|
-
break s__1271_210;
|
|
932
|
-
}
|
|
933
|
-
} else if (eqGeneric_117(codePart_198, Space)) {
|
|
934
|
-
t_204 = stringCodePoints_138(" ").read();
|
|
935
|
-
try {
|
|
936
|
-
return_199 = t_204;
|
|
937
|
-
} catch {
|
|
938
|
-
break s__1271_210;
|
|
773
|
+
let max_237 = 0;
|
|
774
|
+
let index_238 = 0;
|
|
775
|
+
while (true) {
|
|
776
|
+
if (!(value_236.length > index_238)) {
|
|
777
|
+
break;
|
|
939
778
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
} catch {
|
|
945
|
-
break s__1271_210;
|
|
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;
|
|
946
783
|
}
|
|
947
|
-
|
|
948
|
-
|
|
784
|
+
t_231 = stringNext_185(value_236, index_238);
|
|
785
|
+
index_238 = t_231;
|
|
949
786
|
}
|
|
787
|
+
return_230 = max_237;
|
|
950
788
|
}
|
|
951
|
-
|
|
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;
|
|
799
|
+
} else {
|
|
800
|
+
return_230 = null;
|
|
952
801
|
}
|
|
953
|
-
|
|
802
|
+
return return_230;
|
|
954
803
|
}
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
let
|
|
958
|
-
|
|
959
|
-
t_216 = [];
|
|
960
|
-
out_215 = t_216;
|
|
961
|
-
}
|
|
962
|
-
this.#out_91 = out_215;
|
|
804
|
+
constructor() {
|
|
805
|
+
super ();
|
|
806
|
+
let t_240 = [];
|
|
807
|
+
this.#out_122 = t_240;
|
|
963
808
|
return;
|
|
964
809
|
}
|
|
965
810
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
811
|
+
class Codes_172 extends type__10() {
|
|
812
|
+
/** @type {number} */
|
|
813
|
+
static #ampersand_241 = 38;
|
|
814
|
+
/** @returns {number} */
|
|
815
|
+
static get ampersand() {
|
|
816
|
+
return this.#ampersand_241;
|
|
817
|
+
}
|
|
818
|
+
/** @type {number} */
|
|
819
|
+
static #backslash_242 = 92;
|
|
820
|
+
/** @returns {number} */
|
|
821
|
+
static get backslash() {
|
|
822
|
+
return this.#backslash_242;
|
|
823
|
+
}
|
|
824
|
+
/** @type {number} */
|
|
825
|
+
static #caret_243 = 94;
|
|
826
|
+
/** @returns {number} */
|
|
827
|
+
static get caret() {
|
|
828
|
+
return this.#caret_243;
|
|
829
|
+
}
|
|
830
|
+
/** @type {number} */
|
|
831
|
+
static #carriageReturn_244 = 13;
|
|
832
|
+
/** @returns {number} */
|
|
833
|
+
static get carriageReturn() {
|
|
834
|
+
return this.#carriageReturn_244;
|
|
835
|
+
}
|
|
836
|
+
/** @type {number} */
|
|
837
|
+
static #curlyLeft_245 = 123;
|
|
838
|
+
/** @returns {number} */
|
|
839
|
+
static get curlyLeft() {
|
|
840
|
+
return this.#curlyLeft_245;
|
|
841
|
+
}
|
|
842
|
+
/** @type {number} */
|
|
843
|
+
static #curlyRight_246 = 125;
|
|
844
|
+
/** @returns {number} */
|
|
845
|
+
static get curlyRight() {
|
|
846
|
+
return this.#curlyRight_246;
|
|
847
|
+
}
|
|
848
|
+
/** @type {number} */
|
|
849
|
+
static #dash_247 = 45;
|
|
850
|
+
/** @returns {number} */
|
|
851
|
+
static get dash() {
|
|
852
|
+
return this.#dash_247;
|
|
853
|
+
}
|
|
854
|
+
/** @type {number} */
|
|
855
|
+
static #dot_248 = 46;
|
|
856
|
+
/** @returns {number} */
|
|
857
|
+
static get dot() {
|
|
858
|
+
return this.#dot_248;
|
|
859
|
+
}
|
|
860
|
+
/** @type {number} */
|
|
861
|
+
static #highControlMin_249 = 127;
|
|
862
|
+
/** @returns {number} */
|
|
863
|
+
static get highControlMin() {
|
|
864
|
+
return this.#highControlMin_249;
|
|
865
|
+
}
|
|
866
|
+
/** @type {number} */
|
|
867
|
+
static #highControlMax_250 = 159;
|
|
868
|
+
/** @returns {number} */
|
|
869
|
+
static get highControlMax() {
|
|
870
|
+
return this.#highControlMax_250;
|
|
871
|
+
}
|
|
872
|
+
/** @type {number} */
|
|
873
|
+
static #digit0_251 = 48;
|
|
874
|
+
/** @returns {number} */
|
|
875
|
+
static get digit0() {
|
|
876
|
+
return this.#digit0_251;
|
|
877
|
+
}
|
|
878
|
+
/** @type {number} */
|
|
879
|
+
static #digit9_252 = 57;
|
|
880
|
+
/** @returns {number} */
|
|
881
|
+
static get digit9() {
|
|
882
|
+
return this.#digit9_252;
|
|
883
|
+
}
|
|
884
|
+
/** @type {number} */
|
|
885
|
+
static #lowerA_253 = 97;
|
|
886
|
+
/** @returns {number} */
|
|
887
|
+
static get lowerA() {
|
|
888
|
+
return this.#lowerA_253;
|
|
889
|
+
}
|
|
890
|
+
/** @type {number} */
|
|
891
|
+
static #lowerZ_254 = 122;
|
|
892
|
+
/** @returns {number} */
|
|
893
|
+
static get lowerZ() {
|
|
894
|
+
return this.#lowerZ_254;
|
|
895
|
+
}
|
|
896
|
+
/** @type {number} */
|
|
897
|
+
static #newline_255 = 10;
|
|
898
|
+
/** @returns {number} */
|
|
899
|
+
static get newline() {
|
|
900
|
+
return this.#newline_255;
|
|
901
|
+
}
|
|
902
|
+
/** @type {number} */
|
|
903
|
+
static #peso_256 = 36;
|
|
904
|
+
/** @returns {number} */
|
|
905
|
+
static get peso() {
|
|
906
|
+
return this.#peso_256;
|
|
907
|
+
}
|
|
908
|
+
/** @type {number} */
|
|
909
|
+
static #pipe_257 = 124;
|
|
910
|
+
/** @returns {number} */
|
|
911
|
+
static get pipe() {
|
|
912
|
+
return this.#pipe_257;
|
|
913
|
+
}
|
|
914
|
+
/** @type {number} */
|
|
915
|
+
static #plus_258 = 43;
|
|
916
|
+
/** @returns {number} */
|
|
917
|
+
static get plus() {
|
|
918
|
+
return this.#plus_258;
|
|
919
|
+
}
|
|
920
|
+
/** @type {number} */
|
|
921
|
+
static #question_259 = 63;
|
|
922
|
+
/** @returns {number} */
|
|
923
|
+
static get question() {
|
|
924
|
+
return this.#question_259;
|
|
925
|
+
}
|
|
926
|
+
/** @type {number} */
|
|
927
|
+
static #roundLeft_260 = 40;
|
|
928
|
+
/** @returns {number} */
|
|
929
|
+
static get roundLeft() {
|
|
930
|
+
return this.#roundLeft_260;
|
|
931
|
+
}
|
|
932
|
+
/** @type {number} */
|
|
933
|
+
static #roundRight_261 = 41;
|
|
934
|
+
/** @returns {number} */
|
|
935
|
+
static get roundRight() {
|
|
936
|
+
return this.#roundRight_261;
|
|
937
|
+
}
|
|
938
|
+
/** @type {number} */
|
|
939
|
+
static #slash_262 = 47;
|
|
940
|
+
/** @returns {number} */
|
|
941
|
+
static get slash() {
|
|
942
|
+
return this.#slash_262;
|
|
943
|
+
}
|
|
944
|
+
/** @type {number} */
|
|
945
|
+
static #squareLeft_263 = 91;
|
|
946
|
+
/** @returns {number} */
|
|
947
|
+
static get squareLeft() {
|
|
948
|
+
return this.#squareLeft_263;
|
|
949
|
+
}
|
|
950
|
+
/** @type {number} */
|
|
951
|
+
static #squareRight_264 = 93;
|
|
952
|
+
/** @returns {number} */
|
|
953
|
+
static get squareRight() {
|
|
954
|
+
return this.#squareRight_264;
|
|
955
|
+
}
|
|
956
|
+
/** @type {number} */
|
|
957
|
+
static #star_265 = 42;
|
|
958
|
+
/** @returns {number} */
|
|
959
|
+
static get star() {
|
|
960
|
+
return this.#star_265;
|
|
961
|
+
}
|
|
962
|
+
/** @type {number} */
|
|
963
|
+
static #tab_266 = 9;
|
|
964
|
+
/** @returns {number} */
|
|
965
|
+
static get tab() {
|
|
966
|
+
return this.#tab_266;
|
|
967
|
+
}
|
|
968
|
+
/** @type {number} */
|
|
969
|
+
static #tilde_267 = 42;
|
|
970
|
+
/** @returns {number} */
|
|
971
|
+
static get tilde() {
|
|
972
|
+
return this.#tilde_267;
|
|
973
|
+
}
|
|
974
|
+
/** @type {number} */
|
|
975
|
+
static #upperA_268 = 65;
|
|
976
|
+
/** @returns {number} */
|
|
977
|
+
static get upperA() {
|
|
978
|
+
return this.#upperA_268;
|
|
979
|
+
}
|
|
980
|
+
/** @type {number} */
|
|
981
|
+
static #upperZ_269 = 90;
|
|
982
|
+
/** @returns {number} */
|
|
983
|
+
static get upperZ() {
|
|
984
|
+
return this.#upperZ_269;
|
|
985
|
+
}
|
|
986
|
+
/** @type {number} */
|
|
987
|
+
static #space_270 = 32;
|
|
988
|
+
/** @returns {number} */
|
|
989
|
+
static get space() {
|
|
990
|
+
return this.#space_270;
|
|
991
|
+
}
|
|
992
|
+
/** @type {number} */
|
|
993
|
+
static #surrogateMin_271 = 55296;
|
|
994
|
+
/** @returns {number} */
|
|
995
|
+
static get surrogateMin() {
|
|
996
|
+
return this.#surrogateMin_271;
|
|
997
|
+
}
|
|
998
|
+
/** @type {number} */
|
|
999
|
+
static #surrogateMax_272 = 57343;
|
|
1000
|
+
/** @returns {number} */
|
|
1001
|
+
static get surrogateMax() {
|
|
1002
|
+
return this.#surrogateMax_272;
|
|
1003
|
+
}
|
|
1004
|
+
/** @type {number} */
|
|
1005
|
+
static #supplementalMin_273 = 65536;
|
|
1006
|
+
/** @returns {number} */
|
|
1007
|
+
static get supplementalMin() {
|
|
1008
|
+
return this.#supplementalMin_273;
|
|
1009
|
+
}
|
|
1010
|
+
/** @type {number} */
|
|
1011
|
+
static #uint16Max_274 = 65535;
|
|
1012
|
+
/** @returns {number} */
|
|
1013
|
+
static get uint16Max() {
|
|
1014
|
+
return this.#uint16Max_274;
|
|
1015
|
+
}
|
|
1016
|
+
/** @type {number} */
|
|
1017
|
+
static #underscore_275 = 95;
|
|
1018
|
+
/** @returns {number} */
|
|
1019
|
+
static get underscore() {
|
|
1020
|
+
return this.#underscore_275;
|
|
1021
|
+
}
|
|
1022
|
+
constructor() {
|
|
1023
|
+
super ();
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
/** @type {RegexRefs_72} */
|
|
1028
|
+
const regexRefs_111 = new RegexRefs_72();
|
|
1029
|
+
class Begin_276 extends type__10(Special) {
|
|
969
1030
|
constructor() {
|
|
1031
|
+
super ();
|
|
970
1032
|
return;
|
|
971
1033
|
}
|
|
972
1034
|
}
|
|
973
|
-
Special.implementedBy(Begin_217);
|
|
974
1035
|
/** @type {Special} */
|
|
975
|
-
export const Begin = new
|
|
976
|
-
class
|
|
1036
|
+
export const Begin = new Begin_276();
|
|
1037
|
+
class Dot_277 extends type__10(Special) {
|
|
977
1038
|
constructor() {
|
|
1039
|
+
super ();
|
|
978
1040
|
return;
|
|
979
1041
|
}
|
|
980
1042
|
}
|
|
981
|
-
Special.implementedBy(Dot_218);
|
|
982
1043
|
/** @type {Special} */
|
|
983
|
-
export const Dot = new
|
|
984
|
-
class
|
|
1044
|
+
export const Dot = new Dot_277();
|
|
1045
|
+
class End_278 extends type__10(Special) {
|
|
985
1046
|
constructor() {
|
|
1047
|
+
super ();
|
|
986
1048
|
return;
|
|
987
1049
|
}
|
|
988
1050
|
}
|
|
989
|
-
Special.implementedBy(End_219);
|
|
990
1051
|
/** @type {Special} */
|
|
991
|
-
export const End = new
|
|
992
|
-
class
|
|
1052
|
+
export const End = new End_278();
|
|
1053
|
+
class WordBoundary_279 extends type__10(Special) {
|
|
993
1054
|
constructor() {
|
|
1055
|
+
super ();
|
|
994
1056
|
return;
|
|
995
1057
|
}
|
|
996
1058
|
}
|
|
997
|
-
Special.implementedBy(WordBoundary_220);
|
|
998
1059
|
/** @type {Special} */
|
|
999
|
-
export const WordBoundary = new
|
|
1000
|
-
class
|
|
1060
|
+
export const WordBoundary = new WordBoundary_279();
|
|
1061
|
+
class Digit_280 extends type__10(SpecialSet) {
|
|
1001
1062
|
constructor() {
|
|
1063
|
+
super ();
|
|
1002
1064
|
return;
|
|
1003
1065
|
}
|
|
1004
1066
|
}
|
|
1005
|
-
SpecialSet.implementedBy(Digit_221);
|
|
1006
1067
|
/** @type {SpecialSet} */
|
|
1007
|
-
export const Digit = new
|
|
1008
|
-
class
|
|
1068
|
+
export const Digit = new Digit_280();
|
|
1069
|
+
class Space_281 extends type__10(SpecialSet) {
|
|
1009
1070
|
constructor() {
|
|
1071
|
+
super ();
|
|
1010
1072
|
return;
|
|
1011
1073
|
}
|
|
1012
1074
|
}
|
|
1013
|
-
SpecialSet.implementedBy(Space_222);
|
|
1014
1075
|
/** @type {SpecialSet} */
|
|
1015
|
-
export const Space = new
|
|
1016
|
-
class
|
|
1076
|
+
export const Space = new Space_281();
|
|
1077
|
+
class Word_282 extends type__10(SpecialSet) {
|
|
1017
1078
|
constructor() {
|
|
1079
|
+
super ();
|
|
1018
1080
|
return;
|
|
1019
1081
|
}
|
|
1020
1082
|
}
|
|
1021
|
-
SpecialSet.implementedBy(Word_223);
|
|
1022
1083
|
/** @type {SpecialSet} */
|
|
1023
|
-
export const Word = new
|
|
1084
|
+
export const Word = new Word_282();
|
|
1085
|
+
/** @returns {Array<number>} */
|
|
1086
|
+
function buildEscapeNeeds_283() {
|
|
1087
|
+
let t_284;
|
|
1088
|
+
let t_285;
|
|
1089
|
+
let t_286;
|
|
1090
|
+
let t_287;
|
|
1091
|
+
let t_288;
|
|
1092
|
+
let t_289;
|
|
1093
|
+
let t_290;
|
|
1094
|
+
let t_291;
|
|
1095
|
+
let t_292;
|
|
1096
|
+
let t_293;
|
|
1097
|
+
let t_294;
|
|
1098
|
+
let t_295;
|
|
1099
|
+
let t_296;
|
|
1100
|
+
let t_297;
|
|
1101
|
+
let t_298;
|
|
1102
|
+
let t_299;
|
|
1103
|
+
let t_300;
|
|
1104
|
+
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;
|
|
1117
|
+
} else {
|
|
1118
|
+
if (code_310 === Codes_172.space) {
|
|
1119
|
+
t_290 = true;
|
|
1120
|
+
} else {
|
|
1121
|
+
if (code_310 === Codes_172.underscore) {
|
|
1122
|
+
t_289 = true;
|
|
1123
|
+
} else {
|
|
1124
|
+
if (Codes_172.digit0 <= code_310) {
|
|
1125
|
+
t_284 = code_310 <= Codes_172.digit9;
|
|
1126
|
+
} else {
|
|
1127
|
+
t_284 = false;
|
|
1128
|
+
}
|
|
1129
|
+
if (t_284) {
|
|
1130
|
+
t_288 = true;
|
|
1131
|
+
} else {
|
|
1132
|
+
if (Codes_172.upperA <= code_310) {
|
|
1133
|
+
t_285 = code_310 <= Codes_172.upperZ;
|
|
1134
|
+
} else {
|
|
1135
|
+
t_285 = false;
|
|
1136
|
+
}
|
|
1137
|
+
if (t_285) {
|
|
1138
|
+
t_287 = true;
|
|
1139
|
+
} else {
|
|
1140
|
+
if (Codes_172.lowerA <= code_310) {
|
|
1141
|
+
t_286 = code_310 <= Codes_172.lowerZ;
|
|
1142
|
+
} else {
|
|
1143
|
+
t_286 = false;
|
|
1144
|
+
}
|
|
1145
|
+
t_287 = t_286;
|
|
1146
|
+
}
|
|
1147
|
+
t_288 = t_287;
|
|
1148
|
+
}
|
|
1149
|
+
t_289 = t_288;
|
|
1150
|
+
}
|
|
1151
|
+
t_290 = t_289;
|
|
1152
|
+
}
|
|
1153
|
+
t_291 = t_290;
|
|
1154
|
+
}
|
|
1155
|
+
if (t_291) {
|
|
1156
|
+
t_308 = 0;
|
|
1157
|
+
} else {
|
|
1158
|
+
if (code_310 === Codes_172.ampersand) {
|
|
1159
|
+
t_307 = true;
|
|
1160
|
+
} else {
|
|
1161
|
+
if (code_310 === Codes_172.backslash) {
|
|
1162
|
+
t_306 = true;
|
|
1163
|
+
} else {
|
|
1164
|
+
if (code_310 === Codes_172.caret) {
|
|
1165
|
+
t_305 = true;
|
|
1166
|
+
} else {
|
|
1167
|
+
if (code_310 === Codes_172.curlyLeft) {
|
|
1168
|
+
t_304 = true;
|
|
1169
|
+
} else {
|
|
1170
|
+
if (code_310 === Codes_172.curlyRight) {
|
|
1171
|
+
t_303 = true;
|
|
1172
|
+
} else {
|
|
1173
|
+
if (code_310 === Codes_172.dot) {
|
|
1174
|
+
t_302 = true;
|
|
1175
|
+
} else {
|
|
1176
|
+
if (code_310 === Codes_172.peso) {
|
|
1177
|
+
t_301 = true;
|
|
1178
|
+
} else {
|
|
1179
|
+
if (code_310 === Codes_172.pipe) {
|
|
1180
|
+
t_300 = true;
|
|
1181
|
+
} else {
|
|
1182
|
+
if (code_310 === Codes_172.plus) {
|
|
1183
|
+
t_299 = true;
|
|
1184
|
+
} else {
|
|
1185
|
+
if (code_310 === Codes_172.question) {
|
|
1186
|
+
t_298 = true;
|
|
1187
|
+
} else {
|
|
1188
|
+
if (code_310 === Codes_172.roundLeft) {
|
|
1189
|
+
t_297 = true;
|
|
1190
|
+
} else {
|
|
1191
|
+
if (code_310 === Codes_172.roundRight) {
|
|
1192
|
+
t_296 = true;
|
|
1193
|
+
} else {
|
|
1194
|
+
if (code_310 === Codes_172.slash) {
|
|
1195
|
+
t_295 = true;
|
|
1196
|
+
} else {
|
|
1197
|
+
if (code_310 === Codes_172.squareLeft) {
|
|
1198
|
+
t_294 = true;
|
|
1199
|
+
} else {
|
|
1200
|
+
if (code_310 === Codes_172.squareRight) {
|
|
1201
|
+
t_293 = true;
|
|
1202
|
+
} else {
|
|
1203
|
+
if (code_310 === Codes_172.star) {
|
|
1204
|
+
t_292 = true;
|
|
1205
|
+
} else {
|
|
1206
|
+
t_292 = code_310 === Codes_172.tilde;
|
|
1207
|
+
}
|
|
1208
|
+
t_293 = t_292;
|
|
1209
|
+
}
|
|
1210
|
+
t_294 = t_293;
|
|
1211
|
+
}
|
|
1212
|
+
t_295 = t_294;
|
|
1213
|
+
}
|
|
1214
|
+
t_296 = t_295;
|
|
1215
|
+
}
|
|
1216
|
+
t_297 = t_296;
|
|
1217
|
+
}
|
|
1218
|
+
t_298 = t_297;
|
|
1219
|
+
}
|
|
1220
|
+
t_299 = t_298;
|
|
1221
|
+
}
|
|
1222
|
+
t_300 = t_299;
|
|
1223
|
+
}
|
|
1224
|
+
t_301 = t_300;
|
|
1225
|
+
}
|
|
1226
|
+
t_302 = t_301;
|
|
1227
|
+
}
|
|
1228
|
+
t_303 = t_302;
|
|
1229
|
+
}
|
|
1230
|
+
t_304 = t_303;
|
|
1231
|
+
}
|
|
1232
|
+
t_305 = t_304;
|
|
1233
|
+
}
|
|
1234
|
+
t_306 = t_305;
|
|
1235
|
+
}
|
|
1236
|
+
t_307 = t_306;
|
|
1237
|
+
}
|
|
1238
|
+
if (t_307) {
|
|
1239
|
+
t_308 = 2;
|
|
1240
|
+
} else {
|
|
1241
|
+
t_308 = 1;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
listBuilderAdd_146(escapeNeeds_309, t_308);
|
|
1245
|
+
code_310 = code_310 + 1;
|
|
1246
|
+
}
|
|
1247
|
+
return listBuilderToList_311(escapeNeeds_309);
|
|
1248
|
+
}
|
|
1249
|
+
/** @type {Array<number>} */
|
|
1250
|
+
const escapeNeeds_175 = buildEscapeNeeds_283();
|
|
1024
1251
|
/**
|
|
1025
|
-
* @param {
|
|
1026
|
-
* @returns {
|
|
1252
|
+
* @param {RegexNode} item_312
|
|
1253
|
+
* @returns {RegexNode}
|
|
1027
1254
|
*/
|
|
1028
|
-
export function entire(
|
|
1029
|
-
return new Sequence(
|
|
1255
|
+
export function entire(item_312) {
|
|
1256
|
+
return new Sequence(Object.freeze([Begin, item_312, End]));
|
|
1030
1257
|
};
|
|
1031
1258
|
/**
|
|
1032
|
-
* @param {
|
|
1033
|
-
* @param {boolean}
|
|
1259
|
+
* @param {RegexNode} item_313
|
|
1260
|
+
* @param {boolean | null} [reluctant_314]
|
|
1034
1261
|
* @returns {Repeat}
|
|
1035
1262
|
*/
|
|
1036
|
-
export function oneOrMore(
|
|
1037
|
-
|
|
1038
|
-
|
|
1263
|
+
export function oneOrMore(item_313, reluctant_314) {
|
|
1264
|
+
let reluctant_315;
|
|
1265
|
+
if (reluctant_314 == null) {
|
|
1266
|
+
reluctant_315 = false;
|
|
1267
|
+
} else {
|
|
1268
|
+
reluctant_315 = reluctant_314;
|
|
1039
1269
|
}
|
|
1040
|
-
return new Repeat(
|
|
1270
|
+
return new Repeat(item_313, 1, null, reluctant_315);
|
|
1041
1271
|
};
|
|
1042
1272
|
/**
|
|
1043
|
-
* @param {
|
|
1044
|
-
* @param {boolean}
|
|
1273
|
+
* @param {RegexNode} item_316
|
|
1274
|
+
* @param {boolean | null} [reluctant_317]
|
|
1045
1275
|
* @returns {Repeat}
|
|
1046
1276
|
*/
|
|
1047
|
-
export function optional(
|
|
1048
|
-
|
|
1049
|
-
|
|
1277
|
+
export function optional(item_316, reluctant_317) {
|
|
1278
|
+
let reluctant_318;
|
|
1279
|
+
if (reluctant_317 == null) {
|
|
1280
|
+
reluctant_318 = false;
|
|
1281
|
+
} else {
|
|
1282
|
+
reluctant_318 = reluctant_317;
|
|
1050
1283
|
}
|
|
1051
|
-
return new Repeat(
|
|
1284
|
+
return new Repeat(item_316, 0, 1, reluctant_318);
|
|
1052
1285
|
};
|