diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2017-06-12 17:48:03 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2017-06-12 17:48:03 +0000 |
commit | 6789fe34b24cc6f93f0f4f8627e8ca5df9c9d054 (patch) | |
tree | 1aeb132613cb22c3bcb148304b22057765efeca6 /perltest.sh | |
parent | 04a3d3bc4012f747f077829a461ab677c94ee23f (diff) | |
download | pcre2-6789fe34b24cc6f93f0f4f8627e8ca5df9c9d054.tar.gz |
Add subject_literal and allow jitstack in pcre2test pattern modifiers, and add
another big pattern test.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@823 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'perltest.sh')
-rwxr-xr-x | perltest.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/perltest.sh b/perltest.sh index 50c70e5..806a888 100755 --- a/perltest.sh +++ b/perltest.sh @@ -42,13 +42,16 @@ fi # aftertext interpreted as "print $' afterwards" # afteralltext ignored # dupnames ignored (Perl always allows) +# jitstack ignored # mark ignored # no_auto_possess ignored # no_start_optimize ignored +# subject_literal does not process subjects for escapes # ucp sets Perl's /u modifier # utf invoke UTF-8 functionality # -# The data lines must not have any pcre2test modifiers. They are processed as +# The data lines must not have any pcre2test modifiers. Unless +# "subject_litersl" is on the pattern, data lines are processed as # Perl double-quoted strings, so if they contain " $ or @ characters, these # have to be escaped. For this reason, all such characters in the # Perl-compatible testinput1 and testinput4 files are escaped so that they can @@ -138,16 +141,20 @@ for (;;) chomp($pattern); $pattern =~ s/\s+$//; - + # Split the pattern from the modifiers and adjust them as necessary. $pattern =~ /^\s*((.).*\2)(.*)$/s; $pat = $1; $mod = $3; - + # The private "aftertext" modifier means "print $' afterwards". $showrest = ($mod =~ s/aftertext,?//); + + # The "subject_literal" modifer disables escapes in subjects. + + $subject_literal = ($mod =~ s/subject_literal,?//); # "allaftertext" is used by pcre2test to print remainders after captures @@ -161,6 +168,10 @@ for (;;) $mod =~ s/dupnames,?//; + # Remove "jitstack". + + $mod =~ s/jitstack=\d+,?//; + # Remove "mark" (asks pcre2test to check MARK data) */ $mod =~ s/mark,?//; @@ -222,7 +233,14 @@ for (;;) last if ($_ eq ""); next if $_ =~ /^\\=(?:\s|$)/; # Comment line - $x = eval "\"$_\""; # To get escapes processed + if ($subject_literal) + { + $x = $_; + } + else + { + $x = eval "\"$_\""; # To get escapes processed + } # Empty array for holding results, ensure $REGERROR and $REGMARK are # unset, then do the matching. |