<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 11, 2014 at 10:09 PM, Stefanus Du Toit <span dir="ltr"><<a href="mailto:stefanus.du.toit@intel.com" target="_blank">stefanus.du.toit@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
================<br>
Comment at: lib/Format/UnwrappedLineParser.cpp:1042<br>
@@ +1041,3 @@<br>
</div><div class="im">+  bool NeedsUnwrappedLine = false;<br>
+  if (FormatTok->Tok.is(tok::colon)) {<br>
+      // We are in a function try block, what comes is an initializer list<br>
</div>----------------<br>
<div class="im">Stefanus Du Toit wrote:<br>
> Manuel Klimek wrote:<br>
> > Alexander Rojas wrote:<br>
> > > Manuel Klimek wrote:<br>
> > > > I'm wondering whether we just want to eat everything up to the next '{'. In general, we try to parse as little as possible in the structural parser.<br>
> > > ><br>
> > > > If we decide we really need to parse the structure here, I think we should pull out a parseInitializerList() method.<br>
> > > I've been thinking on how to parse the initializer list, and it might be quite cumbersome. I've been thinking on leaving out of this patch the ability of dealing with function-try blocks and leave it for latter (since I do this as a hobby, there's really a limit on how much time I can spend on this).<br>

> > I think we're misunderstanding each other here... What I mean is that we should parse *less* accurately. The thing to remember is that clang-format must work well on incorrect code. Thus, the structural parser tries hard to find only the structural elements that matter.<br>

> ><br>
> > Regarding the time limits you have: especially when you do this as a hobby, I'd say this is the perfect venue to try to get things "right". As nobody forces you to do it, there's also no deadline pressure, so you can take all the time you need... The worst that can happen is that somebody asks you whether they can take over and finish the patch if they need it more urgently.<br>

> I don't think you can just consume until the next brace, due to brace initialization:<br>
><br>
>   try : foo{}, bar{nullptr} {} catch (...) {}<br>
><br>
</div>klimek, when you say that you'd like to have parseInitializerList() broken out, do you mean for it to be used anywhere else, or just to pull it out to make it cleaner here and in potential future uses? I couldn't find anywhere we explicitly parse initializer lists already.<br>
</blockquote><div><br></div><div>I think the code is easier to understand when factored there, that's all :)</div><div><br></div><div>Cheers,</div><div>/Manuel</div></div></div></div>