Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57738 - trunk/libs/spirit/example/qi
From: joel_at_[hidden]
Date: 2009-11-18 04:04:30


Author: djowel
Date: 2009-11-18 04:04:28 EST (Wed, 18 Nov 2009)
New Revision: 57738
URL: http://svn.boost.org/trac/boost/changeset/57738

Log:
tweaks
Text files modified:
   trunk/libs/spirit/example/qi/typeof.cpp | 11 ++++-------
   1 files changed, 4 insertions(+), 7 deletions(-)

Modified: trunk/libs/spirit/example/qi/typeof.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/typeof.cpp (original)
+++ trunk/libs/spirit/example/qi/typeof.cpp 2009-11-18 04:04:28 EST (Wed, 18 Nov 2009)
@@ -15,8 +15,9 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #define BOOST_SPIRIT_AUTO(domain_, name, expr) \
- typedef BOOST_TYPEOF(expr) name##expr_type; \
- BOOST_SPIRIT_ASSERT_MATCH(boost::spirit::domain_::domain, name##expr_type); \
+ typedef BOOST_TYPEOF(expr) name##_expr_type; \
+ BOOST_SPIRIT_ASSERT_MATCH( \
+ boost::spirit::domain_::domain, name##_expr_type); \
     BOOST_AUTO(name, boost::proto::deep_copy(expr)); \
     //
 
@@ -26,13 +27,9 @@
     using boost::spirit::ascii::space;
     using boost::spirit::ascii::char_;
     using boost::spirit::qi::parse;
- using boost::spirit::qi::lit;
     typedef std::string::const_iterator iterator_type;
     
- BOOST_SPIRIT_AUTO(qi, comment_pre, lit("/*"));
- BOOST_SPIRIT_AUTO(qi, comment_mid, char_ - "*/");
- BOOST_SPIRIT_AUTO(qi, comment_post, lit("*/"));
- BOOST_SPIRIT_AUTO(qi, comment, comment_pre >> *comment_mid >> comment_post);
+ BOOST_SPIRIT_AUTO(qi, comment, "/*" >> *(char_ - "*/") >> "*/");
 
     std::string str = "/*This is a comment*/";
     std::string::const_iterator iter = str.begin();


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