Update RE2 to the latest version which builds on Mac OS X 10.9

Some minor modifications to the patches we apply to RE2.
In particular, one of our patches (adding settable dot_nl to the regexp)
is now in the trunk version, so we no longer need to do that.

test/regexp passes after this change.

Index: unpack-re2.sh
===================================================================
--- unpack-re2.sh       (revision 22542)
+++ unpack-re2.sh       (working copy)
@@ -8,7 +8,7 @@
  else
  
  echo Unpacking RE2
-tar xzf re2-20130802.tgz
+tar xzf re2-20140111.tgz
  echo Applying Patches
  cd re2
  patch -p1 < ../hg_diff_g.patch
Index: re2-20140111.tgz
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: re2-20140111.tgz
___________________________________________________________________
Added: svn:mime-type
    + application/octet-stream

Index: re2-20130802.tgz
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: hg_diff_g.patch
===================================================================
--- hg_diff_g.patch     (revision 22542)
+++ hg_diff_g.patch     (working copy)
@@ -2,10 +2,10 @@
  --- a/Makefile
  +++ b/Makefile
  @@ -17,6 +17,7 @@
- ARFLAGS=rsc
- NM=nm
- NMFLAGS=-p
-+NODEBUG=-DNDEBUG
+ ARFLAGS?=rsc
+ NM?=nm
+ NMFLAGS?=-p
++NODEBUG?=-DNDEBUG
   
   # Variables mandated by GNU, the arbiter of all good taste on the internet.
   # http://www.gnu.org/prep/standards/standards.html
@@ -716,8 +716,8 @@
  +uint32 Prog::EmptyFlags<FilePiece>(const FilePiece& text, 
FilePiece::ptr_rd_type p);
  +
   void Prog::MarkByteRange(int lo, int hi) {
-   CHECK_GE(lo, 0);
-   CHECK_GE(hi, 0);
+   DCHECK_GE(lo, 0);
+   DCHECK_GE(hi, 0);
  diff --git a/re2/prog.h b/re2/prog.h
  --- a/re2/prog.h
  +++ b/re2/prog.h
@@ -762,17 +762,7 @@
  diff --git a/re2/re2.cc b/re2/re2.cc
  --- a/re2/re2.cc
  +++ b/re2/re2.cc
-@@ -151,6 +151,9 @@
-   if (never_nl())
-     flags |= Regexp::NeverNL;
-
-+  if (dot_nl())
-+    flags |= Regexp::DotNL;
-+
-   if (never_capture())
-     flags |= Regexp::NeverCapture;
-
-@@ -183,6 +186,8 @@
+@@ -188,6 +188,8 @@
     named_groups_ = NULL;
     group_names_ = NULL;
     num_captures_ = -1;
@@ -781,7 +771,7 @@
   
     RegexpStatus status;
     entire_regexp_ = Regexp::Parse(
-@@ -209,6 +214,8 @@
+@@ -214,6 +216,8 @@
     else
       suffix_regexp_ = entire_regexp_->Incref();
   
@@ -790,7 +780,7 @@
     // Two thirds of the memory goes to the forward Prog,
     // one third to the reverse prog, because the forward
     // Prog has two DFAs but the reverse prog has one.
-@@ -505,8 +512,9 @@
+@@ -510,8 +514,9 @@
   
   // Avoid possible locale nonsense in standard strcasecmp.
   // The string a is known to be all lowercase.
@@ -802,7 +792,7 @@
   
     for (; a < ae; a++, b++) {
       uint8 x = *a;
-@@ -779,6 +787,142 @@
+@@ -784,6 +789,142 @@
     return true;
   }
   
@@ -948,7 +938,7 @@
  diff --git a/re2/re2.h b/re2/re2.h
  --- a/re2/re2.h
  +++ b/re2/re2.h
-@@ -295,6 +295,13 @@
+@@ -298,6 +298,13 @@
     // to know about prefix_ and prefix_foldcase_.
     re2::Regexp* Regexp() const { return entire_regexp_; }
   
@@ -962,7 +952,7 @@
     /***** The useful part: the matching interface *****/
   
     // Matches "text" against "pattern".  If pointer arguments are
-@@ -476,6 +483,22 @@
+@@ -479,6 +486,22 @@
                StringPiece *match,
                int nmatch) const;
   
@@ -985,51 +975,7 @@
     // Check that the given rewrite string is suitable for use with this
     // regular expression.  It checks that:
     //   * The regular expression has enough parenthesized subexpressions
-@@ -512,6 +535,7 @@
-     //   max_mem          (see below)  approx. max memory footprint of RE2
-     //   literal          (false) interpret string as literal, not regexp
-     //   never_nl         (false) never match \n, even if it is in regexp
-+    //   dot_nl           (false) . also matches \n (same as ?s)
-     //   never_capture    (false) parse all parens as non-capturing
-     //   case_sensitive   (true)  match is case-sensitive (regexp can override
-     //                              with (?i) unless in posix_syntax mode)
-@@ -571,7 +595,8 @@
-       case_sensitive_(true),
-       perl_classes_(false),
-       word_boundary_(false),
--      one_line_(false) {
-+      one_line_(false),
-+      dot_nl_(false) {
-     }
-
-     /*implicit*/ Options(CannedOptions);
-@@ -608,6 +633,9 @@
-     bool never_nl() const { return never_nl_; }
-     void set_never_nl(bool b) { never_nl_ = b; }
-
-+    bool dot_nl() const { return dot_nl_; }
-+    void set_dot_nl(bool b) { dot_nl_ = b; }
-+
-     bool never_capture() const { return never_capture_; }
-     void set_never_capture(bool b) { never_capture_ = b; }
-
-@@ -636,6 +664,7 @@
-       perl_classes_ = src.perl_classes_;
-       word_boundary_ = src.word_boundary_;
-       one_line_ = src.one_line_;
-+      dot_nl_ = src.dot_nl_;
-     }
-
-     int ParseFlags() const;
-@@ -653,6 +682,7 @@
-     bool perl_classes_;
-     bool word_boundary_;
-     bool one_line_;
-+    bool dot_nl_;
-
-     //DISALLOW_EVIL_CONSTRUCTORS(Options);
-     Options(const Options&);
-@@ -723,6 +753,9 @@
+@@ -739,6 +762,9 @@
     // Map from capture indices to names
     mutable const map<int, string>* group_names_;

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to