Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53832 - trunk/boost/spirit/home/lex/lexer/lexertl
From: hartmut.kaiser_at_[hidden]
Date: 2009-06-12 15:47:00


Author: hkaiser
Date: 2009-06-12 15:46:59 EDT (Fri, 12 Jun 2009)
New Revision: 53832
URL: http://svn.boost.org/trac/boost/changeset/53832

Log:
Spirit: Fixed default token type to work properly when used with SPIRIT_DEBUG
Text files modified:
   trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp | 11 ++++++++---
   1 files changed, 8 insertions(+), 3 deletions(-)

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp 2009-06-12 15:46:59 EDT (Fri, 12 Jun 2009)
@@ -155,9 +155,14 @@
     operator<< (std::basic_ostream<Char, Traits>& os
       , token<Iterator, AttributeTypes, HasState> const& t)
     {
- Iterator end = t.matched_.second;
- for (Iterator it = t.matched_.first; it != end; ++it)
- os << *it;
+ if (t.id()) {
+ Iterator end = t.matched_.second;
+ for (Iterator it = t.matched_.first; it != end; ++it)
+ os << *it;
+ }
+ else {
+ os << "<invalid token>";
+ }
         return os;
     }
 #endif


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