@@ -234,8 +234,10 @@ class RegexDSLTests: XCTestCase {
234
234
( " abcabc " , " abcabc " ) ,
235
235
( " abcABCaBc " , " abcABCaBc " ) ,
236
236
matchType: Substring . self, == ) {
237
- OneOrMore {
238
- " abc "
237
+ Regex {
238
+ OneOrMore {
239
+ " abc "
240
+ }
239
241
} . ignoresCase ( true )
240
242
}
241
243
@@ -247,8 +249,10 @@ class RegexDSLTests: XCTestCase {
247
249
( " abcabc " , " abcabc " ) ,
248
250
( " abcABCaBc " , " abcABCaBc " ) ,
249
251
matchType: Substring . self, == ) {
250
- OneOrMore {
251
- " abc "
252
+ Regex {
253
+ OneOrMore {
254
+ " abc "
255
+ }
252
256
}
253
257
. ignoresCase ( true )
254
258
. ignoresCase ( false )
@@ -264,9 +268,13 @@ class RegexDSLTests: XCTestCase {
264
268
( " abcabc " , " abcabc " ) ,
265
269
( " abcdeABCdeaBcde " , " abcdeABCdeaBcde " ) ,
266
270
matchType: Substring . self, == ) {
267
- OneOrMore {
268
- " abc " . ignoresCase ( true )
269
- Optionally ( " de " )
271
+ Regex {
272
+ OneOrMore {
273
+ Regex {
274
+ " abc "
275
+ } . ignoresCase ( true )
276
+ Optionally ( " de " )
277
+ }
270
278
}
271
279
. ignoresCase ( false )
272
280
}
@@ -303,11 +311,13 @@ class RegexDSLTests: XCTestCase {
303
311
" stop "
304
312
" "
305
313
306
- Capture {
307
- OneOrMore ( . word)
308
- Anchor . wordBoundary
309
- }
310
- . wordBoundaryKind ( . simple)
314
+ Regex {
315
+ Capture {
316
+ OneOrMore ( . word)
317
+ Anchor . wordBoundary
318
+ }
319
+ } . wordBoundaryKind ( . simple)
320
+
311
321
OneOrMore ( . any, . reluctant)
312
322
" stop "
313
323
}
@@ -317,15 +327,17 @@ class RegexDSLTests: XCTestCase {
317
327
matchType: ( Substring, Substring, Substring) . self, == ) {
318
328
Capture {
319
329
// Reluctant behavior due to option
320
- OneOrMore ( . anyOf( " abcd " ) )
321
- . repetitionBehavior ( . reluctant)
330
+ Regex {
331
+ OneOrMore ( . anyOf( " abcd " ) )
332
+ } . repetitionBehavior ( . reluctant)
322
333
}
323
334
ZeroOrMore ( " a " ... " z " )
324
335
325
336
Capture {
326
337
// Eager behavior due to explicit parameter, despite option
327
- OneOrMore ( . digit, . eager)
328
- . repetitionBehavior ( . reluctant)
338
+ Regex {
339
+ OneOrMore ( . digit, . eager)
340
+ } . repetitionBehavior ( . reluctant)
329
341
}
330
342
ZeroOrMore ( . digit)
331
343
}
@@ -334,10 +346,11 @@ class RegexDSLTests: XCTestCase {
334
346
( " abcdefg " , ( " abcdefg " , " abcdefg " ) ) ,
335
347
( " abcdéfg " , ( " abcdéfg " , " abcd " ) ) ,
336
348
matchType: ( Substring, Substring) . self, == ) {
337
- Capture {
338
- OneOrMore ( . word)
339
- }
340
- . asciiOnlyWordCharacters ( )
349
+ Regex {
350
+ Capture {
351
+ OneOrMore ( . word)
352
+ }
353
+ } . asciiOnlyWordCharacters ( )
341
354
342
355
ZeroOrMore ( . any)
343
356
}
@@ -368,8 +381,10 @@ class RegexDSLTests: XCTestCase {
368
381
( " abc1def2 " , ( " abc1def2 " , " 1 " ) ) ,
369
382
matchType: ( Substring, Substring) . self, == )
370
383
{
371
- OneOrMore ( . reluctant) {
372
- One ( . word)
384
+ Regex {
385
+ OneOrMore ( . reluctant) {
386
+ One ( . word)
387
+ }
373
388
} . repetitionBehavior ( . possessive)
374
389
Capture ( . digit)
375
390
ZeroOrMore ( . any)
@@ -421,8 +436,9 @@ class RegexDSLTests: XCTestCase {
421
436
{
422
437
Regex {
423
438
Capture {
424
- OneOrMore ( " a " )
425
- . repetitionBehavior ( . eager)
439
+ Regex {
440
+ OneOrMore ( " a " )
441
+ } . repetitionBehavior ( . eager)
426
442
}
427
443
OneOrMore ( " a " )
428
444
} . repetitionBehavior ( . possessive)
@@ -434,8 +450,9 @@ class RegexDSLTests: XCTestCase {
434
450
{
435
451
Regex {
436
452
Capture {
437
- OneOrMore ( " a " )
438
- . repetitionBehavior ( . reluctant)
453
+ Regex {
454
+ OneOrMore ( " a " )
455
+ } . repetitionBehavior ( . reluctant)
439
456
}
440
457
OneOrMore ( " a " )
441
458
} . repetitionBehavior ( . possessive)
0 commit comments