diff options
Diffstat (limited to 'boost/wave/util/interpret_pragma.hpp')
-rw-r--r-- | boost/wave/util/interpret_pragma.hpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/boost/wave/util/interpret_pragma.hpp b/boost/wave/util/interpret_pragma.hpp index e5b9127366..5a68a5e006 100644 --- a/boost/wave/util/interpret_pragma.hpp +++ b/boost/wave/util/interpret_pragma.hpp @@ -47,12 +47,12 @@ namespace util { /////////////////////////////////////////////////////////////////////////////// // // The function interpret_pragma interprets the given token sequence as the -// body of a #pragma directive (or parameter to the _Pragma operator) and +// body of a #pragma directive (or parameter to the _Pragma operator) and // executes the actions associated with recognized Wave specific options. // /////////////////////////////////////////////////////////////////////////////// template <typename ContextT, typename IteratorT, typename ContainerT> -inline bool +inline bool interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token, IteratorT it, IteratorT const &end, ContainerT &pending) { @@ -62,44 +62,44 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token, using namespace cpplexer; if (T_IDENTIFIER == token_id(*it)) { // check for pragma wave ... - if ((*it).get_value() == BOOST_WAVE_PRAGMA_KEYWORD) + if ((*it).get_value() == BOOST_WAVE_PRAGMA_KEYWORD) { // this is a wave specific option, it should have the form: // // #pragma command option(value) // - // where + // where // 'command' is the value of the preprocessor constant // BOOST_WAVE_PRAGMA_KEYWORD (defaults to "wave") and - // '(value)' is required only for some pragma directives (this is + // '(value)' is required only for some pragma directives (this is // optional) // - // All recognized #pragma operators are forwarded to the supplied + // All recognized #pragma operators are forwarded to the supplied // preprocessing hook. using namespace boost::spirit::classic; token_type option; ContainerT values; - - if (!parse (++it, end, + + if (!parse (++it, end, ( ch_p(T_IDENTIFIER) [ spirit_assign_actor(option) - ] - | pattern_p(KeywordTokenType, + ] + | pattern_p(KeywordTokenType, TokenTypeMask|PPTokenFlag) [ spirit_assign_actor(option) - ] - | pattern_p(OperatorTokenType|AltExtTokenType, + ] + | pattern_p(OperatorTokenType|AltExtTokenType, ExtTokenTypeMask|PPTokenFlag) // and, bit_and etc. [ spirit_assign_actor(option) - ] - | pattern_p(BoolLiteralTokenType, + ] + | pattern_p(BoolLiteralTokenType, TokenTypeMask|PPTokenFlag) [ spirit_assign_actor(option) - ] + ] ) >> !comment_nest_p( ch_p(T_LEFTPAREN), @@ -109,7 +109,7 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token, { typename ContextT::string_type msg( impl::as_string<string_type>(it, end)); - BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, + BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_pragma_option, msg.c_str(), act_token.get_position()); return false; @@ -125,9 +125,9 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token, // decode the option (call the context_policy hook) if (!ctx.get_hooks().interpret_pragma( - ctx.derived(), pending, option, values, act_token)) + ctx.derived(), pending, option, values, act_token)) { - // unknown #pragma option + // unknown #pragma option string_type option_str ((*it).get_value()); option_str += option.get_value(); @@ -136,7 +136,7 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token, option_str += impl::as_string(values); option_str += ")"; } - BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, + BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_pragma_option, option_str.c_str(), act_token.get_position()); return false; @@ -148,15 +148,15 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token, // #pragma once return ctx.add_pragma_once_header(act_token, ctx.get_current_filename()); } -#endif +#endif #if BOOST_WAVE_SUPPORT_PRAGMA_MESSAGE != 0 else if ((*it).get_value() == "message") { // #pragma message(...) or #pragma message ... using namespace boost::spirit::classic; ContainerT values; - if (!parse (++it, end, - ( ( ch_p(T_LEFTPAREN) + if (!parse (++it, end, + ( ( ch_p(T_LEFTPAREN) >> lexeme_d[ *(anychar_p[spirit_append_actor(values)] - ch_p(T_RIGHTPAREN)) ] @@ -172,7 +172,7 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token, { typename ContextT::string_type msg( impl::as_string<string_type>(it, end)); - BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, + BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_pragma_message, msg.c_str(), act_token.get_position()); return false; @@ -187,8 +187,8 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token, // output the message itself typename ContextT::string_type msg(impl::as_string(values)); - BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, - pragma_message_directive, + BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, + pragma_message_directive, msg.c_str(), act_token.get_position()); return false; } |