[Pcre-svn] [370] code/trunk: Implement comment lines in subj…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [370] code/trunk: Implement comment lines in subject strings in pcre2test (and perltest.sh) input files.
Revision: 370
          http://www.exim.org/viewvc/pcre2?view=rev&revision=370
Author:   ph10
Date:     2015-09-14 16:10:19 +0100 (Mon, 14 Sep 2015)
Log Message:
-----------
Implement comment lines in subject strings in pcre2test (and perltest.sh) input files.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/doc/pcre2test.1
    code/trunk/perltest.sh
    code/trunk/src/pcre2test.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2015-09-12 18:12:01 UTC (rev 369)
+++ code/trunk/ChangeLog    2015-09-14 15:10:19 UTC (rev 370)
@@ -184,7 +184,10 @@
 size 16" errors because these are false positives when the hardware supports
 the SSE2 instruction set.


+52. It is now possible to have comment lines amid the subject strings in
+pcre2test (and perltest.sh) input.

+
Version 10.20 30-June-2015
--------------------------


Modified: code/trunk/doc/pcre2test.1
===================================================================
--- code/trunk/doc/pcre2test.1    2015-09-12 18:12:01 UTC (rev 369)
+++ code/trunk/doc/pcre2test.1    2015-09-14 15:10:19 UTC (rev 370)
@@ -1,4 +1,4 @@
-.TH PCRE2TEST 1 "12 September 2015" "PCRE 10.21"
+.TH PCRE2TEST 1 "14 September 2015" "PCRE 10.21"
 .SH NAME
 pcre2test - a program for testing Perl-compatible regular expressions.
 .SH SYNOPSIS
@@ -443,6 +443,12 @@
 .sp
   abc\e=notbol,notempty
 .sp
+If the subject string is empty and \e= is followed by whitespace, the line is 
+treated as a comment line, and is not used for matching. For example:
+.sp
+  \e= This is a comment.
+  abc\e= This is an invalid modifier list.
+.sp    
 A backslash followed by any other non-alphanumeric character just escapes that
 character. A backslash followed by anything else causes an error. However, if
 the very last character in the line is a backslash (and there is no modifier
@@ -654,9 +660,9 @@
 to \fBpcre2_match()\fP with either the PCRE2_PARTIAL_SOFT or the
 PCRE2_PARTIAL_HARD option set. Note that such a call may return a complete
 match; the options enable the possibility of a partial match, but do not
-require it. Note also that if you request JIT compilation only for partial 
-matching (for example, /jit=2) but do not set the \fBpartial\fP modifier on a 
-subject line, that match will not use JIT code because none was compiled for 
+require it. Note also that if you request JIT compilation only for partial
+matching (for example, /jit=2) but do not set the \fBpartial\fP modifier on a
+subject line, that match will not use JIT code because none was compiled for
 non-partial matching.
 .P
 If JIT compilation is successful, the compiled JIT code will automatically be
@@ -1519,6 +1525,6 @@
 .rs
 .sp
 .nf
-Last updated: 12 September 2015
+Last updated: 14 September 2015
 Copyright (c) 1997-2015 University of Cambridge.
 .fi


Modified: code/trunk/perltest.sh
===================================================================
--- code/trunk/perltest.sh    2015-09-12 18:12:01 UTC (rev 369)
+++ code/trunk/perltest.sh    2015-09-14 15:10:19 UTC (rev 370)
@@ -210,6 +210,8 @@
     s/^\s+//;  # Remove leading space


     last if ($_ eq "");
+    next if $_ =~ /^\\=(?:\s|$)/;   # Comment line
+ 
     $x = eval "\"$_\"";   # To get escapes processed


     # Empty array for holding results, ensure $REGERROR and $REGMARK are


Modified: code/trunk/src/pcre2test.c
===================================================================
--- code/trunk/src/pcre2test.c    2015-09-12 18:12:01 UTC (rev 369)
+++ code/trunk/src/pcre2test.c    2015-09-14 15:10:19 UTC (rev 370)
@@ -6975,7 +6975,8 @@
       skipping = FALSE;
       setlocale(LC_CTYPE, "C");
       }
-    else if (!skipping) rc = process_data();
+    else if (!skipping && !(p[0] == '\\' && p[1] == '=' && isspace(p[2]))) 
+      rc = process_data();
     }


/* We do not have a pattern set up for testing. Lines starting with # are