Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53003 - trunk/boost/spirit/home/lex/lexer/lexertl
From: hartmut.kaiser_at_[hidden]
Date: 2009-05-14 17:23:35


Author: hkaiser
Date: 2009-05-14 17:23:32 EDT (Thu, 14 May 2009)
New Revision: 53003
URL: http://svn.boost.org/trac/boost/changeset/53003

Log:
Spirit: Improved lex static code generator
Text files modified:
   trunk/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp | 9 ++++++---
   1 files changed, 6 insertions(+), 3 deletions(-)

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp 2009-05-14 17:23:32 EDT (Thu, 14 May 2009)
@@ -54,14 +54,17 @@
         typedef typename reverse_state_map_type::iterator iterator;
         iterator rend = reverse_state_map.end();
         std::size_t last_id = 0;
- for (iterator rit = reverse_state_map.begin(); rit != rend;
- ++rit, ++last_id)
+ for (iterator rit = reverse_state_map.begin(); rit != rend; ++last_id)
         {
             for (/**/; last_id < (*rit).first; ++last_id)
             {
                 os_ << " 0, // \"<undefined state>\"\n";
             }
- os_ << " \"" << (*rit).second << "\",\n";
+ os_ << " \"" << (*rit).second << "\"";
+ if (++rit != rend)
+ os_ << ",\n";
+ else
+ os_ << "\n"; // don't generate the final comma
         }
         os_ << "};\n\n";
 


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