Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2008-08-10 22:49:03


Author: eric_niebler
Date: 2008-08-10 22:49:03 EDT (Sun, 10 Aug 2008)
New Revision: 48075
URL: http://svn.boost.org/trac/boost/changeset/48075

Log:
detect and report invalid use of not-yet-implemented collation sequences and equivalence classes
Text files modified:
   trunk/boost/xpressive/detail/dynamic/parser_enum.hpp | 4 ++++
   trunk/boost/xpressive/detail/dynamic/parser_traits.hpp | 21 ++++++++++++++++++---
   2 files changed, 22 insertions(+), 3 deletions(-)

Modified: trunk/boost/xpressive/detail/dynamic/parser_enum.hpp
==============================================================================
--- trunk/boost/xpressive/detail/dynamic/parser_enum.hpp (original)
+++ trunk/boost/xpressive/detail/dynamic/parser_enum.hpp 2008-08-10 22:49:03 EDT (Sun, 10 Aug 2008)
@@ -35,6 +35,10 @@
     token_charset_backspace, // \b
     token_posix_charset_begin, // [:
     token_posix_charset_end, // :]
+ token_equivalence_class_begin, // [=
+ token_equivalence_class_end, // =]
+ token_collation_element_begin, // [.
+ token_collation_element_end, // .]
 
     token_quote_meta_begin, // \Q
     token_quote_meta_end, // \E

Modified: trunk/boost/xpressive/detail/dynamic/parser_traits.hpp
==============================================================================
--- trunk/boost/xpressive/detail/dynamic/parser_traits.hpp (original)
+++ trunk/boost/xpressive/detail/dynamic/parser_traits.hpp 2008-08-10 22:49:03 EDT (Sun, 10 Aug 2008)
@@ -299,10 +299,25 @@
         case BOOST_XPR_CHAR_(char_type, '['):
             {
                 FwdIter next = begin; ++next;
- if(next != end && *next == BOOST_XPR_CHAR_(char_type, ':'))
+ if(next != end)
                 {
- begin = ++next;
- return token_posix_charset_begin;
+ detail::ensure(
+ *next != BOOST_XPR_CHAR_(char_type, '=')
+ , error_collate
+ , "equivalence classes are not yet supported"
+ );
+
+ detail::ensure(
+ *next != BOOST_XPR_CHAR_(char_type, '.')
+ , error_collate
+ , "collation sequences are not yet supported"
+ );
+
+ if(*next == BOOST_XPR_CHAR_(char_type, ':'))
+ {
+ begin = ++next;
+ return token_posix_charset_begin;
+ }
                 }
             }
             break;


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