@temperlang/std 0.0.6 → 0.2.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 +3 -0
- package/package.json +8 -2
- package/regex.js +545 -565
- package/regex.js.map +1 -1
- package/temporal.js +35 -35
- package/temporal.js.map +1 -1
- package/testing.js +127 -133
- package/testing.js.map +1 -1
- package/config.js +0 -26
- package/config.js.map +0 -1
- package/regex__preface.js +0 -0
- package/regex__preface.js.map +0 -1
- package/temporal__preface.js +0 -0
- package/temporal__preface.js.map +0 -1
- package/testing__preface.js +0 -0
- package/testing__preface.js.map +0 -1
package/regex.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import {
|
|
2
|
-
InterfaceType as
|
|
2
|
+
InterfaceType as InterfaceType_0, requireInstanceOf as requireInstanceOf__115, requireIsSafeInteger as requireIsSafeInteger__189, listify as listify_67, compiledRegexCompileFormatted as compiledRegexCompileFormatted_75, compiledRegexCompiledFound as compiledRegexCompiledFound_79, compiledRegexCompiledFind as compiledRegexCompiledFind_82, compiledRegexCompiledReplace as compiledRegexCompiledReplace_87, listJoin as listJoin_97, eqGeneric as eqGeneric_117, listBuilderAdd as listBuilderAdd_118, strCat as strCat_127, regexFormatterPushCodeTo as regexFormatterPushCodeTo_131, stringCodePoints as stringCodePoints_138, regexFormatterAdjustCodeSet as regexFormatterAdjustCodeSet_153, listGet as listGet_157, intToString as intToString_188
|
|
3
3
|
} from "@temperlang/core";
|
|
4
|
-
function
|
|
4
|
+
function methodCompiled1() {
|
|
5
5
|
return new CompiledRegex(this);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return this.compiled().found(
|
|
7
|
+
function methodFound2(text_3) {
|
|
8
|
+
return this.compiled().found(text_3);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return this.compiled().find(
|
|
10
|
+
function methodFind4(text_5) {
|
|
11
|
+
return this.compiled().find(text_5);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return this.compiled().replace(
|
|
13
|
+
function methodReplace6(text_7, format_8) {
|
|
14
|
+
return this.compiled().replace(text_7, format_8);
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* @typedef {{
|
|
18
|
-
* compiled: () => CompiledRegex, found: (
|
|
18
|
+
* compiled: () => CompiledRegex, found: (text_3: string) => boolean, find: (text_5: string) => Map<string, Group>, replace: (text_7: string, format_8: (arg0: Map<string, Group>) => string) => string
|
|
19
19
|
* }}
|
|
20
20
|
* Regex
|
|
21
21
|
*/
|
|
22
|
-
export const Regex = new
|
|
22
|
+
export const Regex = new InterfaceType_0("Regex", [["m", "compiled", methodCompiled1], ["m", "found", methodFound2], ["m", "find", methodFind4], ["m", "replace", methodReplace6]], [], 1);
|
|
23
23
|
export class Capture {
|
|
24
24
|
/** @type {string} */
|
|
25
|
-
#
|
|
25
|
+
#name_9;
|
|
26
26
|
/** @type {Regex} */
|
|
27
|
-
#
|
|
27
|
+
#item_10;
|
|
28
28
|
/**
|
|
29
|
-
* @param {string}
|
|
30
|
-
* @param {Regex}
|
|
29
|
+
* @param {string} name_11
|
|
30
|
+
* @param {Regex} item_12
|
|
31
31
|
*/
|
|
32
|
-
constructor(
|
|
33
|
-
this.#
|
|
34
|
-
this.#
|
|
32
|
+
constructor(name_11, item_12) {
|
|
33
|
+
this.#name_9 = name_11;
|
|
34
|
+
this.#item_10 = item_12;
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
/** @returns {string} */
|
|
38
38
|
get name() {
|
|
39
|
-
return this.#
|
|
39
|
+
return this.#name_9;
|
|
40
40
|
}
|
|
41
41
|
/** @returns {Regex} */
|
|
42
42
|
get item() {
|
|
43
|
-
return this.#
|
|
43
|
+
return this.#item_10;
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
Regex.implementedBy(Capture);
|
|
@@ -48,18 +48,18 @@ Regex.implementedBy(Capture);
|
|
|
48
48
|
* @typedef {{}}
|
|
49
49
|
* CodePart
|
|
50
50
|
*/
|
|
51
|
-
export const CodePart = new
|
|
51
|
+
export const CodePart = new InterfaceType_0("CodePart", [], [Regex], 2);
|
|
52
52
|
export class CodePoints {
|
|
53
53
|
/** @type {string} */
|
|
54
|
-
#
|
|
55
|
-
/** @param {string}
|
|
56
|
-
constructor(
|
|
57
|
-
this.#
|
|
54
|
+
#value_15;
|
|
55
|
+
/** @param {string} value_16 */
|
|
56
|
+
constructor(value_16) {
|
|
57
|
+
this.#value_15 = value_16;
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
/** @returns {string} */
|
|
61
61
|
get value() {
|
|
62
|
-
return this.#
|
|
62
|
+
return this.#value_15;
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
CodePart.implementedBy(CodePoints);
|
|
@@ -67,426 +67,426 @@ CodePart.implementedBy(CodePoints);
|
|
|
67
67
|
* @typedef {{}}
|
|
68
68
|
* Special
|
|
69
69
|
*/
|
|
70
|
-
export const Special = new
|
|
70
|
+
export const Special = new InterfaceType_0("Special", [], [Regex], 2);
|
|
71
71
|
/**
|
|
72
72
|
* @typedef {{}}
|
|
73
73
|
* SpecialSet
|
|
74
74
|
*/
|
|
75
|
-
export const SpecialSet = new
|
|
75
|
+
export const SpecialSet = new InterfaceType_0("SpecialSet", [], [CodePart, Special], 3);
|
|
76
76
|
export class CodeRange {
|
|
77
77
|
/** @type {number} */
|
|
78
|
-
#
|
|
78
|
+
#min_18;
|
|
79
79
|
/** @type {number} */
|
|
80
|
-
#
|
|
80
|
+
#max_19;
|
|
81
81
|
/**
|
|
82
|
-
* @param {number}
|
|
83
|
-
* @param {number}
|
|
82
|
+
* @param {number} min_20
|
|
83
|
+
* @param {number} max_21
|
|
84
84
|
*/
|
|
85
|
-
constructor(
|
|
86
|
-
this.#
|
|
87
|
-
this.#
|
|
85
|
+
constructor(min_20, max_21) {
|
|
86
|
+
this.#min_18 = min_20;
|
|
87
|
+
this.#max_19 = max_21;
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
/** @returns {number} */
|
|
91
91
|
get min() {
|
|
92
|
-
return this.#
|
|
92
|
+
return this.#min_18;
|
|
93
93
|
}
|
|
94
94
|
/** @returns {number} */
|
|
95
95
|
get max() {
|
|
96
|
-
return this.#
|
|
96
|
+
return this.#max_19;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
CodePart.implementedBy(CodeRange);
|
|
100
100
|
export class CodeSet {
|
|
101
101
|
/** @type {Array<CodePart>} */
|
|
102
|
-
#
|
|
102
|
+
#items_24;
|
|
103
103
|
/** @type {boolean} */
|
|
104
|
-
#
|
|
104
|
+
#negated_25;
|
|
105
105
|
/**
|
|
106
|
-
* @param {Array<CodePart>}
|
|
107
|
-
* @param {boolean}
|
|
106
|
+
* @param {Array<CodePart>} items_26
|
|
107
|
+
* @param {boolean} negated_27
|
|
108
108
|
*/
|
|
109
|
-
constructor(
|
|
110
|
-
if (!(
|
|
111
|
-
|
|
109
|
+
constructor(items_26, negated_27) {
|
|
110
|
+
if (!(negated_27 !== void 0)) {
|
|
111
|
+
negated_27 = false;
|
|
112
112
|
}
|
|
113
|
-
this.#
|
|
114
|
-
this.#
|
|
113
|
+
this.#items_24 = items_26;
|
|
114
|
+
this.#negated_25 = negated_27;
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
/** @returns {Array<CodePart>} */
|
|
118
118
|
get items() {
|
|
119
|
-
return this.#
|
|
119
|
+
return this.#items_24;
|
|
120
120
|
}
|
|
121
121
|
/** @returns {boolean} */
|
|
122
122
|
get negated() {
|
|
123
|
-
return this.#
|
|
123
|
+
return this.#negated_25;
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
Regex.implementedBy(CodeSet);
|
|
127
127
|
export class Or {
|
|
128
128
|
/** @type {Array<Regex>} */
|
|
129
|
-
#
|
|
130
|
-
/** @param {Array<Regex>}
|
|
131
|
-
constructor(
|
|
132
|
-
this.#
|
|
129
|
+
#items_30;
|
|
130
|
+
/** @param {Array<Regex>} items_31 */
|
|
131
|
+
constructor(items_31) {
|
|
132
|
+
this.#items_30 = items_31;
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
/** @returns {Array<Regex>} */
|
|
136
136
|
get items() {
|
|
137
|
-
return this.#
|
|
137
|
+
return this.#items_30;
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
140
|
Regex.implementedBy(Or);
|
|
141
141
|
export class Repeat {
|
|
142
142
|
/** @type {Regex} */
|
|
143
|
-
#
|
|
143
|
+
#item_33;
|
|
144
144
|
/** @type {number} */
|
|
145
|
-
#
|
|
145
|
+
#min_34;
|
|
146
146
|
/** @type {number | null} */
|
|
147
|
-
#
|
|
147
|
+
#max_35;
|
|
148
148
|
/** @type {boolean} */
|
|
149
|
-
#
|
|
149
|
+
#reluctant_36;
|
|
150
150
|
/**
|
|
151
|
-
* @param {Regex}
|
|
152
|
-
* @param {number}
|
|
153
|
-
* @param {number | null}
|
|
154
|
-
* @param {boolean}
|
|
151
|
+
* @param {Regex} item_37
|
|
152
|
+
* @param {number} min_38
|
|
153
|
+
* @param {number | null} max_39
|
|
154
|
+
* @param {boolean} reluctant_40
|
|
155
155
|
*/
|
|
156
|
-
constructor(
|
|
157
|
-
if (!(
|
|
158
|
-
|
|
156
|
+
constructor(item_37, min_38, max_39, reluctant_40) {
|
|
157
|
+
if (!(reluctant_40 !== void 0)) {
|
|
158
|
+
reluctant_40 = false;
|
|
159
159
|
}
|
|
160
|
-
this.#
|
|
161
|
-
this.#
|
|
162
|
-
this.#
|
|
163
|
-
this.#
|
|
160
|
+
this.#item_33 = item_37;
|
|
161
|
+
this.#min_34 = min_38;
|
|
162
|
+
this.#max_35 = max_39;
|
|
163
|
+
this.#reluctant_36 = reluctant_40;
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
/** @returns {Regex} */
|
|
167
167
|
get item() {
|
|
168
|
-
return this.#
|
|
168
|
+
return this.#item_33;
|
|
169
169
|
}
|
|
170
170
|
/** @returns {number} */
|
|
171
171
|
get min() {
|
|
172
|
-
return this.#
|
|
172
|
+
return this.#min_34;
|
|
173
173
|
}
|
|
174
174
|
/** @returns {number | null} */
|
|
175
175
|
get max() {
|
|
176
|
-
return this.#
|
|
176
|
+
return this.#max_35;
|
|
177
177
|
}
|
|
178
178
|
/** @returns {boolean} */
|
|
179
179
|
get reluctant() {
|
|
180
|
-
return this.#
|
|
180
|
+
return this.#reluctant_36;
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
Regex.implementedBy(Repeat);
|
|
184
184
|
export class Sequence {
|
|
185
185
|
/** @type {Array<Regex>} */
|
|
186
|
-
#
|
|
187
|
-
/** @param {Array<Regex>}
|
|
188
|
-
constructor(
|
|
189
|
-
this.#
|
|
186
|
+
#items_45;
|
|
187
|
+
/** @param {Array<Regex>} items_46 */
|
|
188
|
+
constructor(items_46) {
|
|
189
|
+
this.#items_45 = items_46;
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
/** @returns {Array<Regex>} */
|
|
193
193
|
get items() {
|
|
194
|
-
return this.#
|
|
194
|
+
return this.#items_45;
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
Regex.implementedBy(Sequence);
|
|
198
198
|
export class Group {
|
|
199
199
|
/** @type {string} */
|
|
200
|
-
#
|
|
200
|
+
#name_48;
|
|
201
201
|
/** @type {string} */
|
|
202
|
-
#
|
|
202
|
+
#value_49;
|
|
203
203
|
/** @type {number} */
|
|
204
|
-
#
|
|
204
|
+
#codePointsBegin_50;
|
|
205
205
|
/**
|
|
206
|
-
* @param {string}
|
|
207
|
-
* @param {string}
|
|
208
|
-
* @param {number}
|
|
206
|
+
* @param {string} name_51
|
|
207
|
+
* @param {string} value_52
|
|
208
|
+
* @param {number} codePointsBegin_53
|
|
209
209
|
*/
|
|
210
|
-
constructor(
|
|
211
|
-
this.#
|
|
212
|
-
this.#
|
|
213
|
-
this.#
|
|
210
|
+
constructor(name_51, value_52, codePointsBegin_53) {
|
|
211
|
+
this.#name_48 = name_51;
|
|
212
|
+
this.#value_49 = value_52;
|
|
213
|
+
this.#codePointsBegin_50 = codePointsBegin_53;
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
216
|
/** @returns {string} */
|
|
217
217
|
get name() {
|
|
218
|
-
return this.#
|
|
218
|
+
return this.#name_48;
|
|
219
219
|
}
|
|
220
220
|
/** @returns {string} */
|
|
221
221
|
get value() {
|
|
222
|
-
return this.#
|
|
222
|
+
return this.#value_49;
|
|
223
223
|
}
|
|
224
224
|
/** @returns {number} */
|
|
225
225
|
get codePointsBegin() {
|
|
226
|
-
return this.#
|
|
226
|
+
return this.#codePointsBegin_50;
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
class
|
|
229
|
+
class RegexRefs_57 {
|
|
230
230
|
/** @type {CodePoints} */
|
|
231
|
-
#
|
|
231
|
+
#codePoints_58;
|
|
232
232
|
/** @type {Group} */
|
|
233
|
-
#
|
|
233
|
+
#group_59;
|
|
234
234
|
/** @type {Or} */
|
|
235
|
-
#
|
|
235
|
+
#orObject_60;
|
|
236
236
|
/**
|
|
237
|
-
* @param {CodePoints}
|
|
238
|
-
* @param {Group}
|
|
239
|
-
* @param {Or}
|
|
237
|
+
* @param {CodePoints} codePoints_61
|
|
238
|
+
* @param {Group} group_62
|
|
239
|
+
* @param {Or} orObject_63
|
|
240
240
|
*/
|
|
241
|
-
constructor(
|
|
242
|
-
let
|
|
243
|
-
let
|
|
244
|
-
let
|
|
245
|
-
if (!(
|
|
246
|
-
|
|
247
|
-
|
|
241
|
+
constructor(codePoints_61, group_62, orObject_63) {
|
|
242
|
+
let t_64;
|
|
243
|
+
let t_65;
|
|
244
|
+
let t_66;
|
|
245
|
+
if (!(codePoints_61 !== void 0)) {
|
|
246
|
+
t_64 = new CodePoints("");
|
|
247
|
+
codePoints_61 = t_64;
|
|
248
248
|
}
|
|
249
|
-
if (!(
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
if (!(group_62 !== void 0)) {
|
|
250
|
+
t_65 = new Group("", "", 0);
|
|
251
|
+
group_62 = t_65;
|
|
252
252
|
}
|
|
253
|
-
if (!(
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
if (!(orObject_63 !== void 0)) {
|
|
254
|
+
t_66 = new Or(listify_67());
|
|
255
|
+
orObject_63 = t_66;
|
|
256
256
|
}
|
|
257
|
-
this.#
|
|
258
|
-
this.#
|
|
259
|
-
this.#
|
|
257
|
+
this.#codePoints_58 = codePoints_61;
|
|
258
|
+
this.#group_59 = group_62;
|
|
259
|
+
this.#orObject_60 = orObject_63;
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
262
|
/** @returns {CodePoints} */
|
|
263
263
|
get codePoints() {
|
|
264
|
-
return this.#
|
|
264
|
+
return this.#codePoints_58;
|
|
265
265
|
}
|
|
266
266
|
/** @returns {Group} */
|
|
267
267
|
get group() {
|
|
268
|
-
return this.#
|
|
268
|
+
return this.#group_59;
|
|
269
269
|
}
|
|
270
270
|
/** @returns {Or} */
|
|
271
271
|
get orObject() {
|
|
272
|
-
return this.#
|
|
272
|
+
return this.#orObject_60;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
export class CompiledRegex {
|
|
276
276
|
/** @type {Regex} */
|
|
277
|
-
#
|
|
278
|
-
/** @param {Regex}
|
|
279
|
-
constructor(
|
|
280
|
-
this.#
|
|
281
|
-
let
|
|
282
|
-
let
|
|
283
|
-
this.#
|
|
277
|
+
#data_71;
|
|
278
|
+
/** @param {Regex} data_72 */
|
|
279
|
+
constructor(data_72) {
|
|
280
|
+
this.#data_71 = data_72;
|
|
281
|
+
let t_73 = this.format();
|
|
282
|
+
let t_74 = compiledRegexCompileFormatted_75(this, t_73);
|
|
283
|
+
this.#compiled_76 = t_74;
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
/**
|
|
287
|
-
* @param {string}
|
|
287
|
+
* @param {string} text_78
|
|
288
288
|
* @returns {boolean}
|
|
289
289
|
*/
|
|
290
|
-
found(
|
|
291
|
-
return
|
|
290
|
+
found(text_78) {
|
|
291
|
+
return compiledRegexCompiledFound_79(this, this.#compiled_76, text_78);
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
|
-
* @param {string}
|
|
294
|
+
* @param {string} text_81
|
|
295
295
|
* @returns {Map<string, Group>}
|
|
296
296
|
*/
|
|
297
|
-
find(
|
|
298
|
-
return
|
|
297
|
+
find(text_81) {
|
|
298
|
+
return compiledRegexCompiledFind_82(this, this.#compiled_76, text_81, regexRefs_83);
|
|
299
299
|
}
|
|
300
300
|
/**
|
|
301
|
-
* @param {string}
|
|
302
|
-
* @param {(arg0: Map<string, Group>) => string}
|
|
301
|
+
* @param {string} text_85
|
|
302
|
+
* @param {(arg0: Map<string, Group>) => string} format_86
|
|
303
303
|
* @returns {string}
|
|
304
304
|
*/
|
|
305
|
-
replace(
|
|
306
|
-
return
|
|
305
|
+
replace(text_85, format_86) {
|
|
306
|
+
return compiledRegexCompiledReplace_87(this, this.#compiled_76, text_85, format_86, regexRefs_83);
|
|
307
307
|
}
|
|
308
308
|
/** @type {unknown} */
|
|
309
|
-
#
|
|
309
|
+
#compiled_76;
|
|
310
310
|
/** @returns {string} */
|
|
311
311
|
format() {
|
|
312
|
-
return new
|
|
312
|
+
return new RegexFormatter_89().format(this.#data_71);
|
|
313
313
|
}
|
|
314
314
|
/** @returns {Regex} */
|
|
315
315
|
get data() {
|
|
316
|
-
return this.#
|
|
316
|
+
return this.#data_71;
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
|
-
class
|
|
319
|
+
class RegexFormatter_89 {
|
|
320
320
|
/** @type {Array<string>} */
|
|
321
|
-
#
|
|
321
|
+
#out_91;
|
|
322
322
|
/**
|
|
323
|
-
* @param {Regex}
|
|
323
|
+
* @param {Regex} regex_93
|
|
324
324
|
* @returns {string}
|
|
325
325
|
*/
|
|
326
|
-
format(
|
|
327
|
-
this.pushRegex(
|
|
328
|
-
let
|
|
329
|
-
function
|
|
330
|
-
return
|
|
326
|
+
format(regex_93) {
|
|
327
|
+
this.pushRegex(regex_93);
|
|
328
|
+
let t_94 = this.#out_91;
|
|
329
|
+
function fn_95(x_96) {
|
|
330
|
+
return x_96;
|
|
331
331
|
}
|
|
332
|
-
return
|
|
332
|
+
return listJoin_97(t_94, "", fn_95);
|
|
333
333
|
}
|
|
334
|
-
/** @param {Regex}
|
|
335
|
-
pushRegex(
|
|
336
|
-
let
|
|
337
|
-
let
|
|
338
|
-
let
|
|
339
|
-
let
|
|
340
|
-
let
|
|
341
|
-
let
|
|
342
|
-
let
|
|
343
|
-
let
|
|
344
|
-
let
|
|
345
|
-
let
|
|
346
|
-
let
|
|
347
|
-
let
|
|
348
|
-
let
|
|
349
|
-
let
|
|
350
|
-
let
|
|
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
351
|
try {
|
|
352
|
-
|
|
353
|
-
|
|
352
|
+
requireInstanceOf__115(regex_99, Capture);
|
|
353
|
+
t_101 = true;
|
|
354
354
|
} catch {
|
|
355
|
-
|
|
355
|
+
t_101 = false;
|
|
356
356
|
}
|
|
357
|
-
|
|
358
|
-
if (
|
|
357
|
+
s__1245_116: {
|
|
358
|
+
if (t_101) {
|
|
359
359
|
try {
|
|
360
|
-
|
|
360
|
+
t_102 = requireInstanceOf__115(regex_99, Capture);
|
|
361
361
|
} catch {
|
|
362
|
-
break
|
|
362
|
+
break s__1245_116;
|
|
363
363
|
}
|
|
364
|
-
this.pushCapture(
|
|
364
|
+
this.pushCapture(t_102);
|
|
365
365
|
} else {
|
|
366
366
|
try {
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
requireInstanceOf__115(regex_99, CodePoints);
|
|
368
|
+
t_103 = true;
|
|
369
369
|
} catch {
|
|
370
|
-
|
|
370
|
+
t_103 = false;
|
|
371
371
|
}
|
|
372
|
-
if (
|
|
372
|
+
if (t_103) {
|
|
373
373
|
try {
|
|
374
|
-
|
|
374
|
+
t_104 = requireInstanceOf__115(regex_99, CodePoints);
|
|
375
375
|
} catch {
|
|
376
|
-
break
|
|
376
|
+
break s__1245_116;
|
|
377
377
|
}
|
|
378
|
-
this.pushCodePoints(
|
|
378
|
+
this.pushCodePoints(t_104, false);
|
|
379
379
|
} else {
|
|
380
380
|
try {
|
|
381
|
-
|
|
382
|
-
|
|
381
|
+
requireInstanceOf__115(regex_99, CodeRange);
|
|
382
|
+
t_105 = true;
|
|
383
383
|
} catch {
|
|
384
|
-
|
|
384
|
+
t_105 = false;
|
|
385
385
|
}
|
|
386
|
-
if (
|
|
386
|
+
if (t_105) {
|
|
387
387
|
try {
|
|
388
|
-
|
|
388
|
+
t_106 = requireInstanceOf__115(regex_99, CodeRange);
|
|
389
389
|
} catch {
|
|
390
|
-
break
|
|
390
|
+
break s__1245_116;
|
|
391
391
|
}
|
|
392
|
-
this.pushCodeRange(
|
|
392
|
+
this.pushCodeRange(t_106);
|
|
393
393
|
} else {
|
|
394
394
|
try {
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
requireInstanceOf__115(regex_99, CodeSet);
|
|
396
|
+
t_107 = true;
|
|
397
397
|
} catch {
|
|
398
|
-
|
|
398
|
+
t_107 = false;
|
|
399
399
|
}
|
|
400
|
-
if (
|
|
400
|
+
if (t_107) {
|
|
401
401
|
try {
|
|
402
|
-
|
|
402
|
+
t_108 = requireInstanceOf__115(regex_99, CodeSet);
|
|
403
403
|
} catch {
|
|
404
|
-
break
|
|
404
|
+
break s__1245_116;
|
|
405
405
|
}
|
|
406
|
-
this.pushCodeSet(
|
|
406
|
+
this.pushCodeSet(t_108);
|
|
407
407
|
} else {
|
|
408
408
|
try {
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
requireInstanceOf__115(regex_99, Or);
|
|
410
|
+
t_109 = true;
|
|
411
411
|
} catch {
|
|
412
|
-
|
|
412
|
+
t_109 = false;
|
|
413
413
|
}
|
|
414
|
-
if (
|
|
414
|
+
if (t_109) {
|
|
415
415
|
try {
|
|
416
|
-
|
|
416
|
+
t_110 = requireInstanceOf__115(regex_99, Or);
|
|
417
417
|
} catch {
|
|
418
|
-
break
|
|
418
|
+
break s__1245_116;
|
|
419
419
|
}
|
|
420
|
-
this.pushOr(
|
|
420
|
+
this.pushOr(t_110);
|
|
421
421
|
} else {
|
|
422
422
|
try {
|
|
423
|
-
|
|
424
|
-
|
|
423
|
+
requireInstanceOf__115(regex_99, Repeat);
|
|
424
|
+
t_111 = true;
|
|
425
425
|
} catch {
|
|
426
|
-
|
|
426
|
+
t_111 = false;
|
|
427
427
|
}
|
|
428
|
-
if (
|
|
428
|
+
if (t_111) {
|
|
429
429
|
try {
|
|
430
|
-
|
|
430
|
+
t_112 = requireInstanceOf__115(regex_99, Repeat);
|
|
431
431
|
} catch {
|
|
432
|
-
break
|
|
432
|
+
break s__1245_116;
|
|
433
433
|
}
|
|
434
|
-
this.pushRepeat(
|
|
434
|
+
this.pushRepeat(t_112);
|
|
435
435
|
} else {
|
|
436
436
|
try {
|
|
437
|
-
|
|
438
|
-
|
|
437
|
+
requireInstanceOf__115(regex_99, Sequence);
|
|
438
|
+
t_113 = true;
|
|
439
439
|
} catch {
|
|
440
|
-
|
|
440
|
+
t_113 = false;
|
|
441
441
|
}
|
|
442
|
-
if (
|
|
442
|
+
if (t_113) {
|
|
443
443
|
try {
|
|
444
|
-
|
|
444
|
+
t_114 = requireInstanceOf__115(regex_99, Sequence);
|
|
445
445
|
} catch {
|
|
446
|
-
break
|
|
446
|
+
break s__1245_116;
|
|
447
447
|
}
|
|
448
|
-
this.pushSequence(
|
|
449
|
-
} else if (
|
|
448
|
+
this.pushSequence(t_114);
|
|
449
|
+
} else if (eqGeneric_117(regex_99, Begin)) {
|
|
450
450
|
try {
|
|
451
|
-
|
|
451
|
+
listBuilderAdd_118(this.#out_91, "^");
|
|
452
452
|
} catch {
|
|
453
|
-
break
|
|
453
|
+
break s__1245_116;
|
|
454
454
|
}
|
|
455
|
-
} else if (
|
|
455
|
+
} else if (eqGeneric_117(regex_99, Dot)) {
|
|
456
456
|
try {
|
|
457
|
-
|
|
457
|
+
listBuilderAdd_118(this.#out_91, ".");
|
|
458
458
|
} catch {
|
|
459
|
-
break
|
|
459
|
+
break s__1245_116;
|
|
460
460
|
}
|
|
461
|
-
} else if (
|
|
461
|
+
} else if (eqGeneric_117(regex_99, End)) {
|
|
462
462
|
try {
|
|
463
|
-
|
|
463
|
+
listBuilderAdd_118(this.#out_91, "\u0024");
|
|
464
464
|
} catch {
|
|
465
|
-
break
|
|
465
|
+
break s__1245_116;
|
|
466
466
|
}
|
|
467
|
-
} else if (
|
|
467
|
+
} else if (eqGeneric_117(regex_99, WordBoundary)) {
|
|
468
468
|
try {
|
|
469
|
-
|
|
469
|
+
listBuilderAdd_118(this.#out_91, "\\b");
|
|
470
470
|
} catch {
|
|
471
|
-
break
|
|
471
|
+
break s__1245_116;
|
|
472
472
|
}
|
|
473
|
-
} else if (
|
|
473
|
+
} else if (eqGeneric_117(regex_99, Digit)) {
|
|
474
474
|
try {
|
|
475
|
-
|
|
475
|
+
listBuilderAdd_118(this.#out_91, "\\d");
|
|
476
476
|
} catch {
|
|
477
|
-
break
|
|
477
|
+
break s__1245_116;
|
|
478
478
|
}
|
|
479
|
-
} else if (
|
|
479
|
+
} else if (eqGeneric_117(regex_99, Space)) {
|
|
480
480
|
try {
|
|
481
|
-
|
|
481
|
+
listBuilderAdd_118(this.#out_91, "\\s");
|
|
482
482
|
} catch {
|
|
483
|
-
break
|
|
483
|
+
break s__1245_116;
|
|
484
484
|
}
|
|
485
|
-
} else if (
|
|
485
|
+
} else if (eqGeneric_117(regex_99, Word)) {
|
|
486
486
|
try {
|
|
487
|
-
|
|
487
|
+
listBuilderAdd_118(this.#out_91, "\\w");
|
|
488
488
|
} catch {
|
|
489
|
-
break
|
|
489
|
+
break s__1245_116;
|
|
490
490
|
}
|
|
491
491
|
} else {
|
|
492
492
|
void 0;
|
|
@@ -497,330 +497,310 @@ class RegexFormatter_186 {
|
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
|
|
501
|
-
return
|
|
500
|
+
return_100 = void 0;
|
|
501
|
+
return return_100;
|
|
502
502
|
}
|
|
503
|
-
throw
|
|
503
|
+
throw Error();
|
|
504
504
|
}
|
|
505
|
-
/** @param {Capture}
|
|
506
|
-
pushCapture(
|
|
507
|
-
|
|
508
|
-
let
|
|
509
|
-
let
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
this.pushCaptureName(t_219, t_217);
|
|
516
|
-
t_218 = capture_215.item;
|
|
517
|
-
this.pushRegex(t_218);
|
|
518
|
-
listBuilderAdd_0(this.#out_188, ")");
|
|
519
|
-
return_216 = void 0;
|
|
520
|
-
}
|
|
521
|
-
return return_216;
|
|
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
|
+
return;
|
|
522
515
|
}
|
|
523
516
|
/**
|
|
524
|
-
* @param {Array<string>}
|
|
525
|
-
* @param {string}
|
|
517
|
+
* @param {Array<string>} out_125
|
|
518
|
+
* @param {string} name_126
|
|
526
519
|
*/
|
|
527
|
-
pushCaptureName(
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
listBuilderAdd_0(out_221, strCat_9("?\u003c", name_222, "\u003e"));
|
|
531
|
-
return_223 = void 0;
|
|
532
|
-
}
|
|
533
|
-
return return_223;
|
|
520
|
+
pushCaptureName(out_125, name_126) {
|
|
521
|
+
listBuilderAdd_118(out_125, strCat_127("?\u003c", name_126, "\u003e"));
|
|
522
|
+
return;
|
|
534
523
|
}
|
|
535
524
|
/**
|
|
536
|
-
* @param {number}
|
|
537
|
-
* @param {boolean}
|
|
525
|
+
* @param {number} code_129
|
|
526
|
+
* @param {boolean} insideCodeSet_130
|
|
538
527
|
*/
|
|
539
|
-
pushCode(
|
|
540
|
-
|
|
528
|
+
pushCode(code_129, insideCodeSet_130) {
|
|
529
|
+
regexFormatterPushCodeTo_131(this, this.#out_91, code_129, insideCodeSet_130);
|
|
541
530
|
return;
|
|
542
531
|
}
|
|
543
532
|
/**
|
|
544
|
-
* @param {CodePoints}
|
|
545
|
-
* @param {boolean}
|
|
533
|
+
* @param {CodePoints} codePoints_133
|
|
534
|
+
* @param {boolean} insideCodeSet_134
|
|
546
535
|
*/
|
|
547
|
-
pushCodePoints(
|
|
548
|
-
let
|
|
549
|
-
let
|
|
550
|
-
let
|
|
551
|
-
let
|
|
536
|
+
pushCodePoints(codePoints_133, insideCodeSet_134) {
|
|
537
|
+
let t_135;
|
|
538
|
+
let t_136;
|
|
539
|
+
let t_137 = stringCodePoints_138(codePoints_133.value);
|
|
540
|
+
let slice_139 = t_137;
|
|
552
541
|
while (true) {
|
|
553
|
-
if (!
|
|
554
|
-
|
|
555
|
-
this.pushCode(
|
|
556
|
-
|
|
557
|
-
|
|
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;
|
|
558
547
|
} else {
|
|
559
548
|
break;
|
|
560
549
|
}
|
|
561
550
|
}
|
|
562
551
|
return;
|
|
563
552
|
}
|
|
564
|
-
/** @param {CodeRange}
|
|
565
|
-
pushCodeRange(
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
listBuilderAdd_0(this.#out_188, "]");
|
|
571
|
-
return_236 = void 0;
|
|
572
|
-
}
|
|
573
|
-
return return_236;
|
|
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;
|
|
574
559
|
}
|
|
575
|
-
/** @param {CodeRange}
|
|
576
|
-
pushCodeRangeUnwrapped(
|
|
577
|
-
let
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
t_240 = codeRange_238.max;
|
|
584
|
-
this.pushCode(t_240, true);
|
|
585
|
-
return_239 = void 0;
|
|
586
|
-
}
|
|
587
|
-
return return_239;
|
|
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;
|
|
588
568
|
}
|
|
589
|
-
/** @param {CodeSet}
|
|
590
|
-
pushCodeSet(
|
|
591
|
-
let
|
|
592
|
-
let
|
|
593
|
-
let
|
|
594
|
-
let
|
|
595
|
-
const
|
|
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);
|
|
596
576
|
try {
|
|
597
|
-
|
|
598
|
-
|
|
577
|
+
requireInstanceOf__115(adjusted_152, CodeSet);
|
|
578
|
+
t_149 = true;
|
|
599
579
|
} catch {
|
|
600
|
-
|
|
580
|
+
t_149 = false;
|
|
601
581
|
}
|
|
602
|
-
|
|
603
|
-
if (
|
|
604
|
-
|
|
582
|
+
s__1252_154: {
|
|
583
|
+
if (t_149) {
|
|
584
|
+
s__1253_155: {
|
|
605
585
|
try {
|
|
606
|
-
|
|
607
|
-
|
|
586
|
+
t_150 = requireInstanceOf__115(adjusted_152, CodeSet);
|
|
587
|
+
listBuilderAdd_118(this.#out_91, "[");
|
|
608
588
|
} catch {
|
|
609
|
-
break
|
|
589
|
+
break s__1253_155;
|
|
610
590
|
}
|
|
611
|
-
if (
|
|
591
|
+
if (t_150.negated) {
|
|
612
592
|
try {
|
|
613
|
-
|
|
593
|
+
listBuilderAdd_118(this.#out_91, "^");
|
|
614
594
|
} catch {
|
|
615
|
-
break
|
|
595
|
+
break s__1253_155;
|
|
616
596
|
}
|
|
617
597
|
} else {
|
|
618
598
|
void 0;
|
|
619
599
|
}
|
|
620
|
-
let
|
|
600
|
+
let i_156 = 0;
|
|
621
601
|
while (true) {
|
|
622
|
-
|
|
623
|
-
if (
|
|
602
|
+
t_148 = t_150.items.length;
|
|
603
|
+
if (i_156 < t_148) {
|
|
624
604
|
try {
|
|
625
|
-
|
|
605
|
+
t_151 = listGet_157(t_150.items, i_156);
|
|
626
606
|
} catch {
|
|
627
|
-
break
|
|
607
|
+
break s__1253_155;
|
|
628
608
|
}
|
|
629
|
-
this.pushCodeSetItem(
|
|
630
|
-
|
|
609
|
+
this.pushCodeSetItem(t_151);
|
|
610
|
+
i_156 = i_156 + 1;
|
|
631
611
|
} else {
|
|
632
612
|
break;
|
|
633
613
|
}
|
|
634
614
|
}
|
|
635
615
|
try {
|
|
636
|
-
|
|
637
|
-
break
|
|
616
|
+
listBuilderAdd_118(this.#out_91, "]");
|
|
617
|
+
break s__1252_154;
|
|
638
618
|
} catch {
|
|
639
619
|
}
|
|
640
620
|
}
|
|
641
|
-
throw
|
|
621
|
+
throw Error();
|
|
642
622
|
}
|
|
643
|
-
this.pushRegex(
|
|
623
|
+
this.pushRegex(adjusted_152);
|
|
644
624
|
}
|
|
645
625
|
return;
|
|
646
626
|
}
|
|
647
|
-
/** @param {CodePart}
|
|
648
|
-
pushCodeSetItem(
|
|
649
|
-
let
|
|
650
|
-
let
|
|
651
|
-
let
|
|
652
|
-
let
|
|
653
|
-
let
|
|
654
|
-
let
|
|
655
|
-
let
|
|
627
|
+
/** @param {CodePart} codePart_159 */
|
|
628
|
+
pushCodeSetItem(codePart_159) {
|
|
629
|
+
let return_160;
|
|
630
|
+
let t_161;
|
|
631
|
+
let t_162;
|
|
632
|
+
let t_163;
|
|
633
|
+
let t_164;
|
|
634
|
+
let t_165;
|
|
635
|
+
let t_166;
|
|
656
636
|
try {
|
|
657
|
-
|
|
658
|
-
|
|
637
|
+
requireInstanceOf__115(codePart_159, CodePoints);
|
|
638
|
+
t_161 = true;
|
|
659
639
|
} catch {
|
|
660
|
-
|
|
640
|
+
t_161 = false;
|
|
661
641
|
}
|
|
662
|
-
|
|
663
|
-
if (
|
|
642
|
+
s__1259_167: {
|
|
643
|
+
if (t_161) {
|
|
664
644
|
try {
|
|
665
|
-
|
|
645
|
+
t_162 = requireInstanceOf__115(codePart_159, CodePoints);
|
|
666
646
|
} catch {
|
|
667
|
-
break
|
|
647
|
+
break s__1259_167;
|
|
668
648
|
}
|
|
669
|
-
this.pushCodePoints(
|
|
649
|
+
this.pushCodePoints(t_162, true);
|
|
670
650
|
} else {
|
|
671
651
|
try {
|
|
672
|
-
|
|
673
|
-
|
|
652
|
+
requireInstanceOf__115(codePart_159, CodeRange);
|
|
653
|
+
t_163 = true;
|
|
674
654
|
} catch {
|
|
675
|
-
|
|
655
|
+
t_163 = false;
|
|
676
656
|
}
|
|
677
|
-
if (
|
|
657
|
+
if (t_163) {
|
|
678
658
|
try {
|
|
679
|
-
|
|
659
|
+
t_164 = requireInstanceOf__115(codePart_159, CodeRange);
|
|
680
660
|
} catch {
|
|
681
|
-
break
|
|
661
|
+
break s__1259_167;
|
|
682
662
|
}
|
|
683
|
-
this.pushCodeRangeUnwrapped(
|
|
663
|
+
this.pushCodeRangeUnwrapped(t_164);
|
|
684
664
|
} else {
|
|
685
665
|
try {
|
|
686
|
-
|
|
687
|
-
|
|
666
|
+
requireInstanceOf__115(codePart_159, SpecialSet);
|
|
667
|
+
t_165 = true;
|
|
688
668
|
} catch {
|
|
689
|
-
|
|
669
|
+
t_165 = false;
|
|
690
670
|
}
|
|
691
|
-
if (
|
|
671
|
+
if (t_165) {
|
|
692
672
|
try {
|
|
693
|
-
|
|
673
|
+
t_166 = requireInstanceOf__115(codePart_159, SpecialSet);
|
|
694
674
|
} catch {
|
|
695
|
-
break
|
|
675
|
+
break s__1259_167;
|
|
696
676
|
}
|
|
697
|
-
this.pushRegex(
|
|
677
|
+
this.pushRegex(t_166);
|
|
698
678
|
} else {
|
|
699
679
|
void 0;
|
|
700
680
|
}
|
|
701
681
|
}
|
|
702
682
|
}
|
|
703
|
-
|
|
704
|
-
return
|
|
683
|
+
return_160 = void 0;
|
|
684
|
+
return return_160;
|
|
705
685
|
}
|
|
706
|
-
throw
|
|
686
|
+
throw Error();
|
|
707
687
|
}
|
|
708
|
-
/** @param {Or}
|
|
709
|
-
pushOr(
|
|
710
|
-
let
|
|
711
|
-
let
|
|
712
|
-
let
|
|
713
|
-
|
|
714
|
-
|
|
688
|
+
/** @param {Or} or_169 */
|
|
689
|
+
pushOr(or_169) {
|
|
690
|
+
let t_170;
|
|
691
|
+
let t_171;
|
|
692
|
+
let t_172;
|
|
693
|
+
s__1261_173: if (! ! or_169.items.length) {
|
|
694
|
+
s__1262_174: {
|
|
715
695
|
try {
|
|
716
|
-
|
|
717
|
-
|
|
696
|
+
listBuilderAdd_118(this.#out_91, "(?:");
|
|
697
|
+
t_171 = listGet_157(or_169.items, 0);
|
|
718
698
|
} catch {
|
|
719
|
-
break
|
|
699
|
+
break s__1262_174;
|
|
720
700
|
}
|
|
721
|
-
this.pushRegex(
|
|
722
|
-
let
|
|
701
|
+
this.pushRegex(t_171);
|
|
702
|
+
let i_175 = 1;
|
|
723
703
|
while (true) {
|
|
724
|
-
|
|
725
|
-
if (
|
|
704
|
+
t_170 = or_169.items.length;
|
|
705
|
+
if (i_175 < t_170) {
|
|
726
706
|
try {
|
|
727
|
-
|
|
728
|
-
|
|
707
|
+
listBuilderAdd_118(this.#out_91, "|");
|
|
708
|
+
t_172 = listGet_157(or_169.items, i_175);
|
|
729
709
|
} catch {
|
|
730
710
|
break;
|
|
731
711
|
}
|
|
732
|
-
this.pushRegex(
|
|
733
|
-
|
|
712
|
+
this.pushRegex(t_172);
|
|
713
|
+
i_175 = i_175 + 1;
|
|
734
714
|
} else {
|
|
735
715
|
try {
|
|
736
|
-
|
|
716
|
+
listBuilderAdd_118(this.#out_91, ")");
|
|
737
717
|
} catch {
|
|
738
|
-
break
|
|
718
|
+
break s__1262_174;
|
|
739
719
|
}
|
|
740
|
-
break
|
|
720
|
+
break s__1261_173;
|
|
741
721
|
}
|
|
742
722
|
}
|
|
743
723
|
}
|
|
744
|
-
throw
|
|
724
|
+
throw Error();
|
|
745
725
|
}
|
|
746
726
|
return;
|
|
747
727
|
}
|
|
748
|
-
/** @param {Repeat}
|
|
749
|
-
pushRepeat(
|
|
750
|
-
let
|
|
751
|
-
let
|
|
752
|
-
let
|
|
753
|
-
let
|
|
754
|
-
let
|
|
755
|
-
let
|
|
756
|
-
let
|
|
757
|
-
|
|
758
|
-
let
|
|
759
|
-
let
|
|
728
|
+
/** @param {Repeat} repeat_177 */
|
|
729
|
+
pushRepeat(repeat_177) {
|
|
730
|
+
let return_178;
|
|
731
|
+
let t_179;
|
|
732
|
+
let t_180;
|
|
733
|
+
let t_181;
|
|
734
|
+
let t_182;
|
|
735
|
+
let t_183;
|
|
736
|
+
let t_184;
|
|
737
|
+
s__1266_185: {
|
|
738
|
+
let min_186;
|
|
739
|
+
let max_187;
|
|
760
740
|
try {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
this.pushRegex(
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
741
|
+
listBuilderAdd_118(this.#out_91, "(?:");
|
|
742
|
+
t_179 = repeat_177.item;
|
|
743
|
+
this.pushRegex(t_179);
|
|
744
|
+
listBuilderAdd_118(this.#out_91, ")");
|
|
745
|
+
min_186 = repeat_177.min;
|
|
746
|
+
max_187 = repeat_177.max;
|
|
767
747
|
} catch {
|
|
768
|
-
break
|
|
748
|
+
break s__1266_185;
|
|
769
749
|
}
|
|
770
|
-
if (
|
|
771
|
-
|
|
750
|
+
if (min_186 === 0) {
|
|
751
|
+
t_180 = max_187 === 1;
|
|
772
752
|
} else {
|
|
773
|
-
|
|
753
|
+
t_180 = false;
|
|
774
754
|
}
|
|
775
|
-
if (
|
|
755
|
+
if (t_180) {
|
|
776
756
|
try {
|
|
777
|
-
|
|
757
|
+
listBuilderAdd_118(this.#out_91, "?");
|
|
778
758
|
} catch {
|
|
779
|
-
break
|
|
759
|
+
break s__1266_185;
|
|
780
760
|
}
|
|
781
761
|
} else {
|
|
782
|
-
if (
|
|
783
|
-
|
|
762
|
+
if (min_186 === 0) {
|
|
763
|
+
t_181 = max_187 === null;
|
|
784
764
|
} else {
|
|
785
|
-
|
|
765
|
+
t_181 = false;
|
|
786
766
|
}
|
|
787
|
-
if (
|
|
767
|
+
if (t_181) {
|
|
788
768
|
try {
|
|
789
|
-
|
|
769
|
+
listBuilderAdd_118(this.#out_91, "*");
|
|
790
770
|
} catch {
|
|
791
|
-
break
|
|
771
|
+
break s__1266_185;
|
|
792
772
|
}
|
|
793
773
|
} else {
|
|
794
|
-
if (
|
|
795
|
-
|
|
774
|
+
if (min_186 === 1) {
|
|
775
|
+
t_182 = max_187 === null;
|
|
796
776
|
} else {
|
|
797
|
-
|
|
777
|
+
t_182 = false;
|
|
798
778
|
}
|
|
799
|
-
if (
|
|
779
|
+
if (t_182) {
|
|
800
780
|
try {
|
|
801
|
-
|
|
781
|
+
listBuilderAdd_118(this.#out_91, "+");
|
|
802
782
|
} catch {
|
|
803
|
-
break
|
|
783
|
+
break s__1266_185;
|
|
804
784
|
}
|
|
805
785
|
} else {
|
|
806
786
|
try {
|
|
807
|
-
|
|
787
|
+
listBuilderAdd_118(this.#out_91, strCat_127("{", intToString_188(min_186)));
|
|
808
788
|
} catch {
|
|
809
|
-
break
|
|
789
|
+
break s__1266_185;
|
|
810
790
|
}
|
|
811
|
-
if (
|
|
791
|
+
if (min_186 !== max_187) {
|
|
812
792
|
try {
|
|
813
|
-
|
|
793
|
+
listBuilderAdd_118(this.#out_91, ",");
|
|
814
794
|
} catch {
|
|
815
|
-
break
|
|
795
|
+
break s__1266_185;
|
|
816
796
|
}
|
|
817
|
-
if (
|
|
818
|
-
|
|
797
|
+
if (max_187 !== null) {
|
|
798
|
+
t_184 = this.#out_91;
|
|
819
799
|
try {
|
|
820
|
-
|
|
821
|
-
|
|
800
|
+
t_183 = requireIsSafeInteger__189(max_187);
|
|
801
|
+
listBuilderAdd_118(t_184, intToString_188(t_183));
|
|
822
802
|
} catch {
|
|
823
|
-
break
|
|
803
|
+
break s__1266_185;
|
|
824
804
|
}
|
|
825
805
|
} else {
|
|
826
806
|
void 0;
|
|
@@ -829,244 +809,244 @@ class RegexFormatter_186 {
|
|
|
829
809
|
void 0;
|
|
830
810
|
}
|
|
831
811
|
try {
|
|
832
|
-
|
|
812
|
+
listBuilderAdd_118(this.#out_91, "}");
|
|
833
813
|
} catch {
|
|
834
|
-
break
|
|
814
|
+
break s__1266_185;
|
|
835
815
|
}
|
|
836
816
|
}
|
|
837
817
|
}
|
|
838
818
|
}
|
|
839
|
-
if (
|
|
819
|
+
if (repeat_177.reluctant) {
|
|
840
820
|
try {
|
|
841
|
-
|
|
821
|
+
listBuilderAdd_118(this.#out_91, "?");
|
|
842
822
|
} catch {
|
|
843
|
-
break
|
|
823
|
+
break s__1266_185;
|
|
844
824
|
}
|
|
845
825
|
} else {
|
|
846
826
|
void 0;
|
|
847
827
|
}
|
|
848
|
-
|
|
849
|
-
return
|
|
828
|
+
return_178 = void 0;
|
|
829
|
+
return return_178;
|
|
850
830
|
}
|
|
851
|
-
throw
|
|
831
|
+
throw Error();
|
|
852
832
|
}
|
|
853
|
-
/** @param {Sequence}
|
|
854
|
-
pushSequence(
|
|
855
|
-
let
|
|
856
|
-
let
|
|
857
|
-
let
|
|
858
|
-
let
|
|
859
|
-
|
|
833
|
+
/** @param {Sequence} sequence_191 */
|
|
834
|
+
pushSequence(sequence_191) {
|
|
835
|
+
let return_192;
|
|
836
|
+
let t_193;
|
|
837
|
+
let t_194;
|
|
838
|
+
let i_195 = 0;
|
|
839
|
+
s__1269_196: {
|
|
860
840
|
while (true) {
|
|
861
|
-
|
|
862
|
-
if (
|
|
841
|
+
t_193 = sequence_191.items.length;
|
|
842
|
+
if (i_195 < t_193) {
|
|
863
843
|
try {
|
|
864
|
-
|
|
844
|
+
t_194 = listGet_157(sequence_191.items, i_195);
|
|
865
845
|
} catch {
|
|
866
846
|
break;
|
|
867
847
|
}
|
|
868
|
-
this.pushRegex(
|
|
869
|
-
|
|
848
|
+
this.pushRegex(t_194);
|
|
849
|
+
i_195 = i_195 + 1;
|
|
870
850
|
} else {
|
|
871
|
-
|
|
872
|
-
break
|
|
851
|
+
return_192 = void 0;
|
|
852
|
+
break s__1269_196;
|
|
873
853
|
}
|
|
874
854
|
}
|
|
875
|
-
throw
|
|
855
|
+
throw Error();
|
|
876
856
|
}
|
|
877
|
-
return
|
|
857
|
+
return return_192;
|
|
878
858
|
}
|
|
879
859
|
/**
|
|
880
|
-
* @param {CodePart}
|
|
860
|
+
* @param {CodePart} codePart_198
|
|
881
861
|
* @returns {number | null}
|
|
882
862
|
*/
|
|
883
|
-
maxCode(
|
|
884
|
-
let
|
|
885
|
-
let
|
|
886
|
-
let
|
|
887
|
-
let
|
|
888
|
-
let
|
|
889
|
-
let
|
|
890
|
-
let
|
|
891
|
-
let
|
|
892
|
-
let
|
|
893
|
-
let
|
|
894
|
-
let
|
|
863
|
+
maxCode(codePart_198) {
|
|
864
|
+
let return_199;
|
|
865
|
+
let t_200;
|
|
866
|
+
let t_201;
|
|
867
|
+
let t_202;
|
|
868
|
+
let t_203;
|
|
869
|
+
let t_204;
|
|
870
|
+
let t_205;
|
|
871
|
+
let t_206;
|
|
872
|
+
let t_207;
|
|
873
|
+
let t_208;
|
|
874
|
+
let t_209;
|
|
895
875
|
try {
|
|
896
|
-
|
|
897
|
-
|
|
876
|
+
requireInstanceOf__115(codePart_198, CodePoints);
|
|
877
|
+
t_206 = true;
|
|
898
878
|
} catch {
|
|
899
|
-
|
|
879
|
+
t_206 = false;
|
|
900
880
|
}
|
|
901
|
-
|
|
902
|
-
if (
|
|
881
|
+
s__1271_210: {
|
|
882
|
+
if (t_206) {
|
|
903
883
|
try {
|
|
904
|
-
|
|
884
|
+
t_207 = requireInstanceOf__115(codePart_198, CodePoints);
|
|
905
885
|
} catch {
|
|
906
|
-
break
|
|
886
|
+
break s__1271_210;
|
|
907
887
|
}
|
|
908
|
-
const
|
|
909
|
-
if (!
|
|
910
|
-
|
|
888
|
+
const value_211 = t_207.value;
|
|
889
|
+
if (! value_211) {
|
|
890
|
+
return_199 = null;
|
|
911
891
|
} else {
|
|
912
|
-
let
|
|
913
|
-
|
|
914
|
-
let
|
|
892
|
+
let max_212 = 0;
|
|
893
|
+
t_200 = stringCodePoints_138(value_211);
|
|
894
|
+
let slice_213 = t_200;
|
|
915
895
|
while (true) {
|
|
916
|
-
if (!
|
|
917
|
-
const
|
|
918
|
-
if (
|
|
919
|
-
|
|
896
|
+
if (! slice_213.isEmpty) {
|
|
897
|
+
const next_214 = slice_213.read();
|
|
898
|
+
if (next_214 > max_212) {
|
|
899
|
+
max_212 = next_214;
|
|
920
900
|
} else {
|
|
921
901
|
void 0;
|
|
922
902
|
}
|
|
923
|
-
|
|
924
|
-
|
|
903
|
+
t_201 = slice_213.advance(1);
|
|
904
|
+
slice_213 = t_201;
|
|
925
905
|
} else {
|
|
926
906
|
break;
|
|
927
907
|
}
|
|
928
908
|
}
|
|
929
|
-
|
|
909
|
+
return_199 = max_212;
|
|
930
910
|
}
|
|
931
911
|
} else {
|
|
932
912
|
try {
|
|
933
|
-
|
|
934
|
-
|
|
913
|
+
requireInstanceOf__115(codePart_198, CodeRange);
|
|
914
|
+
t_208 = true;
|
|
935
915
|
} catch {
|
|
936
|
-
|
|
916
|
+
t_208 = false;
|
|
937
917
|
}
|
|
938
|
-
if (
|
|
918
|
+
if (t_208) {
|
|
939
919
|
try {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
920
|
+
t_209 = requireInstanceOf__115(codePart_198, CodeRange);
|
|
921
|
+
t_202 = t_209.max;
|
|
922
|
+
return_199 = t_202;
|
|
943
923
|
} catch {
|
|
944
|
-
break
|
|
924
|
+
break s__1271_210;
|
|
945
925
|
}
|
|
946
|
-
} else if (
|
|
947
|
-
|
|
926
|
+
} else if (eqGeneric_117(codePart_198, Digit)) {
|
|
927
|
+
t_203 = stringCodePoints_138("9").read();
|
|
948
928
|
try {
|
|
949
|
-
|
|
929
|
+
return_199 = t_203;
|
|
950
930
|
} catch {
|
|
951
|
-
break
|
|
931
|
+
break s__1271_210;
|
|
952
932
|
}
|
|
953
|
-
} else if (
|
|
954
|
-
|
|
933
|
+
} else if (eqGeneric_117(codePart_198, Space)) {
|
|
934
|
+
t_204 = stringCodePoints_138(" ").read();
|
|
955
935
|
try {
|
|
956
|
-
|
|
936
|
+
return_199 = t_204;
|
|
957
937
|
} catch {
|
|
958
|
-
break
|
|
938
|
+
break s__1271_210;
|
|
959
939
|
}
|
|
960
|
-
} else if (
|
|
961
|
-
|
|
940
|
+
} else if (eqGeneric_117(codePart_198, Word)) {
|
|
941
|
+
t_205 = stringCodePoints_138("z").read();
|
|
962
942
|
try {
|
|
963
|
-
|
|
943
|
+
return_199 = t_205;
|
|
964
944
|
} catch {
|
|
965
|
-
break
|
|
945
|
+
break s__1271_210;
|
|
966
946
|
}
|
|
967
947
|
} else {
|
|
968
|
-
|
|
948
|
+
return_199 = null;
|
|
969
949
|
}
|
|
970
950
|
}
|
|
971
|
-
return
|
|
951
|
+
return return_199;
|
|
972
952
|
}
|
|
973
|
-
throw
|
|
953
|
+
throw Error();
|
|
974
954
|
}
|
|
975
|
-
/** @param {Array<string>}
|
|
976
|
-
constructor(
|
|
977
|
-
let
|
|
978
|
-
if (!(
|
|
979
|
-
|
|
980
|
-
|
|
955
|
+
/** @param {Array<string>} out_215 */
|
|
956
|
+
constructor(out_215) {
|
|
957
|
+
let t_216;
|
|
958
|
+
if (!(out_215 !== void 0)) {
|
|
959
|
+
t_216 = [];
|
|
960
|
+
out_215 = t_216;
|
|
981
961
|
}
|
|
982
|
-
this.#
|
|
962
|
+
this.#out_91 = out_215;
|
|
983
963
|
return;
|
|
984
964
|
}
|
|
985
965
|
}
|
|
986
|
-
|
|
966
|
+
/** @type {RegexRefs_57} */
|
|
967
|
+
const regexRefs_83 = new RegexRefs_57();
|
|
968
|
+
class Begin_217 {
|
|
987
969
|
constructor() {
|
|
988
970
|
return;
|
|
989
971
|
}
|
|
990
972
|
}
|
|
991
|
-
Special.implementedBy(
|
|
992
|
-
/** @type {
|
|
993
|
-
export const Begin = new
|
|
994
|
-
class
|
|
973
|
+
Special.implementedBy(Begin_217);
|
|
974
|
+
/** @type {Special} */
|
|
975
|
+
export const Begin = new Begin_217();
|
|
976
|
+
class Dot_218 {
|
|
995
977
|
constructor() {
|
|
996
978
|
return;
|
|
997
979
|
}
|
|
998
980
|
}
|
|
999
|
-
Special.implementedBy(
|
|
1000
|
-
/** @type {
|
|
1001
|
-
export const Dot = new
|
|
1002
|
-
class
|
|
981
|
+
Special.implementedBy(Dot_218);
|
|
982
|
+
/** @type {Special} */
|
|
983
|
+
export const Dot = new Dot_218();
|
|
984
|
+
class End_219 {
|
|
1003
985
|
constructor() {
|
|
1004
986
|
return;
|
|
1005
987
|
}
|
|
1006
988
|
}
|
|
1007
|
-
Special.implementedBy(
|
|
1008
|
-
/** @type {
|
|
1009
|
-
export const End = new
|
|
1010
|
-
class
|
|
989
|
+
Special.implementedBy(End_219);
|
|
990
|
+
/** @type {Special} */
|
|
991
|
+
export const End = new End_219();
|
|
992
|
+
class WordBoundary_220 {
|
|
1011
993
|
constructor() {
|
|
1012
994
|
return;
|
|
1013
995
|
}
|
|
1014
996
|
}
|
|
1015
|
-
Special.implementedBy(
|
|
1016
|
-
/** @type {
|
|
1017
|
-
export const WordBoundary = new
|
|
1018
|
-
class
|
|
997
|
+
Special.implementedBy(WordBoundary_220);
|
|
998
|
+
/** @type {Special} */
|
|
999
|
+
export const WordBoundary = new WordBoundary_220();
|
|
1000
|
+
class Digit_221 {
|
|
1019
1001
|
constructor() {
|
|
1020
1002
|
return;
|
|
1021
1003
|
}
|
|
1022
1004
|
}
|
|
1023
|
-
SpecialSet.implementedBy(
|
|
1024
|
-
/** @type {
|
|
1025
|
-
export const Digit = new
|
|
1026
|
-
class
|
|
1005
|
+
SpecialSet.implementedBy(Digit_221);
|
|
1006
|
+
/** @type {SpecialSet} */
|
|
1007
|
+
export const Digit = new Digit_221();
|
|
1008
|
+
class Space_222 {
|
|
1027
1009
|
constructor() {
|
|
1028
1010
|
return;
|
|
1029
1011
|
}
|
|
1030
1012
|
}
|
|
1031
|
-
SpecialSet.implementedBy(
|
|
1032
|
-
/** @type {
|
|
1033
|
-
export const Space = new
|
|
1034
|
-
class
|
|
1013
|
+
SpecialSet.implementedBy(Space_222);
|
|
1014
|
+
/** @type {SpecialSet} */
|
|
1015
|
+
export const Space = new Space_222();
|
|
1016
|
+
class Word_223 {
|
|
1035
1017
|
constructor() {
|
|
1036
1018
|
return;
|
|
1037
1019
|
}
|
|
1038
1020
|
}
|
|
1039
|
-
SpecialSet.implementedBy(
|
|
1040
|
-
/** @type {
|
|
1041
|
-
export const Word = new
|
|
1021
|
+
SpecialSet.implementedBy(Word_223);
|
|
1022
|
+
/** @type {SpecialSet} */
|
|
1023
|
+
export const Word = new Word_223();
|
|
1042
1024
|
/**
|
|
1043
|
-
* @param {Regex}
|
|
1025
|
+
* @param {Regex} item_224
|
|
1044
1026
|
* @returns {Regex}
|
|
1045
1027
|
*/
|
|
1046
|
-
export function entire(
|
|
1047
|
-
return new Sequence(
|
|
1028
|
+
export function entire(item_224) {
|
|
1029
|
+
return new Sequence(listify_67(Begin, item_224, End));
|
|
1048
1030
|
};
|
|
1049
1031
|
/**
|
|
1050
|
-
* @param {Regex}
|
|
1051
|
-
* @param {boolean}
|
|
1032
|
+
* @param {Regex} item_225
|
|
1033
|
+
* @param {boolean} reluctant_226
|
|
1052
1034
|
* @returns {Repeat}
|
|
1053
1035
|
*/
|
|
1054
|
-
export function oneOrMore(
|
|
1055
|
-
if (!(
|
|
1056
|
-
|
|
1036
|
+
export function oneOrMore(item_225, reluctant_226) {
|
|
1037
|
+
if (!(reluctant_226 !== void 0)) {
|
|
1038
|
+
reluctant_226 = false;
|
|
1057
1039
|
}
|
|
1058
|
-
return new Repeat(
|
|
1040
|
+
return new Repeat(item_225, 1, null, reluctant_226);
|
|
1059
1041
|
};
|
|
1060
1042
|
/**
|
|
1061
|
-
* @param {Regex}
|
|
1062
|
-
* @param {boolean}
|
|
1043
|
+
* @param {Regex} item_227
|
|
1044
|
+
* @param {boolean} reluctant_228
|
|
1063
1045
|
* @returns {Repeat}
|
|
1064
1046
|
*/
|
|
1065
|
-
export function optional(
|
|
1066
|
-
if (!(
|
|
1067
|
-
|
|
1047
|
+
export function optional(item_227, reluctant_228) {
|
|
1048
|
+
if (!(reluctant_228 !== void 0)) {
|
|
1049
|
+
reluctant_228 = false;
|
|
1068
1050
|
}
|
|
1069
|
-
return new Repeat(
|
|
1051
|
+
return new Repeat(item_227, 0, 1, reluctant_228);
|
|
1070
1052
|
};
|
|
1071
|
-
/** @type {RegexRefs_159} */
|
|
1072
|
-
const regexRefs_181 = new RegexRefs_159();
|