@@ -201,7 +201,7 @@ extension RegexTests {
201201 " abc " , concat ( " a " , " b " , " c " ) )
202202 parseTest (
203203 #"abc\+d*"# ,
204- concat ( " a " , " b " , " c " , " + " , zeroOrMore ( . eager , " d " ) ) )
204+ concat ( " a " , " b " , " c " , " + " , zeroOrMore ( of : " d " ) ) )
205205 parseTest (
206206 " a(b) " , concat ( " a " , capture ( " b " ) ) ,
207207 captures: . atom( ) )
@@ -211,31 +211,31 @@ extension RegexTests {
211211 concat (
212212 " a " , " b " , " c " ,
213213 oneOrMore (
214- . eager , nonCapture ( concat ( " d " , " e " ) ) ) ,
215- " f " , " g " , " h " , zeroOrMore ( . eager , " i " ) , " k " ) ,
214+ of : nonCapture ( concat ( " d " , " e " ) ) ) ,
215+ " f " , " g " , " h " , zeroOrMore ( of : " i " ) , " k " ) ,
216216 " j " ) )
217217 parseTest (
218218 " a(?:b|c)?d " ,
219219 concat ( " a " , zeroOrOne (
220- . eager , nonCapture ( alt ( " b " , " c " ) ) ) , " d " ) )
220+ of : nonCapture ( alt ( " b " , " c " ) ) ) , " d " ) )
221221 parseTest (
222222 " a?b??c+d+?e*f*? " ,
223223 concat (
224- zeroOrOne ( . eager , " a " ) , zeroOrOne ( . reluctant, " b " ) ,
225- oneOrMore ( . eager , " c " ) , oneOrMore ( . reluctant, " d " ) ,
226- zeroOrMore ( . eager , " e " ) , zeroOrMore ( . reluctant, " f " ) ) )
224+ zeroOrOne ( of : " a " ) , zeroOrOne ( . reluctant, of : " b " ) ,
225+ oneOrMore ( of : " c " ) , oneOrMore ( . reluctant, of : " d " ) ,
226+ zeroOrMore ( of : " e " ) , zeroOrMore ( . reluctant, of : " f " ) ) )
227227
228228 parseTest (
229229 " (.)*(.*) " ,
230230 concat (
231- zeroOrMore ( . eager , capture ( atom ( . any) ) ) ,
232- capture ( zeroOrMore ( . eager , atom ( . any) ) ) ) ,
231+ zeroOrMore ( of : capture ( atom ( . any) ) ) ,
232+ capture ( zeroOrMore ( of : atom ( . any) ) ) ) ,
233233 captures: . tuple( [ . array( . atom( ) ) , . atom( ) ] ) )
234234 parseTest (
235235 " ((.))*((.)?) " ,
236236 concat (
237- zeroOrMore ( . eager , capture ( capture ( atom ( . any) ) ) ) ,
238- capture ( zeroOrOne ( . eager , capture ( atom ( . any) ) ) ) ) ,
237+ zeroOrMore ( of : capture ( capture ( atom ( . any) ) ) ) ,
238+ capture ( zeroOrOne ( of : capture ( atom ( . any) ) ) ) ) ,
239239 captures: . tuple( [
240240 . array( . atom( ) ) , . array( . atom( ) ) , . atom( ) , . optional( . atom( ) )
241241 ] ) )
@@ -247,7 +247,7 @@ extension RegexTests {
247247
248248 parseTest (
249249 " a|b?c " ,
250- alt ( " a " , concat ( zeroOrOne ( . eager , " b " ) , " c " ) ) )
250+ alt ( " a " , concat ( zeroOrOne ( of : " b " ) , " c " ) ) )
251251 parseTest (
252252 " (a|b)c " ,
253253 concat ( capture ( alt ( " a " , " b " ) ) , " c " ) ,
@@ -419,7 +419,7 @@ extension RegexTests {
419419
420420 parseTest (
421421 #"[a[bc]de&&[^bc]\d]+"# ,
422- oneOrMore ( . eager , charClass (
422+ oneOrMore ( of : charClass (
423423 . setOperation(
424424 [ " a " , charClass ( " b " , " c " ) , " d " , " e " ] ,
425425 . init( faking: . intersection) ,
@@ -448,13 +448,13 @@ extension RegexTests {
448448 parseTest (
449449 " a&&b " , concat ( " a " , " & " , " & " , " b " ) )
450450 parseTest (
451- " &? " , zeroOrOne ( . eager , " & " ) )
451+ " &? " , zeroOrOne ( of : " & " ) )
452452 parseTest (
453- " &&? " , concat ( " & " , zeroOrOne ( . eager , " & " ) ) )
453+ " &&? " , concat ( " & " , zeroOrOne ( of : " & " ) ) )
454454 parseTest (
455- " --+ " , concat ( " - " , oneOrMore ( . eager , " - " ) ) )
455+ " --+ " , concat ( " - " , oneOrMore ( of : " - " ) ) )
456456 parseTest (
457- " ~~* " , concat ( " ~ " , zeroOrMore ( . eager , " ~ " ) ) )
457+ " ~~* " , concat ( " ~ " , zeroOrMore ( of : " ~ " ) ) )
458458
459459 // MARK: Quotes
460460
@@ -496,25 +496,25 @@ extension RegexTests {
496496
497497 parseTest (
498498 #"a{1,2}"# ,
499- quantRange ( . eager , 1 ... 2 , " a " ) )
499+ quantRange ( 1 ... 2 , of : " a " ) )
500500 parseTest (
501501 #"a{,2}"# ,
502- upToN ( . eager , 2 , " a " ) )
502+ upToN ( 2 , of : " a " ) )
503503 parseTest (
504504 #"a{2,}"# ,
505- nOrMore ( . eager , 2 , " a " ) )
505+ nOrMore ( 2 , of : " a " ) )
506506 parseTest (
507507 #"a{1}"# ,
508- exactly ( . eager , 1 , " a " ) )
508+ exactly ( 1 , of : " a " ) )
509509 parseTest (
510510 #"a{1,2}?"# ,
511- quantRange ( . reluctant , 1 ... 2 , " a " ) )
511+ quantRange ( 1 ... 2 , . reluctant , of : " a " ) )
512512 parseTest (
513513 #"a{0}"# ,
514- exactly ( . eager , 0 , " a " ) )
514+ exactly ( 0 , of : " a " ) )
515515 parseTest (
516516 #"a{0,0}"# ,
517- quantRange ( . eager , 0 ... 0 , " a " ) )
517+ quantRange ( 0 ... 0 , of : " a " ) )
518518
519519 // Make sure ranges get treated as literal if invalid.
520520 parseTest ( " { " , " { " )
@@ -524,16 +524,16 @@ extension RegexTests {
524524 parseTest ( " {,6 " , concat ( " { " , " , " , " 6 " ) )
525525 parseTest ( " {6 " , concat ( " { " , " 6 " ) )
526526 parseTest ( " {6, " , concat ( " { " , " 6 " , " , " ) )
527- parseTest ( " {+ " , oneOrMore ( . eager , " { " ) )
528- parseTest ( " {6,+ " , concat ( " { " , " 6 " , oneOrMore ( . eager , " , " ) ) )
527+ parseTest ( " {+ " , oneOrMore ( of : " { " ) )
528+ parseTest ( " {6,+ " , concat ( " { " , " 6 " , oneOrMore ( of : " , " ) ) )
529529 parseTest ( " x{ " , concat ( " x " , " { " ) )
530530 parseTest ( " x{} " , concat ( " x " , " { " , " } " ) )
531531 parseTest ( " x{,} " , concat ( " x " , " { " , " , " , " } " ) )
532532 parseTest ( " x{,6 " , concat ( " x " , " { " , " , " , " 6 " ) )
533533 parseTest ( " x{6 " , concat ( " x " , " { " , " 6 " ) )
534534 parseTest ( " x{6, " , concat ( " x " , " { " , " 6 " , " , " ) )
535- parseTest ( " x{+ " , concat ( " x " , oneOrMore ( . eager , " { " ) ) )
536- parseTest ( " x{6,+ " , concat ( " x " , " { " , " 6 " , oneOrMore ( . eager , " , " ) ) )
535+ parseTest ( " x{+ " , concat ( " x " , oneOrMore ( of : " { " ) ) )
536+ parseTest ( " x{6,+ " , concat ( " x " , " { " , " 6 " , oneOrMore ( of : " , " ) ) )
537537
538538 // TODO: We should emit a diagnostic for this.
539539 parseTest ( " x{3, 5} " , concat ( " x " , " { " , " 3 " , " , " , " " , " 5 " , " } " ) )
@@ -915,14 +915,11 @@ extension RegexTests {
915915
916916 parseTest ( #"\N{abc}"# , atom ( . namedCharacter( " abc " ) ) )
917917 parseTest ( #"[\N{abc}]"# , charClass ( atom_m ( . namedCharacter( " abc " ) ) ) )
918- parseTest (
919- #"\N{abc}+"# ,
920- oneOrMore ( . eager,
921- atom ( . namedCharacter( " abc " ) ) ) )
918+ parseTest ( #"\N{abc}+"# , oneOrMore ( of: atom ( . namedCharacter( " abc " ) ) ) )
922919 parseTest (
923920 #"\N {2}"# ,
924- concat ( atom ( . escaped( . notNewline) ) ,
925- exactly ( . eager , 2 , " " ) ) )
921+ concat ( atom ( . escaped( . notNewline) ) , exactly ( 2 , of : " " ) )
922+ )
926923
927924 parseTest ( #"\N{AA}"# , atom ( . namedCharacter( " AA " ) ) )
928925 parseTest ( #"\N{U+AA}"# , scalar ( " \u{AA} " ) )
@@ -945,7 +942,7 @@ extension RegexTests {
945942 parseTest ( #"[\p{C}]"# , charClass ( prop_m ( . generalCategory( . other) ) ) )
946943 parseTest (
947944 #"\p{C}+"# ,
948- oneOrMore ( . eager , prop ( . generalCategory( . other) ) ) )
945+ oneOrMore ( of : prop ( . generalCategory( . other) ) ) )
949946
950947 parseTest ( #"\p{Lx}"# , prop ( . other( key: nil , value: " Lx " ) ) )
951948 parseTest ( #"\p{gcL}"# , prop ( . other( key: nil , value: " gcL " ) ) )
@@ -1064,7 +1061,7 @@ extension RegexTests {
10641061 captures: . atom( name: " a1 " )
10651062 )
10661063
1067- parseTest ( #"(?(1))?"# , zeroOrOne ( . eager , conditional (
1064+ parseTest ( #"(?(1))?"# , zeroOrOne ( of : conditional (
10681065 . groupMatched( ref ( 1 ) ) , trueBranch: empty ( ) , falseBranch: empty ( ) ) ) )
10691066
10701067 parseTest ( #"(?(R)a|b)"# , conditional (
@@ -1108,19 +1105,19 @@ extension RegexTests {
11081105
11091106 parseTest ( #"(?((a)?(b))(a)+|b)"# , conditional (
11101107 groupCondition ( . capture, concat (
1111- zeroOrOne ( . eager , capture ( " a " ) ) , capture ( " b " )
1108+ zeroOrOne ( of : capture ( " a " ) ) , capture ( " b " )
11121109 ) ) ,
1113- trueBranch: oneOrMore ( . eager , capture ( " a " ) ) ,
1110+ trueBranch: oneOrMore ( of : capture ( " a " ) ) ,
11141111 falseBranch: " b "
11151112 ) , captures: . tuple( [
11161113 . atom( ) , . optional( . atom( ) ) , . atom( ) , . optional( . array( . atom( ) ) )
11171114 ] ) )
11181115
11191116 parseTest ( #"(?(?:(a)?(b))(a)+|b)"# , conditional (
11201117 groupCondition ( . nonCapture, concat (
1121- zeroOrOne ( . eager , capture ( " a " ) ) , capture ( " b " )
1118+ zeroOrOne ( of : capture ( " a " ) ) , capture ( " b " )
11221119 ) ) ,
1123- trueBranch: oneOrMore ( . eager , capture ( " a " ) ) ,
1120+ trueBranch: oneOrMore ( of : capture ( " a " ) ) ,
11241121 falseBranch: " b "
11251122 ) , captures: . tuple( [
11261123 . optional( . atom( ) ) , . atom( ) , . optional( . array( . atom( ) ) )
@@ -1190,10 +1187,10 @@ extension RegexTests {
11901187
11911188 // MARK: Backtracking directives
11921189
1193- parseTest ( " (*ACCEPT)? " , zeroOrOne ( . eager , backtrackingDirective ( . accept) ) )
1190+ parseTest ( " (*ACCEPT)? " , zeroOrOne ( of : backtrackingDirective ( . accept) ) )
11941191 parseTest (
11951192 " (*ACCEPT:a)?? " ,
1196- zeroOrOne ( . reluctant, backtrackingDirective ( . accept, name: " a " ) )
1193+ zeroOrOne ( . reluctant, of : backtrackingDirective ( . accept, name: " a " ) )
11971194 )
11981195 parseTest ( " (*:a) " , backtrackingDirective ( . mark, name: " a " ) )
11991196 parseTest ( " (*MARK:a) " , backtrackingDirective ( . mark, name: " a " ) )
@@ -1208,17 +1205,17 @@ extension RegexTests {
12081205
12091206 parseTest ( " (?~) " , absentRepeater ( empty ( ) ) )
12101207 parseTest ( " (?~abc) " , absentRepeater ( concat ( " a " , " b " , " c " ) ) )
1211- parseTest ( " (?~a+) " , absentRepeater ( oneOrMore ( . eager , " a " ) ) )
1208+ parseTest ( " (?~a+) " , absentRepeater ( oneOrMore ( of : " a " ) ) )
12121209 parseTest ( " (?~~) " , absentRepeater ( " ~ " ) )
12131210 parseTest ( " (?~a|b|c) " , absentRepeater ( alt ( " a " , " b " , " c " ) ) )
12141211 parseTest ( " (?~(a)) " , absentRepeater ( capture ( " a " ) ) , captures: . empty)
1215- parseTest ( " (?~)* " , zeroOrMore ( . eager , absentRepeater ( empty ( ) ) ) )
1212+ parseTest ( " (?~)* " , zeroOrMore ( of : absentRepeater ( empty ( ) ) ) )
12161213
12171214 parseTest ( " (?~|abc) " , absentStopper ( concat ( " a " , " b " , " c " ) ) )
1218- parseTest ( " (?~|a+) " , absentStopper ( oneOrMore ( . eager , " a " ) ) )
1215+ parseTest ( " (?~|a+) " , absentStopper ( oneOrMore ( of : " a " ) ) )
12191216 parseTest ( " (?~|~) " , absentStopper ( " ~ " ) )
12201217 parseTest ( " (?~|(a)) " , absentStopper ( capture ( " a " ) ) , captures: . empty)
1221- parseTest ( " (?~|a){2} " , exactly ( . eager , 2 , absentStopper ( " a " ) ) )
1218+ parseTest ( " (?~|a){2} " , exactly ( 2 , of : absentStopper ( " a " ) ) )
12221219
12231220 parseTest ( " (?~|a|b) " , absentExpression ( " a " , " b " ) )
12241221 parseTest ( " (?~|~|~) " , absentExpression ( " ~ " , " ~ " ) )
@@ -1227,13 +1224,13 @@ extension RegexTests {
12271224 parseTest ( " (?~|(a)|(?:(b)|c)) " , absentExpression (
12281225 capture ( " a " ) , nonCapture ( alt ( capture ( " b " ) , " c " ) )
12291226 ) , captures: . optional( . atom( ) ) )
1230- parseTest ( " (?~|a|b)? " , zeroOrOne ( . eager , absentExpression ( " a " , " b " ) ) )
1227+ parseTest ( " (?~|a|b)? " , zeroOrOne ( of : absentExpression ( " a " , " b " ) ) )
12311228
12321229 parseTest ( " (?~|) " , absentRangeClear ( ) )
12331230
12341231 // TODO: It's not really clear what this means, but Oniguruma parses it...
12351232 // Maybe we should diagnose it?
1236- parseTest ( " (?~|)+ " , oneOrMore ( . eager , absentRangeClear ( ) ) )
1233+ parseTest ( " (?~|)+ " , oneOrMore ( of : absentRangeClear ( ) ) )
12371234
12381235 // MARK: Global matching options
12391236
@@ -1372,19 +1369,19 @@ extension RegexTests {
13721369 " (?x)a * " ,
13731370 changeMatchingOptions (
13741371 matchingOptions ( adding: . extended) , isIsolated: true ,
1375- zeroOrMore ( . eager , " a " ) )
1372+ zeroOrMore ( of : " a " ) )
13761373 )
13771374 parseTest (
13781375 " (?x)a + ? " ,
13791376 changeMatchingOptions (
13801377 matchingOptions ( adding: . extended) , isIsolated: true ,
1381- oneOrMore ( . reluctant, " a " ) )
1378+ oneOrMore ( . reluctant, of : " a " ) )
13821379 )
13831380 parseTest (
13841381 " (?x)a {2,4} " ,
13851382 changeMatchingOptions (
13861383 matchingOptions ( adding: . extended) , isIsolated: true ,
1387- quantRange ( . eager , 2 ... 4 , " a " ) )
1384+ quantRange ( 2 ... 4 , of : " a " ) )
13881385 )
13891386
13901387 // PCRE states that whitespace won't be ignored within a range.
@@ -1424,7 +1421,7 @@ extension RegexTests {
14241421
14251422 // Non-semantic whitespace between quantifier characters for consistency
14261423 // with PCRE.
1427- parseWithDelimitersTest ( " '|a * ?|' " , zeroOrMore ( . reluctant, " a " ) )
1424+ parseWithDelimitersTest ( " '|a * ?|' " , zeroOrMore ( . reluctant, of : " a " ) )
14281425
14291426 // End-of-line comments aren't enabled by default in experimental syntax.
14301427 parseWithDelimitersTest ( " '|#abc|' " , concat ( " # " , " a " , " b " , " c " ) )
0 commit comments