Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57371 - in branches/release: . boost boost/algorithm/string boost/archive boost/config boost/filesystem boost/fusion boost/graph boost/interprocess boost/intrusive boost/iostreams boost/math boost/numeric/ublas boost/program_options boost/property_tree boost/python boost/regex boost/serialization boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/qi/nonterminal boost/spirit/home/qi/numeric/detail boost/spirit/home/support boost/spirit/repository/home/qi/nonterminal boost/system boost/thread boost/tr1 boost/type_traits boost/utility boost/wave boost/xpressive libs libs/config libs/filesystem libs/fusion libs/graph_parallel libs/interprocess libs/intrusive libs/iostreams libs/math libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/numeric/ublas libs/numeric/ublas/doc libs/program_options libs/property_tree libs/python libs/regex libs/serialization libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/doc/html/spirit/abstracts/customize libs/spirit/doc/html/spirit/abstracts/indepth libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/system libs/thread libs/timer libs/tr1 libs/type_traits libs/utility libs/wave status tools/boostbook tools/quickbook tools/regression tools/release tools/wave
From: eric_at_[hidden]
Date: 2009-11-04 13:05:07


Author: eric_niebler
Date: 2009-11-04 13:05:06 EST (Wed, 04 Nov 2009)
New Revision: 57371
URL: http://svn.boost.org/trac/boost/changeset/57371

Log:
small, safe fixes for xpressive
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/algorithm/string/ (props changed)
   branches/release/boost/archive/ (props changed)
   branches/release/boost/config/ (props changed)
   branches/release/boost/filesystem/ (props changed)
   branches/release/boost/fusion/ (props changed)
   branches/release/boost/graph/ (props changed)
   branches/release/boost/interprocess/ (props changed)
   branches/release/boost/intrusive/ (props changed)
   branches/release/boost/iostreams/ (props changed)
   branches/release/boost/math/ (props changed)
   branches/release/boost/numeric/ublas/ (props changed)
   branches/release/boost/program_options/ (props changed)
   branches/release/boost/property_tree/ (props changed)
   branches/release/boost/python/ (props changed)
   branches/release/boost/regex/ (props changed)
   branches/release/boost/serialization/ (props changed)
   branches/release/boost/signals/ (props changed)
   branches/release/boost/signals2/ (props changed)
   branches/release/boost/spirit/ (props changed)
   branches/release/boost/spirit/home/ (props changed)
   branches/release/boost/spirit/home/karma/ (props changed)
   branches/release/boost/spirit/home/qi/nonterminal/rule.hpp (props changed)
   branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp (props changed)
   branches/release/boost/spirit/home/support/attributes.hpp (props changed)
   branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp (props changed)
   branches/release/boost/system/ (props changed)
   branches/release/boost/thread/ (props changed)
   branches/release/boost/thread.hpp (props changed)
   branches/release/boost/tr1/ (props changed)
   branches/release/boost/type_traits/ (props changed)
   branches/release/boost/utility/value_init.hpp (props changed)
   branches/release/boost/wave/ (props changed)
   branches/release/index.html (props changed)
   branches/release/libs/config/ (props changed)
   branches/release/libs/filesystem/ (props changed)
   branches/release/libs/fusion/ (props changed)
   branches/release/libs/graph_parallel/ (props changed)
   branches/release/libs/interprocess/ (props changed)
   branches/release/libs/intrusive/ (props changed)
   branches/release/libs/iostreams/ (props changed)
   branches/release/libs/libraries.htm (props changed)
   branches/release/libs/maintainers.txt (props changed)
   branches/release/libs/math/ (props changed)
   branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
   branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
   branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
   branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
   branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
   branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
   branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
   branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
   branches/release/libs/numeric/ublas/ (props changed)
   branches/release/libs/numeric/ublas/doc/ (props changed)
   branches/release/libs/program_options/ (props changed)
   branches/release/libs/property_tree/ (props changed)
   branches/release/libs/python/ (props changed)
   branches/release/libs/regex/ (props changed)
   branches/release/libs/serialization/ (props changed)
   branches/release/libs/signals/ (props changed)
   branches/release/libs/signals2/ (props changed)
   branches/release/libs/spirit/ (props changed)
   branches/release/libs/spirit/classic/example/ (props changed)
   branches/release/libs/spirit/doc/ (props changed)
   branches/release/libs/spirit/doc/html/spirit/abstracts/customize/ (props changed)
   branches/release/libs/spirit/doc/html/spirit/abstracts/indepth/ (props changed)
   branches/release/libs/spirit/example/ (props changed)
   branches/release/libs/spirit/phoenix/ (props changed)
   branches/release/libs/spirit/test/ (props changed)
   branches/release/libs/spirit/test/qi/optional.cpp (props changed)
   branches/release/libs/system/ (props changed)
   branches/release/libs/thread/ (props changed)
   branches/release/libs/timer/ (props changed)
   branches/release/libs/tr1/ (props changed)
   branches/release/libs/type_traits/ (props changed)
   branches/release/libs/utility/swap.html (props changed)
   branches/release/libs/utility/value_init.htm (props changed)
   branches/release/libs/utility/value_init_test.cpp (props changed)
   branches/release/libs/wave/ (props changed)
   branches/release/status/ (props changed)
   branches/release/tools/boostbook/ (props changed)
   branches/release/tools/quickbook/ (props changed)
   branches/release/tools/regression/ (props changed)
   branches/release/tools/release/ (props changed)
   branches/release/tools/wave/ (props changed)
