diff options
author | Yves Orton <demerphq@gmail.com> | 2023-03-08 12:59:18 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-03-08 21:56:48 +0800 |
commit | e792c028462d5d3771e15dff0293056e2eab3af6 (patch) | |
tree | 452a7d9c38021d7dd01c3db4f3edd20aee755639 /t | |
parent | 067d2df440e3814f94fc68e4b8920522362283e8 (diff) | |
download | perl-e792c028462d5d3771e15dff0293056e2eab3af6.tar.gz |
mg.c - fix $+ combined with branch reset
I missed that $+ needs to do the parno_to_logical lookup.
We had tests for $^N, but not $+. This also fixes the code
for $^N to only do the lookup when the paren is not 0.
Fixes #20912
Diffstat (limited to 't')
-rw-r--r-- | t/re/re_tests | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/re/re_tests b/t/re/re_tests index e961fcae17..2afc639313 100644 --- a/t/re/re_tests +++ b/t/re/re_tests @@ -2126,6 +2126,14 @@ AB\s+\x{100} AB \x{100}X y - - ((?|(?<a>a)(?-1)|(?<b>b)(?-1)|(?<c>c)(?-1))) aa y $1 aa # GH 20653 ((?|(?<a>a)(?-1)|(?<b>b)(?-1)|(?<c>c)(?-1))) bb y $1 bb # GH 20653 ((?|(?<a>a)(?-1)|(?<b>b)(?-1)|(?<c>c)(?-1))) cc y $1 cc # GH 20653 +(?|(a)|(b)) b y $+ b # GH 20912 +(?|(a)(?{$::plus_got=$+})|(b)(?{$::plus_got=$+})) b y $::plus_got b # GH 20912 +(?|(a)|(b)) b y $^N b # GH 20912 +(?|(a)(?{$::caret_n_got=$^N})|(b)(?{$::caret_n_got=$^N})) b y $::caret_n_got b # GH 20912 +(?|(a)|(b)) a y $+ a # GH 20912 +(?|(a)(?{$::plus_got=$+})|(b)(?{$::plus_got=$+})) a y $::plus_got a # GH 20912 +(?|(a)|(b)) a y $^N a # GH 20912 +(?|(a)(?{$::caret_n_got=$^N})|(b)(?{$::caret_n_got=$^N})) a y $::caret_n_got a # GH 20912 # Keep these lines at the end of the file # pat string y/n/etc expr expected-expr skip-reason comment # vim: softtabstop=0 noexpandtab |