Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74339 - in branches/release: . boost boost/wave boost/wave/util libs libs/wave libs/wave/doc libs/wave/samples/cpp_tokens libs/wave/samples/cpp_tokens/slex
From: hartmut.kaiser_at_[hidden]
Date: 2011-09-10 18:25:35


Author: hkaiser
Date: 2011-09-10 18:25:33 EDT (Sat, 10 Sep 2011)
New Revision: 74339
URL: http://svn.boost.org/trac/boost/changeset/74339

Log:
Wave: merging from trunk
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/wave/ (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/wave/ (props changed)
Text files modified:
   branches/release/boost/wave/language_support.hpp | 6 ++++--
   branches/release/boost/wave/util/file_position.hpp | 35 +----------------------------------
   branches/release/boost/wave/util/flex_string.hpp | 7 +------
   branches/release/libs/wave/ChangeLog | 9 +++++++++
   branches/release/libs/wave/doc/class_reference_context.html | 6 ++++--
   branches/release/libs/wave/index.html | 4 ++--
   branches/release/libs/wave/samples/cpp_tokens/cpp_tokens.cpp | 1 +
   branches/release/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp | 10 ++++++----
   8 files changed, 28 insertions(+), 50 deletions(-)

Modified: branches/release/boost/wave/language_support.hpp
==============================================================================
--- branches/release/boost/wave/language_support.hpp (original)
+++ branches/release/boost/wave/language_support.hpp 2011-09-10 18:25:33 EDT (Sat, 10 Sep 2011)
@@ -26,7 +26,7 @@
 // support flags for C++98
     support_normal = 0x01,
     support_cpp = support_normal,
-
+
     support_option_long_long = 0x02,
 
 #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
@@ -38,7 +38,8 @@
     support_cpp0x = support_option_variadics | support_option_long_long | 0x10,
 #endif
 
- support_option_mask = 0xFF80,
+ support_option_mask = 0xFFB0,
+ support_option_emit_contnewlines = 0x0040,
     support_option_insert_whitespace = 0x0080,
     support_option_preserve_comments = 0x0100,
     support_option_no_character_validation = 0x0200,
@@ -196,6 +197,7 @@
 BOOST_WAVE_OPTION(emit_pragma_directives) // support_option_emit_pragma_directives
 #endif
 BOOST_WAVE_OPTION(insert_whitespace) // support_option_insert_whitespace
+BOOST_WAVE_OPTION(emit_contnewlines) // support_option_emit_contnewlines
 
 #undef BOOST_WAVE_NEED_OPTION
 #undef BOOST_WAVE_ENABLE_OPTION

Modified: branches/release/boost/wave/util/file_position.hpp
==============================================================================
--- branches/release/boost/wave/util/file_position.hpp (original)
+++ branches/release/boost/wave/util/file_position.hpp 2011-09-10 18:25:33 EDT (Sat, 10 Sep 2011)
@@ -35,36 +35,6 @@
 namespace util {
 
 ///////////////////////////////////////////////////////////////////////////////
-namespace debug {
-
- // Used only when BOOST_ASSERT expands to something
- // make sure the string literal does not contain any escapes ('\\' just
- // before '\\', '\"' or '?')
- template <typename StringT>
- inline bool
- is_escaped_lit(StringT const &value)
- {
- typename StringT::size_type pos = value.find_first_of ("\\", 0);
- if (StringT::npos != pos) {
- do {
- if ('\\' == value[pos+1] ||
- '\"' == value[pos+1] ||
- '?' == value[pos+1])
- {
- return true;
- }
- else {
- pos = value.find_first_of ("\\", pos+1);
- }
- } while (pos != StringT::npos);
- }
- return false;
- }
-
-///////////////////////////////////////////////////////////////////////////////
-} // namespace debug
-
-///////////////////////////////////////////////////////////////////////////////
 //
 // file_position
 //
@@ -85,9 +55,7 @@
     explicit file_position(string_type const& file_, std::size_t line_ = 1,
             std::size_t column_ = 1)
     : file(file_), line(line_), column(column_)
- {
- BOOST_ASSERT(!debug::is_escaped_lit(file));
- }
+ {}
 
 // accessors
     string_type const &get_file() const { return file; }
@@ -97,7 +65,6 @@
     void set_file(string_type const &file_)
     {
         file = file_;
- BOOST_ASSERT(!debug::is_escaped_lit(file));
     }
     void set_line(std::size_t line_) { line = line_; }
     void set_column(std::size_t column_) { column = column_; }

Modified: branches/release/boost/wave/util/flex_string.hpp
==============================================================================
--- branches/release/boost/wave/util/flex_string.hpp (original)
+++ branches/release/boost/wave/util/flex_string.hpp 2011-09-10 18:25:33 EDT (Sat, 10 Sep 2011)
@@ -102,12 +102,7 @@
 #include <functional>
 #include <limits>
 #include <stdexcept>
-
-#if defined(__PATHSCALE__)
- #include <ios>
-#else
- #include <iosfwd>
-#endif
+#include <ios>
 
 #include <cstddef>
 #include <cstring>

Modified: branches/release/libs/wave/ChangeLog
==============================================================================
--- branches/release/libs/wave/ChangeLog (original)
+++ branches/release/libs/wave/ChangeLog 2011-09-10 18:25:33 EDT (Sat, 10 Sep 2011)
@@ -20,6 +20,15 @@
 
 CHANGELOG
 
+Boost V1.48.0
+ - V2.3.1
+ - Added the flag support_option_emit_contnewlines allowing to control whether
+ backslash newline sequences are emitted by the Wave library. The default is
+ as before: these tokens will be silently ignored (after the token positions
+ have been properly updated). Note: this option is supported by the SLex lexer
+ module only.
+ - Fixed #5887: flex_string.hpp needs to include <ios>
+
 Boost V1.47.0
 - V2.3.0
 - After preprocessing the body of any #pragma wave option() the wave tool now

Modified: branches/release/libs/wave/doc/class_reference_context.html
==============================================================================
--- branches/release/libs/wave/doc/class_reference_context.html (original)
+++ branches/release/libs/wave/doc/class_reference_context.html 2011-09-10 18:25:33 EDT (Sat, 10 Sep 2011)
@@ -381,7 +381,8 @@
   <p>This functions allows to specify the language mode, in which
     the <tt>Wave</tt> library should work. The possible
     language modes are defined by the enumerated type <tt>language_support</tt>:</p>
- <pre> <span class="keyword">enum</span> language_support {<br> <span class="comment">// support flags for C++98</span><br> support_normal = 0x01,<br> support_cpp = support_normal,<br><span class="comment"><br> // support flags for C99</span><br> support_option_long_long = 0x02,<br> support_option_variadics = 0x04,<br> support_c99 = support_option_variadics | support_option_long_long | 0x08,<br><span class="comment"><br> // the mask for the main language settings</span><br> support_option_mask = 0xFF80,<br><br><span class="comment"> // additional fine tuning of the general behavior</span><br> support_option_insert_whitespace = 0x0080,<br> support_option_preserve_comments = 0x0100,<br> support_option_no_character_validation = 0x0200,<br> support_option_convert_trigraphs = 0x0400,<br> support_option_single_line = 0x0800,<br> support_option_prefer_pp_numbers = 0x1000,<br> support_option_emit_line_directiv
es = 0x2000,<br> support_option_include_guard_detection = 0x4000,<br> support_option_emit_pragma_directives = 0x8000<br> };</pre>
+ <pre> <span class="keyword">enum</span> language_support {<br> <span class="comment">// support flags for C++98</span><br> support_normal = 0x01,<br> support_cpp = support_normal,<br><span class="comment"><br> // support flags for C99</span><br> support_option_long_long = 0x02,<br> support_option_variadics = 0x04,<br> support_c99 = support_option_variadics | support_option_long_long | 0x08,<br><span class="comment"><br> // the mask for the main language settings</span><br> support_option_mask = 0xFFB0,<br><br><span class="comment"> // additional fine tuning of the general behavior</span>
+ support_option_emit_contline = 0x0040,<br> support_option_insert_whitespace = 0x0080,<br> support_option_preserve_comments = 0x0100,<br> support_option_no_character_validation = 0x0200,<br> support_option_convert_trigraphs = 0x0400,<br> support_option_single_line = 0x0800,<br> support_option_prefer_pp_numbers = 0x1000,<br> support_option_emit_line_directives = 0x2000,<br> support_option_include_guard_detection = 0x4000,<br> support_option_emit_pragma_directives = 0x8000<br> };</pre>
   <p>When used with <tt>support_option_variadics</tt> the support for variadics, placemarkers and the <tt>operator&nbsp;_Pragma()</tt> is enabled in normal C++ mode. When used with the <tt>support_option_long_long</tt> the support for long long suffixes is enabled in C++ mode. </p>
   <p>The <tt>support_c99</tt> switches on the C99
     language support, which enables variadics, placemarkers, the <tt>operator&nbsp;_Pragma</tt> and long long suffixes by default. Additionally it disables the C++
@@ -444,6 +445,7 @@
       the <tt>BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES</tt> is defined
       during compilation to a value not equal to zero (see here for more
       information). </li>
+ <li>If the <tt>support_option_emit_contlines</tt> flag is set, the <tt>Wave</tt> library will emit all backslash newline sequences encountered in the input. It will generate a <tt>T_CONTLINE</tt> token for each of those character sequences. Please note that this option is supported by the custom SLex lexer module only. See the cpp_tokens example for a working example.</li>
   </ul>
   <p><strong> </strong>If the parameter <tt>reset_macros</tt> is true the <tt>set_language</tt> function internally
     resets the list of defined macros, so please be careful not to call it
@@ -476,7 +478,7 @@
 <span class="updated"></span>
 <p class="copyright"><span class="updated">Last
   updated:
- <!-- #BeginDate format:fcAm1m -->Sunday, October 12, 2008 20:14<!-- #EndDate -->
+ <!-- #BeginDate format:fcAm1m -->Saturday, August 6, 2011 20:22<!-- #EndDate -->
   </span> </p>
 <p>&nbsp;</p>
 </body>

Modified: branches/release/libs/wave/index.html
==============================================================================
--- branches/release/libs/wave/index.html (original)
+++ branches/release/libs/wave/index.html 2011-09-10 18:25:33 EDT (Sat, 10 Sep 2011)
@@ -10,7 +10,7 @@
   <tbody>
     <tr>
       <td width="21">&nbsp;</td>
- <td width="885"><font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>Wave V2.0</b></font></td>
+ <td width="885"><font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>Wave V2.3</b></font></td>
       <td width="96"></td>
     </tr>
   </tbody>
@@ -100,7 +100,7 @@
   http://www.boost.org/LICENSE_1_0.txt) </font> </p>
 <span class="updated"></span>
 <p class="copyright"><span class="updated">Last updated:
- <!-- #BeginDate format:fcAm1m -->Tuesday, July 29, 2008 20:31<!-- #EndDate -->
+ <!-- #BeginDate format:fcAm1m -->Saturday, August 6, 2011 20:16<!-- #EndDate -->
   </span></p>
 </body>
 </html>

Modified: branches/release/libs/wave/samples/cpp_tokens/cpp_tokens.cpp
==============================================================================
--- branches/release/libs/wave/samples/cpp_tokens/cpp_tokens.cpp (original)
+++ branches/release/libs/wave/samples/cpp_tokens/cpp_tokens.cpp 2011-09-10 18:25:33 EDT (Sat, 10 Sep 2011)
@@ -94,6 +94,7 @@
     ctx.set_language(boost::wave::support_cpp0x);
     ctx.set_language(boost::wave::enable_preserve_comments(ctx.get_language()));
     ctx.set_language(boost::wave::enable_prefer_pp_numbers(ctx.get_language()));
+ ctx.set_language(boost::wave::enable_emit_contnewlines(ctx.get_language()));
 
     context_type::iterator_type first = ctx.begin();
     context_type::iterator_type last = ctx.end();

Modified: branches/release/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp
==============================================================================
--- branches/release/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp (original)
+++ branches/release/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp 2011-09-10 18:25:33 EDT (Sat, 10 Sep 2011)
@@ -637,8 +637,10 @@
                     id = T_EOF; // end of input reached
 
             string_type token_val(value.c_str());
-
- if (T_CONTLINE != id) {
+
+ if (boost::wave::need_emit_contnewlines(language) ||
+ T_CONTLINE != id)
+ {
                 // The cast should avoid spurious warnings about missing case labels
                 // for the other token ids's.
                     switch (static_cast<unsigned int>(id)) {
@@ -673,7 +675,7 @@
                                 pos.get_line(), pos.get_column(), pos.get_file());
                         }
                         break;
-
+
                     case T_LONGINTLIT: // supported in C99 and long_long mode
                         if (!boost::wave::need_long_long(language)) {
                         // syntax error: not allowed in C++ mode
@@ -706,7 +708,7 @@
                         at_eof = true;
                         token_val.clear();
                         break;
-
+
                     case T_OR_TRIGRAPH:
                     case T_XOR_TRIGRAPH:
                     case T_LEFTBRACE_TRIGRAPH:


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