mirror of
https://github.com/boostorg/wave.git
synced 2026-01-23 18:12:16 +00:00
merged from trunk
[SVN r47983]
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
#include <boost/wave/language_support.hpp>
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/pool/singleton_pool.hpp>
|
||||
|
||||
// this must occur after all of the includes and before any code appears
|
||||
@@ -147,7 +148,7 @@ token_data<StringTypeT, PositionT>::operator new(std::size_t size)
|
||||
|
||||
void *ret = pool_type::malloc();
|
||||
if (0 == ret)
|
||||
throw std::bad_alloc();
|
||||
boost::throw_exception(std::bad_alloc());
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -755,7 +755,10 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
parse_info<iterator_type> hit(first);
|
||||
closure_value result; // expression result
|
||||
|
||||
try {
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
try
|
||||
#endif
|
||||
{
|
||||
expression_grammar g; // expression grammar
|
||||
hit = parse (first, last, g[spirit_assign_actor(result)],
|
||||
ch_p(T_SPACE) | ch_p(T_CCOMMENT) | ch_p(T_CPPCOMMENT));
|
||||
@@ -768,6 +771,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
expression = "<empty expression>";
|
||||
BOOST_WAVE_THROW(preprocess_exception, ill_formed_expression,
|
||||
expression.c_str(), act_pos);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// as the if_block_status is false no errors will be reported
|
||||
@@ -775,17 +779,20 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
}
|
||||
}
|
||||
}
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
catch (boost::wave::preprocess_exception const& e) {
|
||||
// expression is illformed
|
||||
if (if_block_status) {
|
||||
boost::throw_exception(e);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
else {
|
||||
// as the if_block_status is false no errors will be reported
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (!hit.full) {
|
||||
// The token list starts with a valid expression, but there remains
|
||||
// something. If the remainder consists out of whitespace only, the
|
||||
@@ -812,6 +819,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
expression = "<empty expression>";
|
||||
BOOST_WAVE_THROW(preprocess_exception, ill_formed_expression,
|
||||
expression.c_str(), act_pos);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// as the if_block_status is false no errors will be reported
|
||||
|
||||
@@ -115,15 +115,15 @@ struct load_filepos
|
||||
//
|
||||
// Any directories specified with the 'add_include_path()' function before
|
||||
// the function 'set_sys_include_delimiter()' is called are searched only
|
||||
// for the case of '#include "file"' directives, they are not searched for
|
||||
// '#include <file>' directives. If additional directories are specified
|
||||
// for the case of '#include "file"' directives, they are not searched for
|
||||
// '#include <file>' directives. If additional directories are specified
|
||||
// with the 'add_include_path()' function after a call to the function
|
||||
// 'set_sys_include_delimiter()', these directories are searched for all
|
||||
// '#include' directives.
|
||||
//
|
||||
// In addition, a call to the function 'set_sys_include_delimiter()'
|
||||
// inhibits the use of the current directory as the first search directory
|
||||
// for '#include "file"' directives. Therefore, the current directory is
|
||||
// for '#include "file"' directives. Therefore, the current directory is
|
||||
// searched only if it is requested explicitly with a call to the function
|
||||
// 'add_include_path(".")'.
|
||||
//
|
||||
|
||||
@@ -762,7 +762,7 @@ token_type startof_argument_list = *next;
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
if (boost::wave::need_variadics(ctx.get_language())) {
|
||||
// store a placemarker as the argument
|
||||
argument->push_back(token_type(T_PLACEMARKER, "\xA7", // "§",
|
||||
argument->push_back(token_type(T_PLACEMARKER, "\xA7",
|
||||
(*next).get_position()));
|
||||
++count_arguments;
|
||||
}
|
||||
@@ -787,7 +787,7 @@ token_type startof_argument_list = *next;
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
if (boost::wave::need_variadics(ctx.get_language())) {
|
||||
// store a placemarker as the argument
|
||||
argument->push_back(token_type(T_PLACEMARKER, "\xA7", // "§",
|
||||
argument->push_back(token_type(T_PLACEMARKER, "\xA7",
|
||||
(*next).get_position()));
|
||||
++count_arguments;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace impl {
|
||||
if (IS_CATEGORY(*it, WhiteSpaceTokenType) || T_NEWLINE == id) {
|
||||
if (!was_whitespace) {
|
||||
// C++ standard 16.3.2.2 [cpp.stringize]
|
||||
// Each occurrence of white space between the argument’s
|
||||
// Each occurrence of white space between the argument's
|
||||
// preprocessing tokens becomes a single space character in the
|
||||
// character string literal.
|
||||
result += " ";
|
||||
@@ -126,7 +126,7 @@ namespace impl {
|
||||
}
|
||||
else
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
if (T_PLACEMARKER != id)
|
||||
if (T_PLACEMARKER != id)
|
||||
#endif
|
||||
{
|
||||
// now append this token to the string
|
||||
@@ -169,7 +169,7 @@ namespace impl {
|
||||
if (IS_CATEGORY(*it, WhiteSpaceTokenType) || T_NEWLINE == id) {
|
||||
if (!was_whitespace) {
|
||||
// C++ standard 16.3.2.2 [cpp.stringize]
|
||||
// Each occurrence of white space between the argument’s
|
||||
// Each occurrence of white space between the argument's
|
||||
// preprocessing tokens becomes a single space character in the
|
||||
// character string literal.
|
||||
result += " ";
|
||||
|
||||
@@ -35,3 +35,5 @@ STR() //R ""
|
||||
//H 00: t_1_034.cpp(21): STR(§), [t_1_034.cpp(16): STR(...)=#__VA_ARGS__]
|
||||
//H 02: ""
|
||||
//H 03: ""
|
||||
|
||||
// boostinspect:noascii this file needs to contain non-ASCII characters
|
||||
|
||||
@@ -45,3 +45,5 @@ PASTE2(1, , , 4) //R 14
|
||||
//H 00: t_1_035.cpp(24): PASTE2(1, §, §, 4), [t_1_035.cpp(15): PASTE2(a, b, c, d)=a##b##c##d]
|
||||
//H 02: 14
|
||||
//H 03: 14
|
||||
|
||||
// boostinspect:noascii this file needs to contain non-ASCII characters
|
||||
|
||||
Reference in New Issue
Block a user