Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83498 - in branches/release: boost boost/regex boost/regex/v4 libs/regex libs/regex/doc libs/regex/doc/html libs/regex/doc/html/boost_regex/syntax libs/regex/test/regress
From: john_at_[hidden]
Date: 2013-03-19 14:48:25


Author: johnmaddock
Date: 2013-03-19 14:48:24 EDT (Tue, 19 Mar 2013)
New Revision: 83498
URL: http://svn.boost.org/trac/boost/changeset/83498

Log:
Merge minor fixes from Trunk.
Properties modified:
   branches/release/boost/cregex.hpp (props changed)
   branches/release/boost/regex/ (props changed)
   branches/release/boost/regex.hpp (props changed)
   branches/release/libs/regex/ (props changed)
Text files modified:
   branches/release/boost/regex/v4/basic_regex_parser.hpp | 2 +-
   branches/release/boost/regex/v4/perl_matcher_common.hpp | 6 ++++++
   branches/release/boost/regex/v4/regex_traits_defaults.hpp | 34 +++++++++++++++++-----------------
   branches/release/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html | 14 ++++++++------
   branches/release/libs/regex/doc/html/index.html | 2 +-
   branches/release/libs/regex/doc/syntax_perl.qbk | 6 +++---
   branches/release/libs/regex/test/regress/basic_tests.cpp | 11 +++++++++++
   7 files changed, 47 insertions(+), 28 deletions(-)

Modified: branches/release/boost/regex/v4/basic_regex_parser.hpp
==============================================================================
--- branches/release/boost/regex/v4/basic_regex_parser.hpp (original)
+++ branches/release/boost/regex/v4/basic_regex_parser.hpp 2013-03-19 14:48:24 EDT (Tue, 19 Mar 2013)
@@ -1107,7 +1107,7 @@
       }
       // get the value if any:
       v = this->m_traits.toi(m_position, m_end, 10);
- max = (v >= 0) ? v : (std::numeric_limits<std::size_t>::max)();
+ max = (v >= 0) ? (std::size_t)v : (std::numeric_limits<std::size_t>::max)();
    }
    else
    {

Modified: branches/release/boost/regex/v4/perl_matcher_common.hpp
==============================================================================
--- branches/release/boost/regex/v4/perl_matcher_common.hpp (original)
+++ branches/release/boost/regex/v4/perl_matcher_common.hpp 2013-03-19 14:48:24 EDT (Tue, 19 Mar 2013)
@@ -65,6 +65,8 @@
          m_match_flags |= match_perl;
       else if((re_f & (regbase::main_option_type|regbase::emacs_ex)) == (regbase::basic_syntax_group|regbase::emacs_ex))
          m_match_flags |= match_perl;
+ else if((re_f & (regbase::main_option_type|regbase::literal)) == (regbase::literal))
+ m_match_flags |= match_perl;
       else
          m_match_flags |= match_posix;
    }
@@ -326,6 +328,10 @@
       m_has_found_match = true;
       m_presult->set_second(last, 0, false);
       position = last;
+ if((m_match_flags & match_posix) == match_posix)
+ {
+ m_result.maybe_assign(*m_presult);
+ }
    }
 #ifdef BOOST_REGEX_MATCH_EXTRA
    if(m_has_found_match && (match_extra & m_match_flags))

Modified: branches/release/boost/regex/v4/regex_traits_defaults.hpp
==============================================================================
--- branches/release/boost/regex/v4/regex_traits_defaults.hpp (original)
+++ branches/release/boost/regex/v4/regex_traits_defaults.hpp 2013-03-19 14:48:24 EDT (Tue, 19 Mar 2013)
@@ -3,12 +3,12 @@
  * Copyright (c) 2004
  * John Maddock
  *
