@@ -238,8 +238,10 @@ class RegexDSLTests: XCTestCase {
238238 ( " abcabc " , " abcabc " ) ,
239239 ( " abcABCaBc " , " abcABCaBc " ) ,
240240 matchType: Substring . self, == ) {
241- OneOrMore {
242- " abc "
241+ Regex {
242+ OneOrMore {
243+ " abc "
244+ }
243245 } . ignoresCase ( true )
244246 }
245247
@@ -251,8 +253,10 @@ class RegexDSLTests: XCTestCase {
251253 ( " abcabc " , " abcabc " ) ,
252254 ( " abcABCaBc " , " abcABCaBc " ) ,
253255 matchType: Substring . self, == ) {
254- OneOrMore {
255- " abc "
256+ Regex {
257+ OneOrMore {
258+ " abc "
259+ }
256260 }
257261 . ignoresCase ( true )
258262 . ignoresCase ( false )
@@ -268,9 +272,13 @@ class RegexDSLTests: XCTestCase {
268272 ( " abcabc " , " abcabc " ) ,
269273 ( " abcdeABCdeaBcde " , " abcdeABCdeaBcde " ) ,
270274 matchType: Substring . self, == ) {
271- OneOrMore {
272- " abc " . ignoresCase ( true )
273- Optionally ( " de " )
275+ Regex {
276+ OneOrMore {
277+ Regex {
278+ " abc "
279+ } . ignoresCase ( true )
280+ Optionally ( " de " )
281+ }
274282 }
275283 . ignoresCase ( false )
276284 }
@@ -307,11 +315,13 @@ class RegexDSLTests: XCTestCase {
307315 " stop "
308316 " "
309317
310- Capture {
311- OneOrMore ( . word)
312- Anchor . wordBoundary
313- }
314- . wordBoundaryKind ( . simple)
318+ Regex {
319+ Capture {
320+ OneOrMore ( . word)
321+ Anchor . wordBoundary
322+ }
323+ } . wordBoundaryKind ( . simple)
324+
315325 OneOrMore ( . any, . reluctant)
316326 " stop "
317327 }
@@ -321,15 +331,17 @@ class RegexDSLTests: XCTestCase {
321331 matchType: ( Substring, Substring, Substring) . self, == ) {
322332 Capture {
323333 // Reluctant behavior due to option
324- OneOrMore ( . anyOf( " abcd " ) )
325- . repetitionBehavior ( . reluctant)
334+ Regex {
335+ OneOrMore ( . anyOf( " abcd " ) )
336+ } . repetitionBehavior ( . reluctant)
326337 }
327338 ZeroOrMore ( " a " ... " z " )
328339
329340 Capture {
330341 // Eager behavior due to explicit parameter, despite option
331- OneOrMore ( . digit, . eager)
332- . repetitionBehavior ( . reluctant)
342+ Regex {
343+ OneOrMore ( . digit, . eager)
344+ } . repetitionBehavior ( . reluctant)
333345 }
334346 ZeroOrMore ( . digit)
335347 }
@@ -338,10 +350,11 @@ class RegexDSLTests: XCTestCase {
338350 ( " abcdefg " , ( " abcdefg " , " abcdefg " ) ) ,
339351 ( " abcdéfg " , ( " abcdéfg " , " abcd " ) ) ,
340352 matchType: ( Substring, Substring) . self, == ) {
341- Capture {
342- OneOrMore ( . word)
343- }
344- . asciiOnlyWordCharacters ( )
353+ Regex {
354+ Capture {
355+ OneOrMore ( . word)
356+ }
357+ } . asciiOnlyWordCharacters ( )
345358
346359 ZeroOrMore ( . any)
347360 }
@@ -372,8 +385,10 @@ class RegexDSLTests: XCTestCase {
372385 ( " abc1def2 " , ( " abc1def2 " , " 1 " ) ) ,
373386 matchType: ( Substring, Substring) . self, == )
374387 {
375- OneOrMore ( . reluctant) {
376- One ( . word)
388+ Regex {
389+ OneOrMore ( . reluctant) {
390+ One ( . word)
391+ }
377392 } . repetitionBehavior ( . possessive)
378393 Capture ( . digit)
379394 ZeroOrMore ( . any)
@@ -425,8 +440,9 @@ class RegexDSLTests: XCTestCase {
425440 {
426441 Regex {
427442 Capture {
428- OneOrMore ( " a " )
429- . repetitionBehavior ( . eager)
443+ Regex {
444+ OneOrMore ( " a " )
445+ } . repetitionBehavior ( . eager)
430446 }
431447 OneOrMore ( " a " )
432448 } . repetitionBehavior ( . possessive)
@@ -438,8 +454,9 @@ class RegexDSLTests: XCTestCase {
438454 {
439455 Regex {
440456 Capture {
441- OneOrMore ( " a " )
442- . repetitionBehavior ( . reluctant)
457+ Regex {
458+ OneOrMore ( " a " )
459+ } . repetitionBehavior ( . reluctant)
443460 }
444461 OneOrMore ( " a " )
445462 } . repetitionBehavior ( . possessive)
0 commit comments