From 5839df80a9dcf2b638412cff51deb64e650ca7a8 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Sun, 18 Dec 2005 21:11:41 +0000 Subject: [PATCH] Fixed a bogus assertion in Wave. [SVN r32095] --- ChangeLog | 3 +++ include/boost/wave/token_ids.hpp | 1 + include/boost/wave/util/cpp_iterator.hpp | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67ee4f2..63798f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -79,6 +79,9 @@ CHANGELOG The default value for BOOST_WAVE_PRAGMA_COMMAND is "wave" to ensure complete backward compatibility. - Added missing #pragma warning(pop) directives. +- Fixed a bug wrt error propagation in the expression parser. +- Fixed an assertion fired when cpp_token is used to process the quick_start + sample. Mon Dec 5 22:05:22 CST 2005 Boost V1.33.1 diff --git a/include/boost/wave/token_ids.hpp b/include/boost/wave/token_ids.hpp index faafdd2..bad2fc6 100644 --- a/include/boost/wave/token_ids.hpp +++ b/include/boost/wave/token_ids.hpp @@ -78,6 +78,7 @@ enum token_category { /////////////////////////////////////////////////////////////////////////////// // the token_id assigns unique numbers to the different C++ lexemes enum token_id { + T_UNKNOWN = 0, T_FIRST_TOKEN = 256, T_AND = TOKEN_FROM_ID(T_FIRST_TOKEN, OperatorTokenType), T_AND_ALT = TOKEN_FROM_ID(T_FIRST_TOKEN, OperatorTokenType|AltExtTokenType), diff --git a/include/boost/wave/util/cpp_iterator.hpp b/include/boost/wave/util/cpp_iterator.hpp index 4cfd16d..e28784f 100644 --- a/include/boost/wave/util/cpp_iterator.hpp +++ b/include/boost/wave/util/cpp_iterator.hpp @@ -431,7 +431,7 @@ pp_iterator_functor::operator()() // loop over skippable whitespace until something significant is found bool skipped_newline = false; bool was_seen_newline = seen_newline; -token_id id = T_ANY; +token_id id = T_UNKNOWN; do { // get_next_token assigns result to act_token member @@ -763,7 +763,7 @@ namespace { { using namespace boost::wave; - token_id id = T_ANY; + token_id id = T_UNKNOWN; for (/**/; it != end; ++it) { id = token_id(*it); if (!IS_CATEGORY(id, WhiteSpaceTokenType)) @@ -771,7 +771,7 @@ namespace { if (IS_CATEGORY(id, EOLTokenType)) break; // do not enter a new line } - BOOST_ASSERT(it == end || id != T_ANY); + BOOST_ASSERT(it == end || id != T_UNKNOWN); return it != end && IS_CATEGORY(id, PPTokenType); }