[Pcre-svn] [635] code/trunk: Document and comment tidies.

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [635] code/trunk: Document and comment tidies.
Revision: 635
          http://vcs.pcre.org/viewvc?view=rev&revision=635
Author:   ph10
Date:     2011-07-23 17:19:50 +0100 (Sat, 23 Jul 2011)


Log Message:
-----------
Document and comment tidies.

Modified Paths:
--------------
    code/trunk/doc/pcrecompat.3
    code/trunk/pcre_compile.c


Modified: code/trunk/doc/pcrecompat.3
===================================================================
--- code/trunk/doc/pcrecompat.3    2011-07-23 15:37:07 UTC (rev 634)
+++ code/trunk/doc/pcrecompat.3    2011-07-23 16:19:50 UTC (rev 635)
@@ -109,8 +109,10 @@
 names map to capturing subpattern number 1. To avoid this confusing situation,
 an error is given at compile time.
 .P
-13. Perl recognizes comments in some places that PCRE doesn't, for example,
-between the ( and ? at the start of a subpattern.
+13. Perl recognizes comments in some places that PCRE does not, for example,
+between the ( and ? at the start of a subpattern. If the /x modifier is set, 
+Perl allows whitespace between ( and ? but PCRE never does, even if the 
+PCRE_EXTENDED option is set.
 .P
 14. PCRE provides some extensions to the Perl regular expression facilities.
 Perl 5.10 includes new features that are not in earlier versions of Perl, some


Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2011-07-23 15:37:07 UTC (rev 634)
+++ code/trunk/pcre_compile.c    2011-07-23 16:19:50 UTC (rev 635)
@@ -3039,7 +3039,7 @@
 int firstbyte, reqbyte;
 int zeroreqbyte, zerofirstbyte;
 int req_caseopt, reqvary, tempreqvary;
-int options = *optionsptr;
+int options = *optionsptr;               /* May change dynamically */
 int after_manual_callout = 0;
 int length_prevgroup = 0;
 register int c;
@@ -3057,6 +3057,10 @@
 uschar *save_hwm = NULL;
 uschar classbits[32];


+/* We can fish out the UTF-8 setting once and for all into a BOOL, but we
+must not do this for other options (e.g. PCRE_EXTENDED) because they may change 
+dynamically as we process the pattern. */
+
 #ifdef SUPPORT_UTF8
 BOOL class_utf8;
 BOOL utf8 = (options & PCRE_UTF8) != 0;
@@ -3237,7 +3241,7 @@
     previous_callout = NULL;
     }


- /* In extended mode, skip white space and comments */
+ /* In extended mode, skip white space and comments. */

   if ((options & PCRE_EXTENDED) != 0)
     {
@@ -5572,7 +5576,7 @@


           temp = cd->end_pattern;
           cd->end_pattern = ptr;
-          recno = find_parens(cd, name, namelen,
+          recno = find_parens(cd, name, namelen, 
             (options & PCRE_EXTENDED) != 0, utf8);
           cd->end_pattern = temp;
           if (recno < 0) recno = 0;    /* Forward ref; set dummy number */