Skip to content

Commit c22b2ee

Browse files
committed
first step to +% transition, deprecate ** sep
and also take a whack at parsing the +% form
1 parent bb4f150 commit c22b2ee

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

STD.pm6

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4826,11 +4826,15 @@ grammar Regex is STD {
48264826
<!stopper>
48274827
<!regex_infix>
48284828
<atom>
4829-
[ <normspace>? <quantifier> ]?
4829+
[ <normspace>? <quantifier> <normspace>? <separator>? ]?
48304830
# <?{ $<atom>.max_width }>
48314831
# || <.panic: "Cannot quantify zero-width atom">
48324832
}
48334833

4834+
token separator {
4835+
'%' <normspace>? <quantified_atom>
4836+
}
4837+
48344838
token atom {
48354839
:dba('regex atom')
48364840
[
@@ -5151,7 +5155,7 @@ grammar Regex is STD {
51515155
| \d+ \s+ '..' <.panic: "Spaces not allowed in bare range">
51525156
| (\d+) [ '..' [ (\d+) {.panic("Empty range") if $0.Str > $1[0].Str } | '*' | <.panic: "Malformed range"> ] ]?
51535157
| <embeddedblock>
5154-
| <quantified_atom>
5158+
| <quantified_atom> <.worryobs("atom ** " ~ $<quantified_atom>.Str ~ " as separator", "atom+ % " ~ $<quantified_atom>.Str, "nowadays")>
51555159
]
51565160
}
51575161

0 commit comments

Comments
 (0)