<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 5, 2014 at 1:08 PM, Harald van Dijk <span dir="ltr"><<a href="mailto:harald@gigawatt.nl" target="_blank">harald@gigawatt.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">On 05/02/14 00:42, Richard Smith wrote:<br>
> Here's an easy test:<br>
><br>
> #define foo() bar() b<br>
> #define bar()<br>
> a<br>
> foo()<br>
> c<br>
><br>
> This should produce:<br>
><br>
> # 1 "..."<br>
><br>
><br>
> a<br>
> b<br>
> c<br>
><br>
> ... but currently produces:<br>
><br>
> #1 "..."<br>
><br>
><br>
> a b<br>
><br>
> c<br>
<br>
</div>Thanks Richard, I don't know how I managed to miss that.<br>
<br>
Setting Token::StartOfLine as mentioned gets this right in the lexer.<br>
However, even though the b token in the output has both<br>
Token::StartOfLine and Token::LeadingSpace set,<br>
PrintPPOutputPPCallbacks::HandleFirstTokOnLine uses the column number to<br>
determine whether to print spaces, not the flag. As a result, the output<br>
becomes not<br>
<br>
a<br>
b<br>
c<br>
<br>
but<br>
<br>
a<br>
b<br>
c<br>
<br>
Given that the lexer behaviour is now right, would it be okay to leave<br>
this as it is, and only add a test to check that b is on a separate<br>
line, like attached?</blockquote><div><br></div><div>Yes, this is fine. Committed as r202068. Thanks!<br></div></div></div></div>