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