Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60738 - trunk/libs/spirit/example/qi
From: hartmut.kaiser_at_[hidden]
Date: 2010-03-20 17:20:37


Author: hkaiser
Date: 2010-03-20 17:20:37 EDT (Sat, 20 Mar 2010)
New Revision: 60738
URL: http://svn.boost.org/trac/boost/changeset/60738

Log:
Spirit: Fixing bug in display_attribute_of_parser utility.
Text files modified:
   trunk/libs/spirit/example/qi/display_attribute_type.hpp | 10 ++++++++++
   1 files changed, 10 insertions(+), 0 deletions(-)

Modified: trunk/libs/spirit/example/qi/display_attribute_type.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/display_attribute_type.hpp (original)
+++ trunk/libs/spirit/example/qi/display_attribute_type.hpp 2010-03-20 17:20:37 EDT (Sat, 20 Mar 2010)
@@ -33,6 +33,11 @@
     template <typename T>
     void display_attribute_of_parser(T const &)
     {
+ // Report invalid expression error as early as possible.
+ // If you got an error_invalid_expression error message here,
+ // then the expression (expr) is not a valid spirit qi expression.
+ BOOST_SPIRIT_ASSERT_MATCH(qi::domain, T);
+
         typedef typename attribute_of_parser<T>::type type;
         std::cout << typeid(type).name() << std::endl;
     }
@@ -40,6 +45,11 @@
     template <typename T>
     void display_attribute_of_parser(std::ostream& os, T const &)
     {
+ // Report invalid expression error as early as possible.
+ // If you got an error_invalid_expression error message here,
+ // then the expression (expr) is not a valid spirit qi expression.
+ BOOST_SPIRIT_ASSERT_MATCH(qi::domain, T);
+
         typedef typename attribute_of_parser<T>::type type;
         os << typeid(type).name() << std::endl;
     }


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