PCRE2Project / pcre2

PCRE2 development is now based here.
Other
921 stars 194 forks source link

Rename cond ref to capture ref #457

Closed zherczeg closed 2 months ago

zherczeg commented 2 months ago

I promised this renaming.

zherczeg commented 2 months ago

Btw there is no dnref in any of the test outputs.

zherczeg commented 2 months ago

Where? It uses the OP_NAME_LIST from the internal header. The arguments are not changed.

PhilipHazel commented 2 months ago

I think he means the phrase "cond ref" in the output should be "capture ref".

zherczeg commented 2 months ago

Which output? I am sorry I cannot follow.

carenas commented 2 months ago

Sorry; I updated my original comment so it is less vague.

I also think it might be worth adding some tests that exercise it:

diff --git a/testdata/testinput2 b/testdata/testinput2
index 9c59bb5..1324b4b 100644
--- a/testdata/testinput2
+++ b/testdata/testinput2
@@ -2862,6 +2862,13 @@
     b"11111
     a"11111

+/(?:a(?<digit>[0-5])|b(?<digit>[4-7]))c(?(<digit>)d|e)/B,dupnames
+    a4cd
+    b4cd
+\= Expect no match
+    a6cd
+    a6ce
+
 /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/IBx,dupnames
     abcdX
     eX
zherczeg commented 2 months ago

Thank you for the explanation. I have updated the patch.