Skip to content

Commit

Permalink
Merge pull request #990 from MasterDuke17
Browse files Browse the repository at this point in the history
Handle all Nd digits in regex backslash errors
  • Loading branch information
samcv committed Jan 6, 2017
2 parents dd5759b + 161d7a0 commit 964b28b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -5208,7 +5208,12 @@ grammar Perl6::RegexGrammar is QRegex::P6Regex::Grammar does STD does CursorPack

token metachar:sym<{}> { \\<[xo]>'{' <.obsbrace> }

token backslash:sym<1> { <[1..9]>\d* {} <.sorry("Unrecognized backslash sequence (did you mean \${$/ - 1}?)")> }
token backslash:sym<1> {
<.[\d] - [0]>\d*
{}
:my int $br := nqp::radix(10, $/, 0, 0)[0];
<.sorry("Unrecognized backslash sequence (did you mean \${$br == 0 ?? $br !! $br - 1}?)")>
}

token assertion:sym<{ }> {
<?[{]> <codeblock>
Expand Down

0 comments on commit 964b28b

Please sign in to comment.