- * Use, modification and distribution are subject to the
- * Boost Software License, Version 1.0. (See accompanying file
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
  * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  *
  */
-
+
  /*
   * LOCATION: see http://www.boost.org for most recent version.
   * FILE regex_traits_defaults.hpp
@@ -85,7 +85,7 @@
    return false;
 }
 #if !defined(__hpux) && !defined(__WINSCW__) // can't use WCHAR_MAX/MIN in pp-directives
-#ifdef _MSC_VER
+#ifdef _MSC_VER
 template<>
 inline bool is_combining<wchar_t>(wchar_t c)
 {
@@ -115,11 +115,11 @@
 inline bool is_separator(charT c)
 {
    return BOOST_REGEX_MAKE_BOOL(
- (c == static_cast<charT>('\n'))
- || (c == static_cast<charT>('\r'))
- || (c == static_cast<charT>('\f'))
- || (static_cast<boost::uint16_t>(c) == 0x2028u)
- || (static_cast<boost::uint16_t>(c) == 0x2029u)
+ (c == static_cast<charT>('\n'))
+ || (c == static_cast<charT>('\r'))
+ || (c == static_cast<charT>('\f'))
+ || (static_cast<boost::uint16_t>(c) == 0x2028u)
+ || (static_cast<boost::uint16_t>(c) == 0x2029u)
       || (static_cast<boost::uint16_t>(c) == 0x85u));
 }
 template <>
@@ -177,7 +177,7 @@
       'x', 'd', 'i', 'g', 'i', 't',
    };
 
- static const character_pointer_range<charT> ranges[21] =
+ static const character_pointer_range<charT> ranges[21] =
    {
       {data+0, data+5,}, // alnum
       {data+5, data+10,}, // alpha
@@ -203,7 +203,7 @@
    };
    static const character_pointer_range<charT>* ranges_begin = ranges;
    static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
-
+
    character_pointer_range<charT> t = { p1, p2, };
    const character_pointer_range<charT>* p = std::lower_bound(ranges_begin, ranges_end, t);
    if((p != ranges_end) && (t == *p))
@@ -324,15 +324,15 @@
 # pragma warning(push)
 # pragma warning(disable:4309 4245)
 #endif
- static const charT e1[] = { '(', '?', '>', '\x0D', '\x0A', '?',
- '|', '[', '\x0A', '\x0B', '\x0C', '\x85', '\\', 'x', '{', '2', '0', '2', '8', '}',
+ static const charT e1[] = { '(', '?', '>', '\x0D', '\x0A', '?',
+ '|', '[', '\x0A', '\x0B', '\x0C', static_cast<unsigned char>('\x85'), '\\', 'x', '{', '2', '0', '2', '8', '}',
                 '\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' };
- static const charT e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
- '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' };
+ static const charT e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
+ '|', '[', '\x0A', '\x0B', '\x0C', static_cast<unsigned char>('\x85'), ']', ')', '\0' };
 
    charT c = static_cast<charT>(0x2029u);
    bool b = (static_cast<unsigned>(c) == 0x2029u);
-
+
    return (b ? e1 : e2);
 #ifdef BOOST_MSVC
 # pragma warning(pop)
@@ -346,7 +346,7 @@
 # pragma warning(push)
 # pragma warning(disable:4309)
 #endif
- static const char e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
+ static const char e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
       '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' };
    return e2;
 #ifdef BOOST_MSVC

Modified: branches/release/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html
==============================================================================
--- branches/release/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html (original)
+++ branches/release/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html 2013-03-19 14:48:24 EDT (Tue, 19 Mar 2013)
@@ -405,7 +405,8 @@
         characters</a>
       </h6>
 <p>
- For example =[abc]=, will match any of the characters 'a', 'b', or 'c'.
+ For example <code class="literal">[abc]</code>, will match any of the characters 'a',
+ 'b', or 'c'.
       </p>
 <h6>
 <a name="boost_regex.syntax.perl_syntax.h13"></a>
@@ -413,10 +414,11 @@
         ranges</a>
       </h6>
 <p>
- For example =[a-c]= will match any single character in the range 'a' to 'c'.
- By default, for Perl regular expressions, a character x is within the range
- y to z, if the code point of the character lies within the codepoints of
- the endpoints of the range. Alternatively, if you set the <a class="link" href="../ref/syntax_option_type/syntax_option_type_perl.html" title="Options for Perl Regular Expressions"><code class="literal">collate</code>
+ For example <code class="literal">[a-c]</code> will match any single character in the
+ range 'a' to 'c'. By default, for Perl regular expressions, a character x
+ is within the range y to z, if the code point of the character lies within
+ the codepoints of the endpoints of the range. Alternatively, if you set the
+ <a class="link" href="../ref/syntax_option_type/syntax_option_type_perl.html" title="Options for Perl Regular Expressions"><code class="literal">collate</code>
         flag</a> when constructing the regular expression, then ranges are locale
         sensitive.
       </p>
@@ -426,7 +428,7 @@
       </h6>
 <p>
         If the bracket-expression begins with the ^ character, then it matches the
- complement of the characters it contains, for example =<code class="literal">a-c</code>=
+ complement of the characters it contains, for example <code class="literal">[^a-c]</code>
         matches any character that is not in the range <code class="literal">a-c</code>.
       </p>
 <h6>

Modified: branches/release/libs/regex/doc/html/index.html
==============================================================================
--- branches/release/libs/regex/doc/html/index.html (original)
+++ branches/release/libs/regex/doc/html/index.html 2013-03-19 14:48:24 EDT (Tue, 19 Mar 2013)
@@ -198,7 +198,7 @@
   </p>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: November 29, 2012 at 10:43:51 GMT</small></p></td>
+<td align="left"><p><small>Last revised: January 31, 2013 at 17:33:20 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: branches/release/libs/regex/doc/syntax_perl.qbk
==============================================================================
--- branches/release/libs/regex/doc/syntax_perl.qbk (original)
+++ branches/release/libs/regex/doc/syntax_perl.qbk 2013-03-19 14:48:24 EDT (Tue, 19 Mar 2013)
@@ -218,11 +218,11 @@
 
 [h5 Single characters]
 
-For example =[abc]=, will match any of the characters 'a', 'b', or 'c'.
+For example [^\[abc\]], will match any of the characters 'a', 'b', or 'c'.
 
 [h5 Character ranges]
 
-For example =[a-c]= will match any single character in the range 'a' to 'c'.
+For example [^\[a-c\]] will match any single character in the range 'a' to 'c'.
 By default, for Perl regular expressions, a character x is within the
 range y to z, if the code point of the character lies within the codepoints of
 the endpoints of the range. Alternatively, if you set the
@@ -232,7 +232,7 @@
 [h5 Negation]
 
 If the bracket-expression begins with the ^ character, then it matches the
-complement of the characters it contains, for example =[^a-c]= matches
+complement of the characters it contains, for example [^\[^a-c\]] matches
 any character that is not in the range =a-c=.
 
 [h5 Character classes]

Modified: branches/release/libs/regex/test/regress/basic_tests.cpp
==============================================================================
--- branches/release/libs/regex/test/regress/basic_tests.cpp (original)
+++ branches/release/libs/regex/test/regress/basic_tests.cpp 2013-03-19 14:48:24 EDT (Tue, 19 Mar 2013)
@@ -134,6 +134,17 @@
    TEST_REGEX_SEARCH("a*?<tag>", perl, "aaa", match_default|match_partial, make_array(0, 3, -2, -2));
    TEST_REGEX_SEARCH("\\w*?<tag>", perl, "aaa", match_default|match_partial, make_array(0, 3, -2, -2));
    TEST_REGEX_SEARCH("(\\w)*?<tag>", perl, "aaa", match_default|match_partial, make_array(0, 3, -2, -2));
+
+ TEST_REGEX_SEARCH("(xyz)(.*)abc", extended, "xyzaaab", match_default|match_partial, make_array(0, 7, -2, -2));
+ TEST_REGEX_SEARCH("(xyz)(.*)abc", extended, "xyz", match_default|match_partial, make_array(0, 3, -2, -2));
+ TEST_REGEX_SEARCH("(xyz)(.*)abc", extended, "xy", match_default|match_partial, make_array(0, 2, -2, -2));
+ TEST_REGEX_SEARCH("(xyz)(.*)abc", extended, "x", match_default|match_partial, make_array(0, 1, -2, -2));
+ TEST_REGEX_SEARCH("(xyz)(.*)abc", extended, "", match_default|match_partial, make_array(-2, -2));
+ TEST_REGEX_SEARCH("(xyz)(.*)abc", extended, "aaaa", match_default|match_partial, make_array(-2, -2));
+ TEST_REGEX_SEARCH(".abc", extended, "aaab", match_default|match_partial, make_array(1, 4, -2, -2));
+ TEST_REGEX_SEARCH("a[_]", extended, "xxa", match_default|match_partial, make_array(2, 3, -2, -2));
+ TEST_REGEX_SEARCH(".{4,}", extended, "xxa", match_default|match_partial, make_array(0, 3, -2, -2));
+ TEST_REGEX_SEARCH(".{4,}", extended, "xxa", match_default|match_partial|match_not_dot_null, make_array(0, 3, -2, -2));
 }
 
 void test_nosubs()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk