/[pcre]/code/branches/pcre16/perltest.pl
ViewVC logotype

Diff of /code/branches/pcre16/perltest.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 97 by ph10, Mon Mar 5 12:36:47 2007 UTC revision 617 by ph10, Tue Jul 12 11:00:10 2011 UTC
# Line 85  for (;;) Line 85  for (;;)
85    
86    # The private /+ modifier means "print $' afterwards".    # The private /+ modifier means "print $' afterwards".
87    
88    $showrest = ($pattern =~ s/\+(?=[a-z]*$)//);    $showrest = ($pattern =~ s/\+(?=[a-zA-Z]*$)//);
89    
90      # A doubled version is used by pcretest to print remainders after captures
91    
92      $pattern =~ s/\+(?=[a-zA-Z]*$)//;
93    
94    # Remove /8 from a UTF-8 pattern.    # Remove /8 from a UTF-8 pattern.
95    
96    $utf8 = $pattern =~ s/8(?=[a-z]*$)//;    $utf8 = $pattern =~ s/8(?=[a-zA-Z]*$)//;
97    
98      # Remove /J from a pattern with duplicate names.
99    
100      $pattern =~ s/J(?=[a-zA-Z]*$)//;
101    
102      # Remove /K from a pattern (asks pcretest to check MARK data) */
103    
104      $pattern =~ s/K(?=[a-zA-Z]*$)//;
105    
106      # Remove /W from a pattern (asks pcretest to set PCRE_UCP)
107    
108      $pattern =~ s/W(?=[a-zA-Z]*$)//;
109    
110      # Remove /S or /SS from a pattern (asks pcretest to study or not to study)
111    
112      $pattern =~ s/S(?=[a-zA-Z]*$)//g;
113    
114    # Check that the pattern is valid    # Check that the pattern is valid
115    
# Line 123  for (;;) Line 143  for (;;)
143      chomp;      chomp;
144      printf $outfile "$_\n" if $infile ne "STDIN";      printf $outfile "$_\n" if $infile ne "STDIN";
145    
146      s/\s+$//;      s/\s+$//;  # Remove trailing space
147      s/^\s+//;      s/^\s+//;  # Remove leading space
148        s/\\Y//g;  # Remove \Y (pcretest flag to set PCRE_NO_START_OPTIMIZE)
149    
150      last if ($_ eq "");      last if ($_ eq "");
151      $x = eval "\"$_\"";   # To get escapes processed      $x = eval "\"$_\"";   # To get escapes processed
152    
153      # Empty array for holding results, then do the matching.      # Empty array for holding results, ensure $REGERROR and $REGMARK are
154        # unset, then do the matching.
155    
156      @subs = ();      @subs = ();
157    
# Line 152  for (;;) Line 174  for (;;)
174           "push \@subs,\$16;" .           "push \@subs,\$16;" .
175           "push \@subs,\$'; }";           "push \@subs,\$'; }";
176    
177        undef $REGERROR;
178        undef $REGMARK;
179    
180      eval "${cmd} (\$x =~ ${pattern}) {" . $pushes;      eval "${cmd} (\$x =~ ${pattern}) {" . $pushes;
181    
182      if ($@)      if ($@)
# Line 161  for (;;) Line 186  for (;;)
186        }        }
187      elsif (scalar(@subs) == 0)      elsif (scalar(@subs) == 0)
188        {        {
189        printf $outfile "No match\n";        printf $outfile "No match";
190          if (defined $REGERROR && $REGERROR != 1)
191            { print $outfile (", mark = $REGERROR"); }
192          printf $outfile "\n";
193        }        }
194      else      else
195        {        {
# Line 182  for (;;) Line 210  for (;;)
210            }            }
211          splice(@subs, 0, 18);          splice(@subs, 0, 18);
212          }          }
213          if (defined $REGMARK && $REGMARK != 1)
214            { print $outfile ("MK: $REGMARK\n"); }
215        }        }
216      }      }
217    }    }

Legend:
Removed from v.97  
changed lines
  Added in v.617

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12