mirror of
https://github.com/boostorg/wave.git
synced 2026-01-19 04:42:16 +00:00
Wave: adding support_option_emit_contnewlines for the SLex lexer only.
[SVN r73589]
This commit is contained in:
@@ -20,6 +20,14 @@ TODO (known issues):
|
||||
|
||||
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.
|
||||
|
||||
Boost V1.47.0
|
||||
- V2.3.0
|
||||
- After preprocessing the body of any #pragma wave option() the wave tool now
|
||||
|
||||
@@ -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_directives = 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 _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 _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 <a href="compiletime_config.html">here</a> 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> </p>
|
||||
</body>
|
||||
|
||||
@@ -26,7 +26,7 @@ enum language_support {
|
||||
// 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 @@ enum language_support {
|
||||
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(variadics) // support_option_variadics
|
||||
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
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="21"> </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"><a href="http://www.boost.org"><img src="doc/theme/wave.gif" align="right" border="0" height="68" width="93"></a></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>
|
||||
|
||||
@@ -94,6 +94,7 @@ main(int argc, char *argv[])
|
||||
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();
|
||||
|
||||
@@ -637,8 +637,10 @@ public:
|
||||
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 @@ public:
|
||||
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 @@ public:
|
||||
at_eof = true;
|
||||
token_val.clear();
|
||||
break;
|
||||
|
||||
|
||||
case T_OR_TRIGRAPH:
|
||||
case T_XOR_TRIGRAPH:
|
||||
case T_LEFTBRACE_TRIGRAPH:
|
||||
|
||||
Reference in New Issue
Block a user