Boost C++ Libraries: Ticket #7677: add_macro_definition("TEST=") behaves different than #define TEST https://svn.boost.org/trac10/ticket/7677 <p> Test1 posted below produces: </p> <p> INT SPACE EOF SPACE IDENTIFIER SEMICOLON NEWLINE EOF </p> <p> While Test2 produces: </p> <p> INT SPACE IDENTIFIER SEMICOLON NEWLINE EOF </p> <p> The EOF in the third line of Test1 output is produced by the TEST macro expansion. If this expected behaviour? I found this surprising. (MSVC10, Boost 1.51) </p> <hr /> <p> Code: </p> <pre class="wiki">typedef cpplexer::lex_token&lt;&gt; token_type; typedef context&lt; string::iterator, cpplexer::lex_iterator&lt;token_type&gt; &gt; lexer_context_type; void Test1() { string instring("int TEST x;\n"); lexer_context_type ctx(instring.begin(), instring.end(), ""); ctx.set_language(language_support(support_c99)); ctx.add_macro_definition("TEST="); for (lexer_context_type::iterator_type it = ctx.begin(); it != ctx.end(); ++it) cout &lt;&lt; get_token_name(token_id(*it)) &lt;&lt; endl; } void Test2() { string instring("#define TEST\nint TEST x;\n"); lexer_context_type ctx(instring.begin(), instring.end(), ""); ctx.set_language(language_support(support_c99)); for (lexer_context_type::iterator_type it = ctx.begin(); it != ctx.end(); ++it) cout &lt;&lt; get_token_name(token_id(*it)) &lt;&lt; endl; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7677 Trac 1.4.3 Hartmut Kaiser Sat, 10 Nov 2012 13:36:35 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7677#comment:1 https://svn.boost.org/trac10/ticket/7677#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This has been fixed int rev. <a class="changeset" href="https://svn.boost.org/trac10/changeset/81273" title="Wave: Fixed a problem with context&lt;&gt;::add_macro_definition which ...">[81273]</a> </p> Ticket