New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use re 'debug' ignored for uniprop embedded regexps #17026
Comments
From @tonycozCreated by @tonycozuse re 'debug' doesn't enable debug output for regexps embedded in $ ./perl -Ilib -Mre=debug -e 'qr!\p{numeric_value=/\A[0-5]\z/}!' But -Dr does produce such output: $ ./perl -Ilib -Dr -e 'qr!\p{numeric_value=/\A[0-5]\z/}!' 2>&1 | head -15 which doesn't match the documentation. It also means that a user with only a non-DEBUGGING perl (as is I mentioned this to Karl who suggested a ticket for further Patch with fix attached. Perl Info
|
From @tonycoz0001-allow-use-re-debug-to-work-on-p-embedded-regexps.patchFrom f996d1d38beb139cf8f0d00a989a4bd3ca73b7af Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Thu, 30 May 2019 14:24:28 +1000
Subject: allow use re 'debug' to work on \p{} embedded regexps
---
regcomp.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/regcomp.c b/regcomp.c
index 36f5afff71..677e5b8049 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -22759,7 +22759,7 @@ Perl_parse_uniprop_string(pTHX_
(unsigned) subpattern_len,
name + i);
subpattern = sv_2mortal(subpattern);
- subpattern_re = re_compile(subpattern, 0);
+ subpattern_re = pregcomp(subpattern, 0);
assert(subpattern_re); /* Should have died if didn't compile
successfully */
@@ -22770,12 +22770,13 @@ Perl_parse_uniprop_string(pTHX_
const Size_t len = strlen(entry);
SV* entry_sv = newSVpvn_flags(entry, len, SVs_TEMP);
- if (pregexec(subpattern_re,
- (char *) entry,
- (char *) entry + len,
- (char *) entry, 0,
- entry_sv,
- 0))
+ if (CALLREGEXEC(subpattern_re,
+ (char *) entry,
+ (char *) entry + len,
+ (char *) entry, 0,
+ entry_sv,
+ NULL,
+ 0))
{ /* Here, matched. Add to the returned list */
Size_t total_len = j + len;
SV * sub_invlist = NULL;
--
2.11.0
|
This fixes #17026 Patterns can now have subpatterns. Prior to this commit debugging info was only available under DEBUGGING builds with -Drv. This commit adds a new keyword, WILDCARD, that use re qw(Debug ...) can use so that whatever other debugging options have been turned on will show up when a wildcard subpattern is compiled. The output of this may be voluminous, which is why you have to ask for it specifically. Or, the EXTRA option turns it on with several other things.
This fixes #17026 Patterns can now have subpatterns, called wildcards by Unicode. Prior to this commit debugging info was only available under DEBUGGING builds with -Drv. This commit adds a new keyword, WILDCARD for 'use re qw(Debug ...)' so that whatever other debugging options have been turned on will show up when a wildcard subpattern is compiled. The output of this may be voluminous, which is why you have to ask for it specifically. Or, the EXTRA option turns it on along with several other things.
This fixes #17026 Patterns can have subpatterns since 5.30. These are processed when encountered, by suspending the main pattern compilation, compiling the subpattern, and then matching that against the set of all legal possibilities, which Perl knows about. Prior to this commit, debugging info was not available for that matching portion of the compilation, except under DEBUGGING builds, with -Drv. This commit adds a new option to 'use re qw(Debug ...)', WILDCARD, to enable subpattern match debugging. Whatever other match debugging options have been turned on will show up when a wildcard subpattern is compiled iff WILDCARD is specified. The output of this may be voluminous, which is why you have to ask for it specifically. Or, the EXTRA option turns it on, along with several other things.
This fixes #17026 Patterns can have subpatterns since 5.30. These are processed when encountered, by suspending the main pattern compilation, compiling the subpattern, and then matching that against the set of all legal possibilities, which Perl knows about. Prior to this commit, debugging info was not available for that matching portion of the compilation, except under DEBUGGING builds, with -Drv. This commit adds a new option to 'use re qw(Debug ...)', WILDCARD, to enable subpattern match debugging. Whatever other match debugging options have been turned on will show up when a wildcard subpattern is compiled iff WILDCARD is specified. The output of this may be voluminous, which is why you have to ask for it specifically. Or, the EXTRA option turns it on, along with several other things.
Migrated from rt.perl.org#134150 (status was 'new')
Searchable as RT134150$
The text was updated successfully, but these errors were encountered: