<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 18, 2012, at 9:41 AM, Douglas Gregor <<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 18, 2012, at 1:09 AM, Daniel Jasper <<a href="mailto:djasper@google.com">djasper@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt"><div dir="ltr"><div class="gmail_default" style=""><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 17, 2012 at 11:04 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com" target="_blank" class="cremed">dgregor@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div class="im"><div>On Dec 17, 2012, at 9:55 AM, Daniel Jasper <<a href="mailto:djasper@google.com" target="_blank" class="cremed">djasper@google.com</a>> wrote:</div>
<br></div><div class="im"><blockquote type="cite"><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div dir="ltr">Hi Fariborz,<div><br></div><div>I am taking a look at your patch, but please bear with me for another day or two. I am not yet convinced that mingling C++ and ObjC formatting that closely is a wise decision. I think we might need something that clearly separates the different modes. And you touch a lot of code that I intended to refactor into something halfway sane this week. I will take your patch into consideration when doing so, but it might need some changes afterwards.</div>
</div></div></blockquote><div><br></div></div>If we're going to distinguish the modes, we need to do so syntactically. Objective-C++ is a very popular dialect; we can't simply rely on extrinsic knowledge of whether we're dealing with Objective-C or C++ to make these decisions.</div>
</div></blockquote><div><br></div><div style="">I am not sure I fully understand this. We are currently relying on a Lexer which in turn requires LangOptions to create the correct tokens. Same for the identifier table we use to split raw_identifiers into identifiers and keywords. Are you saying the formatter should not capitalize on this knowledge of the input token stream?</div>
</div></div></div></div></blockquote><br></div><div>Oh, it should certainly capitalize on this knowledge. My concern is that, when you mentioned that we might need something that "clearly separates the different modes", you were thinking of Objective-C and C++ as independent languages that aren't used together. Fortunately, we can tell syntactically whether we're in an Objective-C method declaration fairly easily: they start with + or -, almost always in the first column, so if it would be better to go down a different code-formatting path where the rules for spacing around (/)/: are different, we could do that instead.</div></div></blockquote><div><br></div>Right. My original formatter  patch was made to distinguish an objc method declaration this way. We can do for other decls easily as all objc specific decls start with @somename if we have to.</div><div><br></div><div>- Fariborz</div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">      </span>- Doug</div><br></div></blockquote></div><br></body></html>