Text files modified:
   branches/release/boost/xpressive/regex_compiler.hpp | 1 +
   branches/release/boost/xpressive/regex_error.hpp | 35 +++++++++++++++++++++++++----------
   2 files changed, 26 insertions(+), 10 deletions(-)

Modified: branches/release/boost/xpressive/regex_compiler.hpp
==============================================================================
--- branches/release/boost/xpressive/regex_compiler.hpp (original)
+++ branches/release/boost/xpressive/regex_compiler.hpp 2009-11-04 13:05:06 EST (Wed, 04 Nov 2009)
@@ -690,6 +690,7 @@
             {
             case token_quote_meta_end: return string_type(old_begin, old_end);
             case token_escape: BOOST_XPR_ENSURE_(begin != end, error_escape, "incomplete escape sequence");
+ case token_invalid_quantifier:
             case token_literal: ++begin;
             default:;
             }

Modified: branches/release/boost/xpressive/regex_error.hpp
==============================================================================
--- branches/release/boost/xpressive/regex_error.hpp (original)
+++ branches/release/boost/xpressive/regex_error.hpp 2009-11-04 13:05:06 EST (Wed, 04 Nov 2009)
@@ -77,19 +77,34 @@
 
 namespace detail
 {
- // To work around a GCC warning
- inline bool false_() { return false; }
+ inline bool ensure_(
+ bool cond
+ , regex_constants::error_type code
+ , char const *msg
+ , char const *fun
+ , char const *file
+ , unsigned long line
+ )
+ {
+ if(!cond)
+ {
+ #ifndef BOOST_EXCEPTION_DISABLE
+ boost::throw_exception(
+ boost::enable_error_info(boost::xpressive::regex_error(code, msg))
+ << boost::throw_function(fun)
+ << boost::throw_file(file)
+ << boost::throw_line((int)line)
+ );
+ #else
+ boost::throw_exception(boost::xpressive::regex_error(code, msg));
+ #endif
+ }
+ return true;
+ }
 }
 
 #define BOOST_XPR_ENSURE_(pred, code, msg) \
- ( \
- (pred) \
- ? true \
- : ( \
- BOOST_THROW_EXCEPTION(boost::xpressive::regex_error(code, msg)) \
- , boost::xpressive::detail::false_() \
- ) \
- ) \
+ boost::xpressive::detail::ensure_(pred, code, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__) \
     /**/
 
 }} // namespace boost::xpressive


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