On Thu, Feb 14, 2013 at 2:42 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
  Looking at this again, it's going to be hard to get LeadingSpace to be correct in all cases in keep-whitespace mode. I'm hesitant to add another variable like IsAtStartOfLine that will just slow down every token lexed in //non-//traditional mode.<br>

<br>
  (To do -traditional-cpp properly, we'd actually need LeadingSpace to be correct, because # only starts a directive if it's actually in the first column. But this patch doesn't do that anyway.)<br></blockquote>
<div><br></div><div>I'm not sure how much sense it makes to teach Lexer to do -traditional-cpp properly. The truly horrific parts of it (macro expansion within string literals, /**/ concatenation, whitespace preservation, etc) make much more sense with a character-stream model than a token-stream model.</div>
</div>