Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Track recent grammar changes

Amazingly, the patch applied cleanly.
  • Loading branch information...
commit 198086c2aa499ecf33de5d9b1bd6c51acc7a3d0c 1 parent 493fbf9
@sorear authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/STD.pm6
View
11 src/STD.pm6
@@ -2423,6 +2423,7 @@ grammar P6 is STD {
# parametric type?
<.unsp>? [ <?before '['> <param=.postcircumfix> ]?
<.unsp>? [ <?before '{'> <whence=.postcircumfix> ]?
+ <.unsp>? [ <?before '('> <accept=.postcircumfix> ]?
[<.ws> 'of' <.ws> <typename> ]?
}
@@ -3320,7 +3321,7 @@ grammar P6 is STD {
[ <!{$*QSIGIL}> || <!before '"' <-["]>*? \s > ] # dwim on "$foo."
<quote>
[ <?before '(' | '.(' | '\\'> || <.obs('. to concatenate strings or to call a quoted method', '~ to concatenate, or if you meant to call a quoted method, please supply the required parentheses')> ]
- { my $t = $<quote><nibble>.Str; $t ~~ /\W/ or $t ~~ /^(WHO|WHAT|WHERE|WHEN|WHY|HOW)$/ or $¢.worry("Useless use of quotes") }
+ { my $t = $<quote><nibble>.Str; $t ~~ /\W/ or $t eq '' or $t ~~ /^(WHO|WHAT|WHERE|WHEN|WHY|HOW)$/ or $¢.worry("Useless use of quotes") }
] <.unsp>?
:dba('method arguments')
@@ -4714,11 +4715,15 @@ grammar Regex is STD {
<!stopper>
<!regex_infix>
<atom>
- [ <normspace>? <quantifier> ]?
+ [ <normspace>? <quantifier> <normspace>? <separator>? ]?
# <?{ $<atom>.max_width }>
# || <.panic: "Cannot quantify zero-width atom">
}
+ token separator {
+ '%''%'? <normspace>? <quantified_atom>
+ }
+
token atom {
:dba('regex atom')
[
@@ -5002,7 +5007,7 @@ grammar Regex is STD {
| \d+ \s+ '..' <.panic: "Spaces not allowed in bare range">
| (\d+) [ '..' [ (\d+) { $¢.panic("Empty range") if $0.Str > $1[0].Str } | '*' | <.panic: "Malformed range"> ] ]?
| <embeddedblock>
- | <quantified_atom>
+ | <quantified_atom> <.worryobs("atom ** " ~ $<quantified_atom>.Str ~ " as separator", "atom+ % " ~ $<quantified_atom>.Str, "nowadays")>
]
}
Please sign in to comment.
Something went wrong with that request. Please try again.