<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 1, 2013 at 11:12 AM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank" class="cremed">clattner@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This sounds pretty interesting to me.  The only concern I would have is that we don't want Clang's lexer to have to become a "Grand unified lexer for all languages".  The token rules of languages in these families are related, but different.  Would it be better to have clang-format support using multiple different lexers?</blockquote>
</div><br>Daniel should give the definitive answer, but my feeling is that the interesting commonality with all of these languages is that the lexing rules (both token and comment) are more similar than different.</div><div class="gmail_extra">
<br></div><div class="gmail_extra">The Clang lexer is *really* nice, and I wouldn't want to see us ending up with hand written lexers that largely duplicate the interesting logic of Clang's.</div><div class="gmail_extra">
<br></div><div class="gmail_extra">I would suggest waiting to see. Essentially, if we try this out, and we end up with a big or ugly patch to the lexer than doesn't very cleanly factor out a minor difference for a particular language, then that'll be the sign that we need to have a separate lexer and abstract across them in clang-format. Until then, we re-use the existing lexer and make the minor extensions needed.</div>
</div>