[Pcre-svn] [973] code/trunk/perltest.sh: Allow for #pattern …

Page principale
Supprimer ce message
Auteur: Subversion repository
Date:  
À: pcre-svn
Sujet: [Pcre-svn] [973] code/trunk/perltest.sh: Allow for #pattern -no_start_optimize in perltest script.
Revision: 973
          http://www.exim.org/viewvc/pcre2?view=rev&revision=973
Author:   ph10
Date:     2018-07-27 17:42:25 +0100 (Fri, 27 Jul 2018)
Log Message:
-----------
Allow for #pattern -no_start_optimize in perltest script.


Modified Paths:
--------------
    code/trunk/perltest.sh


Modified: code/trunk/perltest.sh
===================================================================
--- code/trunk/perltest.sh    2018-07-27 16:30:40 UTC (rev 972)
+++ code/trunk/perltest.sh    2018-07-27 16:42:25 UTC (rev 973)
@@ -46,6 +46,7 @@
 #   mark               show mark information
 #   no_auto_possess    ignored
 #   no_start_optimize  insert (??{""}) at pattern start (disables optimizing)
+#  -no_start_optimize  ignored
 #   subject_literal    does not process subjects for escapes
 #   ucp                sets Perl's /u modifier
 #   utf                invoke UTF-8 functionality
@@ -231,8 +232,10 @@
   $mod =~ s/no_auto_possess,?//;


# Use no_start_optimize (disable PCRE2 start-up optimization) to disable Perl
- # optimization by inserting (??{""}) at the start of the pattern.
-
+ # optimization by inserting (??{""}) at the start of the pattern. We may
+ # also encounter -no_start_optimize from a #pattern setting.
+
+ $mod =~ s/-no_start_optimize,?//;
if ($mod =~ s/no_start_optimize,?//) { $pat =~ s/$del/$del(??{""})/; }

# Add back retained modifiers and check that the pattern is valid.