@temperlang/std 0.0.6 → 0.1.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/all-exports.js +3 -0
- package/package.json +7 -2
- package/regex.js +557 -557
- package/regex.js.map +1 -1
- package/temporal.js +35 -35
- package/temporal.js.map +1 -1
- package/testing.js +125 -131
- 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_65, requireInstanceOf as requireInstanceOf__178, requireIsSafeInteger as requireIsSafeInteger__253, compiledRegexCompileFormatted as compiledRegexCompileFormatted_139, compiledRegexCompiledFound as compiledRegexCompiledFound_143, compiledRegexCompiledFind as compiledRegexCompiledFind_146, compiledRegexCompiledReplace as compiledRegexCompiledReplace_151, eqGeneric as eqGeneric_180, regexFormatterPushCodeTo as regexFormatterPushCodeTo_194, stringCodePoints as stringCodePoints_201, regexFormatterAdjustCodeSet as regexFormatterAdjustCodeSet_218, intToString as intToString_252, listify as listify_42, listJoin as listJoin_24, listBuilderAdd as listBuilderAdd_4, strCat as strCat_57, listGet as listGet_53
|
|
3
3
|
} from "@temperlang/core";
|
|
4
|
-
function
|
|
4
|
+
function methodCompiled66() {
|
|
5
5
|
return new CompiledRegex(this);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return this.compiled().found(
|
|
7
|
+
function methodFound67(text_68) {
|
|
8
|
+
return this.compiled().found(text_68);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return this.compiled().find(
|
|
10
|
+
function methodFind69(text_70) {
|
|
11
|
+
return this.compiled().find(text_70);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return this.compiled().replace(
|
|
13
|
+
function methodReplace71(text_72, format_73) {
|
|
14
|
+
return this.compiled().replace(text_72, format_73);
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* @typedef {{
|
|
18
|
-
* compiled: () => CompiledRegex, found: (
|
|
18
|
+
* compiled: () => CompiledRegex, found: (text_68: string) => boolean, find: (text_70: string) => Map<string, Group>, replace: (text_72: string, format_73: (arg0: Map<string, Group>) => string) => string
|
|
19
19
|
* }}
|
|
20
20
|
* Regex
|
|
21
21
|
*/
|
|
22
|
-
export const Regex = new
|
|
22
|
+
export const Regex = new InterfaceType_65("Regex", [["m", "compiled", methodCompiled66], ["m", "found", methodFound67], ["m", "find", methodFind69], ["m", "replace", methodReplace71]], [], 1);
|
|
23
23
|
export class Capture {
|
|
24
24
|
/** @type {string} */
|
|
25
|
-
#
|
|
25
|
+
#name_74;
|
|
26
26
|
/** @type {Regex} */
|
|
27
|
-
#
|
|
27
|
+
#item_75;
|
|
28
28
|
/**
|
|
29
|
-
* @param {string}
|
|
30
|
-
* @param {Regex}
|
|
29
|
+
* @param {string} name_76
|
|
30
|
+
* @param {Regex} item_77
|
|
31
31
|
*/
|
|
32
|
-
constructor(
|
|
33
|
-
this.#
|
|
34
|
-
this.#
|
|
32
|
+
constructor(name_76, item_77) {
|
|
33
|
+
this.#name_74 = name_76;
|
|
34
|
+
this.#item_75 = item_77;
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
/** @returns {string} */
|
|
38
38
|
get name() {
|
|
39
|
-
return this.#
|
|
39
|
+
return this.#name_74;
|
|
40
40
|
}
|
|
41
41
|
/** @returns {Regex} */
|
|
42
42
|
get item() {
|
|
43
|
-
return this.#
|
|
43
|
+
return this.#item_75;
|
|
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_65("CodePart", [], [Regex], 2);
|
|
52
52
|
export class CodePoints {
|
|
53
53
|
/** @type {string} */
|
|
54
|
-
#
|
|
55
|
-
/** @param {string}
|
|
56
|
-
constructor(
|
|
57
|
-
this.#
|
|
54
|
+
#value_80;
|
|
55
|
+
/** @param {string} value_81 */
|
|
56
|
+
constructor(value_81) {
|
|
57
|
+
this.#value_80 = value_81;
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
/** @returns {string} */
|
|
61
61
|
get value() {
|
|
62
|
-
return this.#
|
|
62
|
+
return this.#value_80;
|
|
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_65("Special", [], [Regex], 2);
|
|
71
71
|
/**
|
|
72
72
|
* @typedef {{}}
|
|
73
73
|
* SpecialSet
|
|
74
74
|
*/
|
|
75
|
-
export const SpecialSet = new
|
|
75
|
+
export const SpecialSet = new InterfaceType_65("SpecialSet", [], [CodePart, Special], 3);
|
|
76
76
|
export class CodeRange {
|
|
77
77
|
/** @type {number} */
|
|
78
|
-
#
|
|
78
|
+
#min_83;
|
|
79
79
|
/** @type {number} */
|
|
80
|
-
#
|
|
80
|
+
#max_84;
|
|
81
81
|
/**
|
|
82
|
-
* @param {number}
|
|
83
|
-
* @param {number}
|
|
82
|
+
* @param {number} min_85
|
|
83
|
+
* @param {number} max_86
|
|
84
84
|
*/
|
|
85
|
-
constructor(
|
|
86
|
-
this.#
|
|
87
|
-
this.#
|
|
85
|
+
constructor(min_85, max_86) {
|
|
86
|
+
this.#min_83 = min_85;
|
|
87
|
+
this.#max_84 = max_86;
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
/** @returns {number} */
|
|
91
91
|
get min() {
|
|
92
|
-
return this.#
|
|
92
|
+
return this.#min_83;
|
|
93
93
|
}
|
|
94
94
|
/** @returns {number} */
|
|
95
95
|
get max() {
|
|
96
|
-
return this.#
|
|
96
|
+
return this.#max_84;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
CodePart.implementedBy(CodeRange);
|
|
100
100
|
export class CodeSet {
|
|
101
101
|
/** @type {Array<CodePart>} */
|
|
102
|
-
#
|
|
102
|
+
#items_89;
|
|
103
103
|
/** @type {boolean} */
|
|
104
|
-
#
|
|
104
|
+
#negated_90;
|
|
105
105
|
/**
|
|
106
|
-
* @param {Array<CodePart>}
|
|
107
|
-
* @param {boolean}
|
|
106
|
+
* @param {Array<CodePart>} items_91
|
|
107
|
+
* @param {boolean} negated_92
|
|
108
108
|
*/
|
|
109
|
-
constructor(
|
|
110
|
-
if (!(
|
|
111
|
-
|
|
109
|
+
constructor(items_91, negated_92) {
|
|
110
|
+
if (!(negated_92 !== void 0)) {
|
|
111
|
+
negated_92 = false;
|
|
112
112
|
}
|
|
113
|
-
this.#
|
|
114
|
-
this.#
|
|
113
|
+
this.#items_89 = items_91;
|
|
114
|
+
this.#negated_90 = negated_92;
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
/** @returns {Array<CodePart>} */
|
|
118
118
|
get items() {
|
|
119
|
-
return this.#
|
|
119
|
+
return this.#items_89;
|
|
120
120
|
}
|
|
121
121
|
/** @returns {boolean} */
|
|
122
122
|
get negated() {
|
|
123
|
-
return this.#
|
|
123
|
+
return this.#negated_90;
|
|
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_95;
|
|
130
|
+
/** @param {Array<Regex>} items_96 */
|
|
131
|
+
constructor(items_96) {
|
|
132
|
+
this.#items_95 = items_96;
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
/** @returns {Array<Regex>} */
|
|
136
136
|
get items() {
|
|
137
|
-
return this.#
|
|
137
|
+
return this.#items_95;
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
140
|
Regex.implementedBy(Or);
|
|
141
141
|
export class Repeat {
|
|
142
142
|
/** @type {Regex} */
|
|
143
|
-
#
|
|
143
|
+
#item_98;
|
|
144
144
|
/** @type {number} */
|
|
145
|
-
#
|
|
145
|
+
#min_99;
|
|
146
146
|
/** @type {number | null} */
|
|
147
|
-
#
|
|
147
|
+
#max_100;
|
|
148
148
|
/** @type {boolean} */
|
|
149
|
-
#
|
|
149
|
+
#reluctant_101;
|
|
150
150
|
/**
|
|
151
|
-
* @param {Regex}
|
|
152
|
-
* @param {number}
|
|
153
|
-
* @param {number | null}
|
|
154
|
-
* @param {boolean}
|
|
151
|
+
* @param {Regex} item_102
|
|
152
|
+
* @param {number} min_103
|
|
153
|
+
* @param {number | null} max_104
|
|
154
|
+
* @param {boolean} reluctant_105
|
|
155
155
|
*/
|
|
156
|
-
constructor(
|
|
157
|
-
if (!(
|
|
158
|
-
|
|
156
|
+
constructor(item_102, min_103, max_104, reluctant_105) {
|
|
157
|
+
if (!(reluctant_105 !== void 0)) {
|
|
158
|
+
reluctant_105 = false;
|
|
159
159
|
}
|
|
160
|
-
this.#
|
|
161
|
-
this.#
|
|
162
|
-
this.#
|
|
163
|
-
this.#
|
|
160
|
+
this.#item_98 = item_102;
|
|
161
|
+
this.#min_99 = min_103;
|
|
162
|
+
this.#max_100 = max_104;
|
|
163
|
+
this.#reluctant_101 = reluctant_105;
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
/** @returns {Regex} */
|
|
167
167
|
get item() {
|
|
168
|
-
return this.#
|
|
168
|
+
return this.#item_98;
|
|
169
169
|
}
|
|
170
170
|
/** @returns {number} */
|
|
171
171
|
get min() {
|
|
172
|
-
return this.#
|
|
172
|
+
return this.#min_99;
|
|
173
173
|
}
|
|
174
174
|
/** @returns {number | null} */
|
|
175
175
|
get max() {
|
|
176
|
-
return this.#
|
|
176
|
+
return this.#max_100;
|
|
177
177
|
}
|
|
178
178
|
/** @returns {boolean} */
|
|
179
179
|
get reluctant() {
|
|
180
|
-
return this.#
|
|
180
|
+
return this.#reluctant_101;
|
|
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_110;
|
|
187
|
+
/** @param {Array<Regex>} items_111 */
|
|
188
|
+
constructor(items_111) {
|
|
189
|
+
this.#items_110 = items_111;
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
/** @returns {Array<Regex>} */
|
|
193
193
|
get items() {
|
|
194
|
-
return this.#
|
|
194
|
+
return this.#items_110;
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
Regex.implementedBy(Sequence);
|
|
198
198
|
export class Group {
|
|
199
199
|
/** @type {string} */
|
|
200
|
-
#
|
|
200
|
+
#name_113;
|
|
201
201
|
/** @type {string} */
|
|
202
|
-
#
|
|
202
|
+
#value_114;
|
|
203
203
|
/** @type {number} */
|
|
204
|
-
#
|
|
204
|
+
#codePointsBegin_115;
|
|
205
205
|
/**
|
|
206
|
-
* @param {string}
|
|
207
|
-
* @param {string}
|
|
208
|
-
* @param {number}
|
|
206
|
+
* @param {string} name_116
|
|
207
|
+
* @param {string} value_117
|
|
208
|
+
* @param {number} codePointsBegin_118
|
|
209
209
|
*/
|
|
210
|
-
constructor(
|
|
211
|
-
this.#
|
|
212
|
-
this.#
|
|
213
|
-
this.#
|
|
210
|
+
constructor(name_116, value_117, codePointsBegin_118) {
|
|
211
|
+
this.#name_113 = name_116;
|
|
212
|
+
this.#value_114 = value_117;
|
|
213
|
+
this.#codePointsBegin_115 = codePointsBegin_118;
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
216
|
/** @returns {string} */
|
|
217
217
|
get name() {
|
|
218
|
-
return this.#
|
|
218
|
+
return this.#name_113;
|
|
219
219
|
}
|
|
220
220
|
/** @returns {string} */
|
|
221
221
|
get value() {
|
|
222
|
-
return this.#
|
|
222
|
+
return this.#value_114;
|
|
223
223
|
}
|
|
224
224
|
/** @returns {number} */
|
|
225
225
|
get codePointsBegin() {
|
|
226
|
-
return this.#
|
|
226
|
+
return this.#codePointsBegin_115;
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
class
|
|
229
|
+
class RegexRefs_122 {
|
|
230
230
|
/** @type {CodePoints} */
|
|
231
|
-
#
|
|
231
|
+
#codePoints_123;
|
|
232
232
|
/** @type {Group} */
|
|
233
|
-
#
|
|
233
|
+
#group_124;
|
|
234
234
|
/** @type {Or} */
|
|
235
|
-
#
|
|
235
|
+
#orObject_125;
|
|
236
236
|
/**
|
|
237
|
-
* @param {CodePoints}
|
|
238
|
-
* @param {Group}
|
|
239
|
-
* @param {Or}
|
|
237
|
+
* @param {CodePoints} codePoints_126
|
|
238
|
+
* @param {Group} group_127
|
|
239
|
+
* @param {Or} orObject_128
|
|
240
240
|
*/
|
|
241
|
-
constructor(
|
|
242
|
-
let
|
|
243
|
-
let
|
|
244
|
-
let
|
|
245
|
-
if (!(
|
|
246
|
-
|
|
247
|
-
|
|
241
|
+
constructor(codePoints_126, group_127, orObject_128) {
|
|
242
|
+
let t_129;
|
|
243
|
+
let t_130;
|
|
244
|
+
let t_131;
|
|
245
|
+
if (!(codePoints_126 !== void 0)) {
|
|
246
|
+
t_129 = new CodePoints("");
|
|
247
|
+
codePoints_126 = t_129;
|
|
248
248
|
}
|
|
249
|
-
if (!(
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
if (!(group_127 !== void 0)) {
|
|
250
|
+
t_130 = new Group("", "", 0);
|
|
251
|
+
group_127 = t_130;
|
|
252
252
|
}
|
|
253
|
-
if (!(
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
if (!(orObject_128 !== void 0)) {
|
|
254
|
+
t_131 = new Or(listify_42());
|
|
255
|
+
orObject_128 = t_131;
|
|
256
256
|
}
|
|
257
|
-
this.#
|
|
258
|
-
this.#
|
|
259
|
-
this.#
|
|
257
|
+
this.#codePoints_123 = codePoints_126;
|
|
258
|
+
this.#group_124 = group_127;
|
|
259
|
+
this.#orObject_125 = orObject_128;
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
262
|
/** @returns {CodePoints} */
|
|
263
263
|
get codePoints() {
|
|
264
|
-
return this.#
|
|
264
|
+
return this.#codePoints_123;
|
|
265
265
|
}
|
|
266
266
|
/** @returns {Group} */
|
|
267
267
|
get group() {
|
|
268
|
-
return this.#
|
|
268
|
+
return this.#group_124;
|
|
269
269
|
}
|
|
270
270
|
/** @returns {Or} */
|
|
271
271
|
get orObject() {
|
|
272
|
-
return this.#
|
|
272
|
+
return this.#orObject_125;
|
|
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_135;
|
|
278
|
+
/** @param {Regex} data_136 */
|
|
279
|
+
constructor(data_136) {
|
|
280
|
+
this.#data_135 = data_136;
|
|
281
|
+
let t_137 = this.format();
|
|
282
|
+
let t_138 = compiledRegexCompileFormatted_139(this, t_137);
|
|
283
|
+
this.#compiled_140 = t_138;
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
/**
|
|
287
|
-
* @param {string}
|
|
287
|
+
* @param {string} text_142
|
|
288
288
|
* @returns {boolean}
|
|
289
289
|
*/
|
|
290
|
-
found(
|
|
291
|
-
return
|
|
290
|
+
found(text_142) {
|
|
291
|
+
return compiledRegexCompiledFound_143(this, this.#compiled_140, text_142);
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
|
-
* @param {string}
|
|
294
|
+
* @param {string} text_145
|
|
295
295
|
* @returns {Map<string, Group>}
|
|
296
296
|
*/
|
|
297
|
-
find(
|
|
298
|
-
return
|
|
297
|
+
find(text_145) {
|
|
298
|
+
return compiledRegexCompiledFind_146(this, this.#compiled_140, text_145, regexRefs_147);
|
|
299
299
|
}
|
|
300
300
|
/**
|
|
301
|
-
* @param {string}
|
|
302
|
-
* @param {(arg0: Map<string, Group>) => string}
|
|
301
|
+
* @param {string} text_149
|
|
302
|
+
* @param {(arg0: Map<string, Group>) => string} format_150
|
|
303
303
|
* @returns {string}
|
|
304
304
|
*/
|
|
305
|
-
replace(
|
|
306
|
-
return
|
|
305
|
+
replace(text_149, format_150) {
|
|
306
|
+
return compiledRegexCompiledReplace_151(this, this.#compiled_140, text_149, format_150, regexRefs_147);
|
|
307
307
|
}
|
|
308
308
|
/** @type {unknown} */
|
|
309
|
-
#
|
|
309
|
+
#compiled_140;
|
|
310
310
|
/** @returns {string} */
|
|
311
311
|
format() {
|
|
312
|
-
return new
|
|
312
|
+
return new RegexFormatter_153().format(this.#data_135);
|
|
313
313
|
}
|
|
314
314
|
/** @returns {Regex} */
|
|
315
315
|
get data() {
|
|
316
|
-
return this.#
|
|
316
|
+
return this.#data_135;
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
|
-
class
|
|
319
|
+
class RegexFormatter_153 {
|
|
320
320
|
/** @type {Array<string>} */
|
|
321
|
-
#
|
|
321
|
+
#out_155;
|
|
322
322
|
/**
|
|
323
|
-
* @param {Regex}
|
|
323
|
+
* @param {Regex} regex_157
|
|
324
324
|
* @returns {string}
|
|
325
325
|
*/
|
|
326
|
-
format(
|
|
327
|
-
this.pushRegex(
|
|
328
|
-
let
|
|
329
|
-
function
|
|
330
|
-
return
|
|
326
|
+
format(regex_157) {
|
|
327
|
+
this.pushRegex(regex_157);
|
|
328
|
+
let t_158 = this.#out_155;
|
|
329
|
+
function fn_159(x_160) {
|
|
330
|
+
return x_160;
|
|
331
331
|
}
|
|
332
|
-
return
|
|
332
|
+
return listJoin_24(t_158, "", fn_159);
|
|
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_162 */
|
|
335
|
+
pushRegex(regex_162) {
|
|
336
|
+
let return_163;
|
|
337
|
+
let t_164;
|
|
338
|
+
let t_165;
|
|
339
|
+
let t_166;
|
|
340
|
+
let t_167;
|
|
341
|
+
let t_168;
|
|
342
|
+
let t_169;
|
|
343
|
+
let t_170;
|
|
344
|
+
let t_171;
|
|
345
|
+
let t_172;
|
|
346
|
+
let t_173;
|
|
347
|
+
let t_174;
|
|
348
|
+
let t_175;
|
|
349
|
+
let t_176;
|
|
350
|
+
let t_177;
|
|
351
351
|
try {
|
|
352
|
-
|
|
353
|
-
|
|
352
|
+
requireInstanceOf__178(regex_162, Capture);
|
|
353
|
+
t_164 = true;
|
|
354
354
|
} catch {
|
|
355
|
-
|
|
355
|
+
t_164 = false;
|
|
356
356
|
}
|
|
357
|
-
|
|
358
|
-
if (
|
|
357
|
+
s__1259_179: {
|
|
358
|
+
if (t_164) {
|
|
359
359
|
try {
|
|
360
|
-
|
|
360
|
+
t_165 = requireInstanceOf__178(regex_162, Capture);
|
|
361
361
|
} catch {
|
|
362
|
-
break
|
|
362
|
+
break s__1259_179;
|
|
363
363
|
}
|
|
364
|
-
this.pushCapture(
|
|
364
|
+
this.pushCapture(t_165);
|
|
365
365
|
} else {
|
|
366
366
|
try {
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
requireInstanceOf__178(regex_162, CodePoints);
|
|
368
|
+
t_166 = true;
|
|
369
369
|
} catch {
|
|
370
|
-
|
|
370
|
+
t_166 = false;
|
|
371
371
|
}
|
|
372
|
-
if (
|
|
372
|
+
if (t_166) {
|
|
373
373
|
try {
|
|
374
|
-
|
|
374
|
+
t_167 = requireInstanceOf__178(regex_162, CodePoints);
|
|
375
375
|
} catch {
|
|
376
|
-
break
|
|
376
|
+
break s__1259_179;
|
|
377
377
|
}
|
|
378
|
-
this.pushCodePoints(
|
|
378
|
+
this.pushCodePoints(t_167, false);
|
|
379
379
|
} else {
|
|
380
380
|
try {
|
|
381
|
-
|
|
382
|
-
|
|
381
|
+
requireInstanceOf__178(regex_162, CodeRange);
|
|
382
|
+
t_168 = true;
|
|
383
383
|
} catch {
|
|
384
|
-
|
|
384
|
+
t_168 = false;
|
|
385
385
|
}
|
|
386
|
-
if (
|
|
386
|
+
if (t_168) {
|
|
387
387
|
try {
|
|
388
|
-
|
|
388
|
+
t_169 = requireInstanceOf__178(regex_162, CodeRange);
|
|
389
389
|
} catch {
|
|
390
|
-
break
|
|
390
|
+
break s__1259_179;
|
|
391
391
|
}
|
|
392
|
-
this.pushCodeRange(
|
|
392
|
+
this.pushCodeRange(t_169);
|
|
393
393
|
} else {
|
|
394
394
|
try {
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
requireInstanceOf__178(regex_162, CodeSet);
|
|
396
|
+
t_170 = true;
|
|
397
397
|
} catch {
|
|
398
|
-
|
|
398
|
+
t_170 = false;
|
|
399
399
|
}
|
|
400
|
-
if (
|
|
400
|
+
if (t_170) {
|
|
401
401
|
try {
|
|
402
|
-
|
|
402
|
+
t_171 = requireInstanceOf__178(regex_162, CodeSet);
|
|
403
403
|
} catch {
|
|
404
|
-
break
|
|
404
|
+
break s__1259_179;
|
|
405
405
|
}
|
|
406
|
-
this.pushCodeSet(
|
|
406
|
+
this.pushCodeSet(t_171);
|
|
407
407
|
} else {
|
|
408
408
|
try {
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
requireInstanceOf__178(regex_162, Or);
|
|
410
|
+
t_172 = true;
|
|
411
411
|
} catch {
|
|
412
|
-
|
|
412
|
+
t_172 = false;
|
|
413
413
|
}
|
|
414
|
-
if (
|
|
414
|
+
if (t_172) {
|
|
415
415
|
try {
|
|
416
|
-
|
|
416
|
+
t_173 = requireInstanceOf__178(regex_162, Or);
|
|
417
417
|
} catch {
|
|
418
|
-
break
|
|
418
|
+
break s__1259_179;
|
|
419
419
|
}
|
|
420
|
-
this.pushOr(
|
|
420
|
+
this.pushOr(t_173);
|
|
421
421
|
} else {
|
|
422
422
|
try {
|
|
423
|
-
|
|
424
|
-
|
|
423
|
+
requireInstanceOf__178(regex_162, Repeat);
|
|
424
|
+
t_174 = true;
|
|
425
425
|
} catch {
|
|
426
|
-
|
|
426
|
+
t_174 = false;
|
|
427
427
|
}
|
|
428
|
-
if (
|
|
428
|
+
if (t_174) {
|
|
429
429
|
try {
|
|
430
|
-
|
|
430
|
+
t_175 = requireInstanceOf__178(regex_162, Repeat);
|
|
431
431
|
} catch {
|
|
432
|
-
break
|
|
432
|
+
break s__1259_179;
|
|
433
433
|
}
|
|
434
|
-
this.pushRepeat(
|
|
434
|
+
this.pushRepeat(t_175);
|
|
435
435
|
} else {
|
|
436
436
|
try {
|
|
437
|
-
|
|
438
|
-
|
|
437
|
+
requireInstanceOf__178(regex_162, Sequence);
|
|
438
|
+
t_176 = true;
|
|
439
439
|
} catch {
|
|
440
|
-
|
|
440
|
+
t_176 = false;
|
|
441
441
|
}
|
|
442
|
-
if (
|
|
442
|
+
if (t_176) {
|
|
443
443
|
try {
|
|
444
|
-
|
|
444
|
+
t_177 = requireInstanceOf__178(regex_162, Sequence);
|
|
445
445
|
} catch {
|
|
446
|
-
break
|
|
446
|
+
break s__1259_179;
|
|
447
447
|
}
|
|
448
|
-
this.pushSequence(
|
|
449
|
-
} else if (
|
|
448
|
+
this.pushSequence(t_177);
|
|
449
|
+
} else if (eqGeneric_180(regex_162, Begin)) {
|
|
450
450
|
try {
|
|
451
|
-
|
|
451
|
+
listBuilderAdd_4(this.#out_155, "^");
|
|
452
452
|
} catch {
|
|
453
|
-
break
|
|
453
|
+
break s__1259_179;
|
|
454
454
|
}
|
|
455
|
-
} else if (
|
|
455
|
+
} else if (eqGeneric_180(regex_162, Dot)) {
|
|
456
456
|
try {
|
|
457
|
-
|
|
457
|
+
listBuilderAdd_4(this.#out_155, ".");
|
|
458
458
|
} catch {
|
|
459
|
-
break
|
|
459
|
+
break s__1259_179;
|
|
460
460
|
}
|
|
461
|
-
} else if (
|
|
461
|
+
} else if (eqGeneric_180(regex_162, End)) {
|
|
462
462
|
try {
|
|
463
|
-
|
|
463
|
+
listBuilderAdd_4(this.#out_155, "\u0024");
|
|
464
464
|
} catch {
|
|
465
|
-
break
|
|
465
|
+
break s__1259_179;
|
|
466
466
|
}
|
|
467
|
-
} else if (
|
|
467
|
+
} else if (eqGeneric_180(regex_162, WordBoundary)) {
|
|
468
468
|
try {
|
|
469
|
-
|
|
469
|
+
listBuilderAdd_4(this.#out_155, "\\b");
|
|
470
470
|
} catch {
|
|
471
|
-
break
|
|
471
|
+
break s__1259_179;
|
|
472
472
|
}
|
|
473
|
-
} else if (
|
|
473
|
+
} else if (eqGeneric_180(regex_162, Digit)) {
|
|
474
474
|
try {
|
|
475
|
-
|
|
475
|
+
listBuilderAdd_4(this.#out_155, "\\d");
|
|
476
476
|
} catch {
|
|
477
|
-
break
|
|
477
|
+
break s__1259_179;
|
|
478
478
|
}
|
|
479
|
-
} else if (
|
|
479
|
+
} else if (eqGeneric_180(regex_162, Space)) {
|
|
480
480
|
try {
|
|
481
|
-
|
|
481
|
+
listBuilderAdd_4(this.#out_155, "\\s");
|
|
482
482
|
} catch {
|
|
483
|
-
break
|
|
483
|
+
break s__1259_179;
|
|
484
484
|
}
|
|
485
|
-
} else if (
|
|
485
|
+
} else if (eqGeneric_180(regex_162, Word)) {
|
|
486
486
|
try {
|
|
487
|
-
|
|
487
|
+
listBuilderAdd_4(this.#out_155, "\\w");
|
|
488
488
|
} catch {
|
|
489
|
-
break
|
|
489
|
+
break s__1259_179;
|
|
490
490
|
}
|
|
491
491
|
} else {
|
|
492
492
|
void 0;
|
|
@@ -497,330 +497,330 @@ class RegexFormatter_186 {
|
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
|
|
501
|
-
return
|
|
500
|
+
return_163 = void 0;
|
|
501
|
+
return return_163;
|
|
502
502
|
}
|
|
503
|
-
throw
|
|
503
|
+
throw Error();
|
|
504
504
|
}
|
|
505
|
-
/** @param {Capture}
|
|
506
|
-
pushCapture(
|
|
507
|
-
let
|
|
508
|
-
let
|
|
509
|
-
let
|
|
510
|
-
let
|
|
505
|
+
/** @param {Capture} capture_182 */
|
|
506
|
+
pushCapture(capture_182) {
|
|
507
|
+
let return_183;
|
|
508
|
+
let t_184;
|
|
509
|
+
let t_185;
|
|
510
|
+
let t_186;
|
|
511
511
|
{
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
this.pushCaptureName(
|
|
516
|
-
|
|
517
|
-
this.pushRegex(
|
|
518
|
-
|
|
519
|
-
|
|
512
|
+
listBuilderAdd_4(this.#out_155, "(");
|
|
513
|
+
t_186 = this.#out_155;
|
|
514
|
+
t_184 = capture_182.name;
|
|
515
|
+
this.pushCaptureName(t_186, t_184);
|
|
516
|
+
t_185 = capture_182.item;
|
|
517
|
+
this.pushRegex(t_185);
|
|
518
|
+
listBuilderAdd_4(this.#out_155, ")");
|
|
519
|
+
return_183 = void 0;
|
|
520
520
|
}
|
|
521
|
-
return
|
|
521
|
+
return return_183;
|
|
522
522
|
}
|
|
523
523
|
/**
|
|
524
|
-
* @param {Array<string>}
|
|
525
|
-
* @param {string}
|
|
524
|
+
* @param {Array<string>} out_188
|
|
525
|
+
* @param {string} name_189
|
|
526
526
|
*/
|
|
527
|
-
pushCaptureName(
|
|
528
|
-
let
|
|
527
|
+
pushCaptureName(out_188, name_189) {
|
|
528
|
+
let return_190;
|
|
529
529
|
{
|
|
530
|
-
|
|
531
|
-
|
|
530
|
+
listBuilderAdd_4(out_188, strCat_57("?\u003c", name_189, "\u003e"));
|
|
531
|
+
return_190 = void 0;
|
|
532
532
|
}
|
|
533
|
-
return
|
|
533
|
+
return return_190;
|
|
534
534
|
}
|
|
535
535
|
/**
|
|
536
|
-
* @param {number}
|
|
537
|
-
* @param {boolean}
|
|
536
|
+
* @param {number} code_192
|
|
537
|
+
* @param {boolean} insideCodeSet_193
|
|
538
538
|
*/
|
|
539
|
-
pushCode(
|
|
540
|
-
|
|
539
|
+
pushCode(code_192, insideCodeSet_193) {
|
|
540
|
+
regexFormatterPushCodeTo_194(this, this.#out_155, code_192, insideCodeSet_193);
|
|
541
541
|
return;
|
|
542
542
|
}
|
|
543
543
|
/**
|
|
544
|
-
* @param {CodePoints}
|
|
545
|
-
* @param {boolean}
|
|
544
|
+
* @param {CodePoints} codePoints_196
|
|
545
|
+
* @param {boolean} insideCodeSet_197
|
|
546
546
|
*/
|
|
547
|
-
pushCodePoints(
|
|
548
|
-
let
|
|
549
|
-
let
|
|
550
|
-
let
|
|
551
|
-
let
|
|
547
|
+
pushCodePoints(codePoints_196, insideCodeSet_197) {
|
|
548
|
+
let t_198;
|
|
549
|
+
let t_199;
|
|
550
|
+
let t_200 = stringCodePoints_201(codePoints_196.value);
|
|
551
|
+
let slice_202 = t_200;
|
|
552
552
|
while (true) {
|
|
553
|
-
if (!
|
|
554
|
-
|
|
555
|
-
this.pushCode(
|
|
556
|
-
|
|
557
|
-
|
|
553
|
+
if (! slice_202.isEmpty) {
|
|
554
|
+
t_198 = slice_202.read();
|
|
555
|
+
this.pushCode(t_198, insideCodeSet_197);
|
|
556
|
+
t_199 = slice_202.advance(1);
|
|
557
|
+
slice_202 = t_199;
|
|
558
558
|
} else {
|
|
559
559
|
break;
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
return;
|
|
563
563
|
}
|
|
564
|
-
/** @param {CodeRange}
|
|
565
|
-
pushCodeRange(
|
|
566
|
-
let
|
|
564
|
+
/** @param {CodeRange} codeRange_204 */
|
|
565
|
+
pushCodeRange(codeRange_204) {
|
|
566
|
+
let return_205;
|
|
567
567
|
{
|
|
568
|
-
|
|
569
|
-
this.pushCodeRangeUnwrapped(
|
|
570
|
-
|
|
571
|
-
|
|
568
|
+
listBuilderAdd_4(this.#out_155, "[");
|
|
569
|
+
this.pushCodeRangeUnwrapped(codeRange_204);
|
|
570
|
+
listBuilderAdd_4(this.#out_155, "]");
|
|
571
|
+
return_205 = void 0;
|
|
572
572
|
}
|
|
573
|
-
return
|
|
573
|
+
return return_205;
|
|
574
574
|
}
|
|
575
|
-
/** @param {CodeRange}
|
|
576
|
-
pushCodeRangeUnwrapped(
|
|
577
|
-
let
|
|
578
|
-
let
|
|
579
|
-
let
|
|
580
|
-
this.pushCode(
|
|
575
|
+
/** @param {CodeRange} codeRange_207 */
|
|
576
|
+
pushCodeRangeUnwrapped(codeRange_207) {
|
|
577
|
+
let return_208;
|
|
578
|
+
let t_209;
|
|
579
|
+
let t_210 = codeRange_207.min;
|
|
580
|
+
this.pushCode(t_210, true);
|
|
581
581
|
{
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
this.pushCode(
|
|
585
|
-
|
|
582
|
+
listBuilderAdd_4(this.#out_155, "-");
|
|
583
|
+
t_209 = codeRange_207.max;
|
|
584
|
+
this.pushCode(t_209, true);
|
|
585
|
+
return_208 = void 0;
|
|
586
586
|
}
|
|
587
|
-
return
|
|
587
|
+
return return_208;
|
|
588
588
|
}
|
|
589
|
-
/** @param {CodeSet}
|
|
590
|
-
pushCodeSet(
|
|
591
|
-
let
|
|
592
|
-
let
|
|
593
|
-
let
|
|
594
|
-
let
|
|
595
|
-
const
|
|
589
|
+
/** @param {CodeSet} codeSet_212 */
|
|
590
|
+
pushCodeSet(codeSet_212) {
|
|
591
|
+
let t_213;
|
|
592
|
+
let t_214;
|
|
593
|
+
let t_215;
|
|
594
|
+
let t_216;
|
|
595
|
+
const adjusted_217 = regexFormatterAdjustCodeSet_218(this, codeSet_212, regexRefs_147);
|
|
596
596
|
try {
|
|
597
|
-
|
|
598
|
-
|
|
597
|
+
requireInstanceOf__178(adjusted_217, CodeSet);
|
|
598
|
+
t_214 = true;
|
|
599
599
|
} catch {
|
|
600
|
-
|
|
600
|
+
t_214 = false;
|
|
601
601
|
}
|
|
602
|
-
|
|
603
|
-
if (
|
|
604
|
-
|
|
602
|
+
s__1264_219: {
|
|
603
|
+
if (t_214) {
|
|
604
|
+
s__1265_220: {
|
|
605
605
|
try {
|
|
606
|
-
|
|
607
|
-
|
|
606
|
+
t_215 = requireInstanceOf__178(adjusted_217, CodeSet);
|
|
607
|
+
listBuilderAdd_4(this.#out_155, "[");
|
|
608
608
|
} catch {
|
|
609
|
-
break
|
|
609
|
+
break s__1265_220;
|
|
610
610
|
}
|
|
611
|
-
if (
|
|
611
|
+
if (t_215.negated) {
|
|
612
612
|
try {
|
|
613
|
-
|
|
613
|
+
listBuilderAdd_4(this.#out_155, "^");
|
|
614
614
|
} catch {
|
|
615
|
-
break
|
|
615
|
+
break s__1265_220;
|
|
616
616
|
}
|
|
617
617
|
} else {
|
|
618
618
|
void 0;
|
|
619
619
|
}
|
|
620
|
-
let
|
|
620
|
+
let i_221 = 0;
|
|
621
621
|
while (true) {
|
|
622
|
-
|
|
623
|
-
if (
|
|
622
|
+
t_213 = t_215.items.length;
|
|
623
|
+
if (i_221 < t_213) {
|
|
624
624
|
try {
|
|
625
|
-
|
|
625
|
+
t_216 = listGet_53(t_215.items, i_221);
|
|
626
626
|
} catch {
|
|
627
|
-
break
|
|
627
|
+
break s__1265_220;
|
|
628
628
|
}
|
|
629
|
-
this.pushCodeSetItem(
|
|
630
|
-
|
|
629
|
+
this.pushCodeSetItem(t_216);
|
|
630
|
+
i_221 = i_221 + 1;
|
|
631
631
|
} else {
|
|
632
632
|
break;
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
try {
|
|
636
|
-
|
|
637
|
-
break
|
|
636
|
+
listBuilderAdd_4(this.#out_155, "]");
|
|
637
|
+
break s__1264_219;
|
|
638
638
|
} catch {
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
throw
|
|
641
|
+
throw Error();
|
|
642
642
|
}
|
|
643
|
-
this.pushRegex(
|
|
643
|
+
this.pushRegex(adjusted_217);
|
|
644
644
|
}
|
|
645
645
|
return;
|
|
646
646
|
}
|
|
647
|
-
/** @param {CodePart}
|
|
648
|
-
pushCodeSetItem(
|
|
649
|
-
let
|
|
650
|
-
let
|
|
651
|
-
let
|
|
652
|
-
let
|
|
653
|
-
let
|
|
654
|
-
let
|
|
655
|
-
let
|
|
647
|
+
/** @param {CodePart} codePart_223 */
|
|
648
|
+
pushCodeSetItem(codePart_223) {
|
|
649
|
+
let return_224;
|
|
650
|
+
let t_225;
|
|
651
|
+
let t_226;
|
|
652
|
+
let t_227;
|
|
653
|
+
let t_228;
|
|
654
|
+
let t_229;
|
|
655
|
+
let t_230;
|
|
656
656
|
try {
|
|
657
|
-
|
|
658
|
-
|
|
657
|
+
requireInstanceOf__178(codePart_223, CodePoints);
|
|
658
|
+
t_225 = true;
|
|
659
659
|
} catch {
|
|
660
|
-
|
|
660
|
+
t_225 = false;
|
|
661
661
|
}
|
|
662
|
-
|
|
663
|
-
if (
|
|
662
|
+
s__1269_231: {
|
|
663
|
+
if (t_225) {
|
|
664
664
|
try {
|
|
665
|
-
|
|
665
|
+
t_226 = requireInstanceOf__178(codePart_223, CodePoints);
|
|
666
666
|
} catch {
|
|
667
|
-
break
|
|
667
|
+
break s__1269_231;
|
|
668
668
|
}
|
|
669
|
-
this.pushCodePoints(
|
|
669
|
+
this.pushCodePoints(t_226, true);
|
|
670
670
|
} else {
|
|
671
671
|
try {
|
|
672
|
-
|
|
673
|
-
|
|
672
|
+
requireInstanceOf__178(codePart_223, CodeRange);
|
|
673
|
+
t_227 = true;
|
|
674
674
|
} catch {
|
|
675
|
-
|
|
675
|
+
t_227 = false;
|
|
676
676
|
}
|
|
677
|
-
if (
|
|
677
|
+
if (t_227) {
|
|
678
678
|
try {
|
|
679
|
-
|
|
679
|
+
t_228 = requireInstanceOf__178(codePart_223, CodeRange);
|
|
680
680
|
} catch {
|
|
681
|
-
break
|
|
681
|
+
break s__1269_231;
|
|
682
682
|
}
|
|
683
|
-
this.pushCodeRangeUnwrapped(
|
|
683
|
+
this.pushCodeRangeUnwrapped(t_228);
|
|
684
684
|
} else {
|
|
685
685
|
try {
|
|
686
|
-
|
|
687
|
-
|
|
686
|
+
requireInstanceOf__178(codePart_223, SpecialSet);
|
|
687
|
+
t_229 = true;
|
|
688
688
|
} catch {
|
|
689
|
-
|
|
689
|
+
t_229 = false;
|
|
690
690
|
}
|
|
691
|
-
if (
|
|
691
|
+
if (t_229) {
|
|
692
692
|
try {
|
|
693
|
-
|
|
693
|
+
t_230 = requireInstanceOf__178(codePart_223, SpecialSet);
|
|
694
694
|
} catch {
|
|
695
|
-
break
|
|
695
|
+
break s__1269_231;
|
|
696
696
|
}
|
|
697
|
-
this.pushRegex(
|
|
697
|
+
this.pushRegex(t_230);
|
|
698
698
|
} else {
|
|
699
699
|
void 0;
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
|
|
704
|
-
return
|
|
703
|
+
return_224 = void 0;
|
|
704
|
+
return return_224;
|
|
705
705
|
}
|
|
706
|
-
throw
|
|
706
|
+
throw Error();
|
|
707
707
|
}
|
|
708
|
-
/** @param {Or}
|
|
709
|
-
pushOr(
|
|
710
|
-
let
|
|
711
|
-
let
|
|
712
|
-
let
|
|
713
|
-
|
|
714
|
-
|
|
708
|
+
/** @param {Or} or_233 */
|
|
709
|
+
pushOr(or_233) {
|
|
710
|
+
let t_234;
|
|
711
|
+
let t_235;
|
|
712
|
+
let t_236;
|
|
713
|
+
s__1271_237: if (! ! or_233.items.length) {
|
|
714
|
+
s__1272_238: {
|
|
715
715
|
try {
|
|
716
|
-
|
|
717
|
-
|
|
716
|
+
listBuilderAdd_4(this.#out_155, "(?:");
|
|
717
|
+
t_235 = listGet_53(or_233.items, 0);
|
|
718
718
|
} catch {
|
|
719
|
-
break
|
|
719
|
+
break s__1272_238;
|
|
720
720
|
}
|
|
721
|
-
this.pushRegex(
|
|
722
|
-
let
|
|
721
|
+
this.pushRegex(t_235);
|
|
722
|
+
let i_239 = 1;
|
|
723
723
|
while (true) {
|
|
724
|
-
|
|
725
|
-
if (
|
|
724
|
+
t_234 = or_233.items.length;
|
|
725
|
+
if (i_239 < t_234) {
|
|
726
726
|
try {
|
|
727
|
-
|
|
728
|
-
|
|
727
|
+
listBuilderAdd_4(this.#out_155, "|");
|
|
728
|
+
t_236 = listGet_53(or_233.items, i_239);
|
|
729
729
|
} catch {
|
|
730
730
|
break;
|
|
731
731
|
}
|
|
732
|
-
this.pushRegex(
|
|
733
|
-
|
|
732
|
+
this.pushRegex(t_236);
|
|
733
|
+
i_239 = i_239 + 1;
|
|
734
734
|
} else {
|
|
735
735
|
try {
|
|
736
|
-
|
|
736
|
+
listBuilderAdd_4(this.#out_155, ")");
|
|
737
737
|
} catch {
|
|
738
|
-
break
|
|
738
|
+
break s__1272_238;
|
|
739
739
|
}
|
|
740
|
-
break
|
|
740
|
+
break s__1271_237;
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
|
-
throw
|
|
744
|
+
throw Error();
|
|
745
745
|
}
|
|
746
746
|
return;
|
|
747
747
|
}
|
|
748
|
-
/** @param {Repeat}
|
|
749
|
-
pushRepeat(
|
|
750
|
-
let
|
|
751
|
-
let
|
|
752
|
-
let
|
|
753
|
-
let
|
|
754
|
-
let
|
|
755
|
-
let
|
|
756
|
-
let
|
|
757
|
-
|
|
758
|
-
let
|
|
759
|
-
let
|
|
748
|
+
/** @param {Repeat} repeat_241 */
|
|
749
|
+
pushRepeat(repeat_241) {
|
|
750
|
+
let return_242;
|
|
751
|
+
let t_243;
|
|
752
|
+
let t_244;
|
|
753
|
+
let t_245;
|
|
754
|
+
let t_246;
|
|
755
|
+
let t_247;
|
|
756
|
+
let t_248;
|
|
757
|
+
s__1275_249: {
|
|
758
|
+
let min_250;
|
|
759
|
+
let max_251;
|
|
760
760
|
try {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
this.pushRegex(
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
761
|
+
listBuilderAdd_4(this.#out_155, "(?:");
|
|
762
|
+
t_243 = repeat_241.item;
|
|
763
|
+
this.pushRegex(t_243);
|
|
764
|
+
listBuilderAdd_4(this.#out_155, ")");
|
|
765
|
+
min_250 = repeat_241.min;
|
|
766
|
+
max_251 = repeat_241.max;
|
|
767
767
|
} catch {
|
|
768
|
-
break
|
|
768
|
+
break s__1275_249;
|
|
769
769
|
}
|
|
770
|
-
if (
|
|
771
|
-
|
|
770
|
+
if (min_250 === 0) {
|
|
771
|
+
t_244 = max_251 === 1;
|
|
772
772
|
} else {
|
|
773
|
-
|
|
773
|
+
t_244 = false;
|
|
774
774
|
}
|
|
775
|
-
if (
|
|
775
|
+
if (t_244) {
|
|
776
776
|
try {
|
|
777
|
-
|
|
777
|
+
listBuilderAdd_4(this.#out_155, "?");
|
|
778
778
|
} catch {
|
|
779
|
-
break
|
|
779
|
+
break s__1275_249;
|
|
780
780
|
}
|
|
781
781
|
} else {
|
|
782
|
-
if (
|
|
783
|
-
|
|
782
|
+
if (min_250 === 0) {
|
|
783
|
+
t_245 = max_251 === null;
|
|
784
784
|
} else {
|
|
785
|
-
|
|
785
|
+
t_245 = false;
|
|
786
786
|
}
|
|
787
|
-
if (
|
|
787
|
+
if (t_245) {
|
|
788
788
|
try {
|
|
789
|
-
|
|
789
|
+
listBuilderAdd_4(this.#out_155, "*");
|
|
790
790
|
} catch {
|
|
791
|
-
break
|
|
791
|
+
break s__1275_249;
|
|
792
792
|
}
|
|
793
793
|
} else {
|
|
794
|
-
if (
|
|
795
|
-
|
|
794
|
+
if (min_250 === 1) {
|
|
795
|
+
t_246 = max_251 === null;
|
|
796
796
|
} else {
|
|
797
|
-
|
|
797
|
+
t_246 = false;
|
|
798
798
|
}
|
|
799
|
-
if (
|
|
799
|
+
if (t_246) {
|
|
800
800
|
try {
|
|
801
|
-
|
|
801
|
+
listBuilderAdd_4(this.#out_155, "+");
|
|
802
802
|
} catch {
|
|
803
|
-
break
|
|
803
|
+
break s__1275_249;
|
|
804
804
|
}
|
|
805
805
|
} else {
|
|
806
806
|
try {
|
|
807
|
-
|
|
807
|
+
listBuilderAdd_4(this.#out_155, strCat_57("{", intToString_252(min_250)));
|
|
808
808
|
} catch {
|
|
809
|
-
break
|
|
809
|
+
break s__1275_249;
|
|
810
810
|
}
|
|
811
|
-
if (
|
|
811
|
+
if (min_250 !== max_251) {
|
|
812
812
|
try {
|
|
813
|
-
|
|
813
|
+
listBuilderAdd_4(this.#out_155, ",");
|
|
814
814
|
} catch {
|
|
815
|
-
break
|
|
815
|
+
break s__1275_249;
|
|
816
816
|
}
|
|
817
|
-
if (
|
|
818
|
-
|
|
817
|
+
if (max_251 !== null) {
|
|
818
|
+
t_248 = this.#out_155;
|
|
819
819
|
try {
|
|
820
|
-
|
|
821
|
-
|
|
820
|
+
t_247 = requireIsSafeInteger__253(max_251);
|
|
821
|
+
listBuilderAdd_4(t_248, intToString_252(t_247));
|
|
822
822
|
} catch {
|
|
823
|
-
break
|
|
823
|
+
break s__1275_249;
|
|
824
824
|
}
|
|
825
825
|
} else {
|
|
826
826
|
void 0;
|
|
@@ -829,244 +829,244 @@ class RegexFormatter_186 {
|
|
|
829
829
|
void 0;
|
|
830
830
|
}
|
|
831
831
|
try {
|
|
832
|
-
|
|
832
|
+
listBuilderAdd_4(this.#out_155, "}");
|
|
833
833
|
} catch {
|
|
834
|
-
break
|
|
834
|
+
break s__1275_249;
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
if (
|
|
839
|
+
if (repeat_241.reluctant) {
|
|
840
840
|
try {
|
|
841
|
-
|
|
841
|
+
listBuilderAdd_4(this.#out_155, "?");
|
|
842
842
|
} catch {
|
|
843
|
-
break
|
|
843
|
+
break s__1275_249;
|
|
844
844
|
}
|
|
845
845
|
} else {
|
|
846
846
|
void 0;
|
|
847
847
|
}
|
|
848
|
-
|
|
849
|
-
return
|
|
848
|
+
return_242 = void 0;
|
|
849
|
+
return return_242;
|
|
850
850
|
}
|
|
851
|
-
throw
|
|
851
|
+
throw Error();
|
|
852
852
|
}
|
|
853
|
-
/** @param {Sequence}
|
|
854
|
-
pushSequence(
|
|
855
|
-
let
|
|
856
|
-
let
|
|
857
|
-
let
|
|
858
|
-
let
|
|
859
|
-
|
|
853
|
+
/** @param {Sequence} sequence_255 */
|
|
854
|
+
pushSequence(sequence_255) {
|
|
855
|
+
let return_256;
|
|
856
|
+
let t_257;
|
|
857
|
+
let t_258;
|
|
858
|
+
let i_259 = 0;
|
|
859
|
+
s__1278_260: {
|
|
860
860
|
while (true) {
|
|
861
|
-
|
|
862
|
-
if (
|
|
861
|
+
t_257 = sequence_255.items.length;
|
|
862
|
+
if (i_259 < t_257) {
|
|
863
863
|
try {
|
|
864
|
-
|
|
864
|
+
t_258 = listGet_53(sequence_255.items, i_259);
|
|
865
865
|
} catch {
|
|
866
866
|
break;
|
|
867
867
|
}
|
|
868
|
-
this.pushRegex(
|
|
869
|
-
|
|
868
|
+
this.pushRegex(t_258);
|
|
869
|
+
i_259 = i_259 + 1;
|
|
870
870
|
} else {
|
|
871
|
-
|
|
872
|
-
break
|
|
871
|
+
return_256 = void 0;
|
|
872
|
+
break s__1278_260;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
throw
|
|
875
|
+
throw Error();
|
|
876
876
|
}
|
|
877
|
-
return
|
|
877
|
+
return return_256;
|
|
878
878
|
}
|
|
879
879
|
/**
|
|
880
|
-
* @param {CodePart}
|
|
880
|
+
* @param {CodePart} codePart_262
|
|
881
881
|
* @returns {number | null}
|
|
882
882
|
*/
|
|
883
|
-
maxCode(
|
|
884
|
-
let
|
|
885
|
-
let
|
|
886
|
-
let
|
|
887
|
-
let
|
|
888
|
-
let
|
|
889
|
-
let
|
|
890
|
-
let
|
|
891
|
-
let
|
|
892
|
-
let
|
|
893
|
-
let
|
|
894
|
-
let
|
|
883
|
+
maxCode(codePart_262) {
|
|
884
|
+
let return_263;
|
|
885
|
+
let t_264;
|
|
886
|
+
let t_265;
|
|
887
|
+
let t_266;
|
|
888
|
+
let t_267;
|
|
889
|
+
let t_268;
|
|
890
|
+
let t_269;
|
|
891
|
+
let t_270;
|
|
892
|
+
let t_271;
|
|
893
|
+
let t_272;
|
|
894
|
+
let t_273;
|
|
895
895
|
try {
|
|
896
|
-
|
|
897
|
-
|
|
896
|
+
requireInstanceOf__178(codePart_262, CodePoints);
|
|
897
|
+
t_270 = true;
|
|
898
898
|
} catch {
|
|
899
|
-
|
|
899
|
+
t_270 = false;
|
|
900
900
|
}
|
|
901
|
-
|
|
902
|
-
if (
|
|
901
|
+
s__1280_274: {
|
|
902
|
+
if (t_270) {
|
|
903
903
|
try {
|
|
904
|
-
|
|
904
|
+
t_271 = requireInstanceOf__178(codePart_262, CodePoints);
|
|
905
905
|
} catch {
|
|
906
|
-
break
|
|
906
|
+
break s__1280_274;
|
|
907
907
|
}
|
|
908
|
-
const
|
|
909
|
-
if (!
|
|
910
|
-
|
|
908
|
+
const value_275 = t_271.value;
|
|
909
|
+
if (! value_275) {
|
|
910
|
+
return_263 = null;
|
|
911
911
|
} else {
|
|
912
|
-
let
|
|
913
|
-
|
|
914
|
-
let
|
|
912
|
+
let max_276 = 0;
|
|
913
|
+
t_264 = stringCodePoints_201(value_275);
|
|
914
|
+
let slice_277 = t_264;
|
|
915
915
|
while (true) {
|
|
916
|
-
if (!
|
|
917
|
-
const
|
|
918
|
-
if (
|
|
919
|
-
|
|
916
|
+
if (! slice_277.isEmpty) {
|
|
917
|
+
const next_278 = slice_277.read();
|
|
918
|
+
if (next_278 > max_276) {
|
|
919
|
+
max_276 = next_278;
|
|
920
920
|
} else {
|
|
921
921
|
void 0;
|
|
922
922
|
}
|
|
923
|
-
|
|
924
|
-
|
|
923
|
+
t_265 = slice_277.advance(1);
|
|
924
|
+
slice_277 = t_265;
|
|
925
925
|
} else {
|
|
926
926
|
break;
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
|
-
|
|
929
|
+
return_263 = max_276;
|
|
930
930
|
}
|
|
931
931
|
} else {
|
|
932
932
|
try {
|
|
933
|
-
|
|
934
|
-
|
|
933
|
+
requireInstanceOf__178(codePart_262, CodeRange);
|
|
934
|
+
t_272 = true;
|
|
935
935
|
} catch {
|
|
936
|
-
|
|
936
|
+
t_272 = false;
|
|
937
937
|
}
|
|
938
|
-
if (
|
|
938
|
+
if (t_272) {
|
|
939
939
|
try {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
940
|
+
t_273 = requireInstanceOf__178(codePart_262, CodeRange);
|
|
941
|
+
t_266 = t_273.max;
|
|
942
|
+
return_263 = t_266;
|
|
943
943
|
} catch {
|
|
944
|
-
break
|
|
944
|
+
break s__1280_274;
|
|
945
945
|
}
|
|
946
|
-
} else if (
|
|
947
|
-
|
|
946
|
+
} else if (eqGeneric_180(codePart_262, Digit)) {
|
|
947
|
+
t_267 = stringCodePoints_201("9").read();
|
|
948
948
|
try {
|
|
949
|
-
|
|
949
|
+
return_263 = t_267;
|
|
950
950
|
} catch {
|
|
951
|
-
break
|
|
951
|
+
break s__1280_274;
|
|
952
952
|
}
|
|
953
|
-
} else if (
|
|
954
|
-
|
|
953
|
+
} else if (eqGeneric_180(codePart_262, Space)) {
|
|
954
|
+
t_268 = stringCodePoints_201(" ").read();
|
|
955
955
|
try {
|
|
956
|
-
|
|
956
|
+
return_263 = t_268;
|
|
957
957
|
} catch {
|
|
958
|
-
break
|
|
958
|
+
break s__1280_274;
|
|
959
959
|
}
|
|
960
|
-
} else if (
|
|
961
|
-
|
|
960
|
+
} else if (eqGeneric_180(codePart_262, Word)) {
|
|
961
|
+
t_269 = stringCodePoints_201("z").read();
|
|
962
962
|
try {
|
|
963
|
-
|
|
963
|
+
return_263 = t_269;
|
|
964
964
|
} catch {
|
|
965
|
-
break
|
|
965
|
+
break s__1280_274;
|
|
966
966
|
}
|
|
967
967
|
} else {
|
|
968
|
-
|
|
968
|
+
return_263 = null;
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
|
-
return
|
|
971
|
+
return return_263;
|
|
972
972
|
}
|
|
973
|
-
throw
|
|
973
|
+
throw Error();
|
|
974
974
|
}
|
|
975
|
-
/** @param {Array<string>}
|
|
976
|
-
constructor(
|
|
977
|
-
let
|
|
978
|
-
if (!(
|
|
979
|
-
|
|
980
|
-
|
|
975
|
+
/** @param {Array<string>} out_279 */
|
|
976
|
+
constructor(out_279) {
|
|
977
|
+
let t_280;
|
|
978
|
+
if (!(out_279 !== void 0)) {
|
|
979
|
+
t_280 = [];
|
|
980
|
+
out_279 = t_280;
|
|
981
981
|
}
|
|
982
|
-
this.#
|
|
982
|
+
this.#out_155 = out_279;
|
|
983
983
|
return;
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
|
-
class
|
|
986
|
+
class Begin_281 {
|
|
987
987
|
constructor() {
|
|
988
988
|
return;
|
|
989
989
|
}
|
|
990
990
|
}
|
|
991
|
-
Special.implementedBy(
|
|
992
|
-
/** @type {
|
|
993
|
-
export const Begin = new
|
|
994
|
-
class
|
|
991
|
+
Special.implementedBy(Begin_281);
|
|
992
|
+
/** @type {Special} */
|
|
993
|
+
export const Begin = new Begin_281();
|
|
994
|
+
class Dot_282 {
|
|
995
995
|
constructor() {
|
|
996
996
|
return;
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
|
-
Special.implementedBy(
|
|
1000
|
-
/** @type {
|
|
1001
|
-
export const Dot = new
|
|
1002
|
-
class
|
|
999
|
+
Special.implementedBy(Dot_282);
|
|
1000
|
+
/** @type {Special} */
|
|
1001
|
+
export const Dot = new Dot_282();
|
|
1002
|
+
class End_283 {
|
|
1003
1003
|
constructor() {
|
|
1004
1004
|
return;
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
|
-
Special.implementedBy(
|
|
1008
|
-
/** @type {
|
|
1009
|
-
export const End = new
|
|
1010
|
-
class
|
|
1007
|
+
Special.implementedBy(End_283);
|
|
1008
|
+
/** @type {Special} */
|
|
1009
|
+
export const End = new End_283();
|
|
1010
|
+
class WordBoundary_284 {
|
|
1011
1011
|
constructor() {
|
|
1012
1012
|
return;
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
|
-
Special.implementedBy(
|
|
1016
|
-
/** @type {
|
|
1017
|
-
export const WordBoundary = new
|
|
1018
|
-
class
|
|
1015
|
+
Special.implementedBy(WordBoundary_284);
|
|
1016
|
+
/** @type {Special} */
|
|
1017
|
+
export const WordBoundary = new WordBoundary_284();
|
|
1018
|
+
class Digit_285 {
|
|
1019
1019
|
constructor() {
|
|
1020
1020
|
return;
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
|
-
SpecialSet.implementedBy(
|
|
1024
|
-
/** @type {
|
|
1025
|
-
export const Digit = new
|
|
1026
|
-
class
|
|
1023
|
+
SpecialSet.implementedBy(Digit_285);
|
|
1024
|
+
/** @type {SpecialSet} */
|
|
1025
|
+
export const Digit = new Digit_285();
|
|
1026
|
+
class Space_286 {
|
|
1027
1027
|
constructor() {
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
|
-
SpecialSet.implementedBy(
|
|
1032
|
-
/** @type {
|
|
1033
|
-
export const Space = new
|
|
1034
|
-
class
|
|
1031
|
+
SpecialSet.implementedBy(Space_286);
|
|
1032
|
+
/** @type {SpecialSet} */
|
|
1033
|
+
export const Space = new Space_286();
|
|
1034
|
+
class Word_287 {
|
|
1035
1035
|
constructor() {
|
|
1036
1036
|
return;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
SpecialSet.implementedBy(
|
|
1040
|
-
/** @type {
|
|
1041
|
-
export const Word = new
|
|
1039
|
+
SpecialSet.implementedBy(Word_287);
|
|
1040
|
+
/** @type {SpecialSet} */
|
|
1041
|
+
export const Word = new Word_287();
|
|
1042
1042
|
/**
|
|
1043
|
-
* @param {Regex}
|
|
1043
|
+
* @param {Regex} item_288
|
|
1044
1044
|
* @returns {Regex}
|
|
1045
1045
|
*/
|
|
1046
|
-
export function entire(
|
|
1047
|
-
return new Sequence(
|
|
1046
|
+
export function entire(item_288) {
|
|
1047
|
+
return new Sequence(listify_42(Begin, item_288, End));
|
|
1048
1048
|
};
|
|
1049
1049
|
/**
|
|
1050
|
-
* @param {Regex}
|
|
1051
|
-
* @param {boolean}
|
|
1050
|
+
* @param {Regex} item_289
|
|
1051
|
+
* @param {boolean} reluctant_290
|
|
1052
1052
|
* @returns {Repeat}
|
|
1053
1053
|
*/
|
|
1054
|
-
export function oneOrMore(
|
|
1055
|
-
if (!(
|
|
1056
|
-
|
|
1054
|
+
export function oneOrMore(item_289, reluctant_290) {
|
|
1055
|
+
if (!(reluctant_290 !== void 0)) {
|
|
1056
|
+
reluctant_290 = false;
|
|
1057
1057
|
}
|
|
1058
|
-
return new Repeat(
|
|
1058
|
+
return new Repeat(item_289, 1, null, reluctant_290);
|
|
1059
1059
|
};
|
|
1060
1060
|
/**
|
|
1061
|
-
* @param {Regex}
|
|
1062
|
-
* @param {boolean}
|
|
1061
|
+
* @param {Regex} item_291
|
|
1062
|
+
* @param {boolean} reluctant_292
|
|
1063
1063
|
* @returns {Repeat}
|
|
1064
1064
|
*/
|
|
1065
|
-
export function optional(
|
|
1066
|
-
if (!(
|
|
1067
|
-
|
|
1065
|
+
export function optional(item_291, reluctant_292) {
|
|
1066
|
+
if (!(reluctant_292 !== void 0)) {
|
|
1067
|
+
reluctant_292 = false;
|
|
1068
1068
|
}
|
|
1069
|
-
return new Repeat(
|
|
1069
|
+
return new Repeat(item_291, 0, 1, reluctant_292);
|
|
1070
1070
|
};
|
|
1071
|
-
/** @type {
|
|
1072
|
-
const
|
|
1071
|
+
/** @type {RegexRefs_122} */
|
|
1072
|
+
const regexRefs_147 = new RegexRefs_122();
|