Skip to content

Commit

Permalink
Handle Nd's as a backreference
Browse files Browse the repository at this point in the history
So perl6 -e 'say "abca" ~~ /(a)(b)(c)$٠/' now matches.
  • Loading branch information
MasterDuke17 committed Jan 6, 2017
1 parent 97d9ad2 commit 7084d5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/QRegex/P5Regex/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ class QRegex::P5Regex::Actions is HLL::Actions {

method metachar:sym<var>($/) {
my $qast;
my $name := $<pos> ?? +$<pos> !! ~$<name>;
my $name := $<pos> ?? nqp::radix(10, $<pos>, 0, 0)[0] !! ~$<name>;
if $<quantified_atom> {
$qast := $<quantified_atom>[0].ast;
if $qast.rxtype eq 'quant' && $qast[0].rxtype eq 'subrule' {
Expand Down
2 changes: 1 addition & 1 deletion src/QRegex/P6Regex/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class QRegex::P6Regex::Actions is HLL::Actions {

method metachar:sym<var>($/) {
my $qast;
my $name := $<pos> ?? +$<pos> !! ~$<name>;
my $name := $<pos> ?? nqp::radix(10, $<pos>, 0, 0)[0] !! ~$<name>;
if $<quantified_atom> {
$qast := $<quantified_atom>[0].ast;
if ($qast.rxtype eq 'quant' || $qast.rxtype eq 'dynquant') && $qast[0].rxtype eq 'subrule' {
Expand Down

0 comments on commit 7084d5a

Please sign in to comment.