<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 23, 2013 at 1:49 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</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 dir="ltr"><div>On Wed, Oct 23, 2013 at 10:42 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>



</div><div class="gmail_extra"><div class="gmail_quote"><div>
<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 dir="ltr"><div class="gmail_extra">(Beware, somewhat opinionated crap below - it is formatting and indentation after all.)<br>




<br><div class="gmail_quote"><div>On Tue, Oct 22, 2013 at 11:18 PM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</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 dir="ltr">My thoughts:<div>- "<span style="font-family:arial,sans-serif;font-size:13px">more legible" is highly subjective. I for one like clang-format's choice as it uses fewer lines and (more importantly) fewer different indents. So if I had to manually choose between the two, I would choose the former.</span></div>





</div></blockquote><div><br></div></div><div>I suppose, I'd have considered it more legible because it helps avoid what I like to call the "wall of text" problem (not actually picking on dblaikie, but it came up yesterday):</div>





<div><br></div><div><br></div><div>         sh_link = SectionIndexMap.lookup(Asm.getContext().getELFSection(</div><div>          SecName.substr(sizeof(".ARM.exidx") - 1), ELF::SHT_PROGBITS,</div><div>          ELF::SHF_EXECINSTR | ELF::SHF_ALLOC, SectionKind::getText(), 0,</div>





<div>          GroupName));</div></div></div></div></blockquote><div><br></div></div><div>a) how would you want to layout this</div></div></div></div></blockquote><div><br></div><div>This? Actually I'd want to get some of the variables pulled out into temporaries if possible. This one is just hard to do anything with anyhow (as I mentioned earlier) it just gave a wall of text example.</div>
<div><br></div><div>Though some searching for better examples does give me an idea of what I might like... brought up the next question.</div>


<div> <br></div></div></div><div class="gmail_extra"><div class="gmail_quote">
<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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote">


<div>b) why is this bad? to me it's actually very quick to read... (I'd probably lay it out manually exactly like that)</div>
<div><div>
<div> </div></div></div></div></div></div></blockquote><div><br></div><div>For me it seems to be a lot of cognitive load to just read it. After a couple of lines without some other sort of indenting it just starts to look like badly written perl, or line noise (same thing). Since this is also nested calls I keep having to count parens to see where the end of each particular call, etc is versus it being obvious from scanning the code.</div>


<div><br></div><div>Sadly I can also come up with ways that this makes the code more difficult to read:</div><div><br></div><div><pre style="font-size:medium"><span style="color:rgb(128,0,0);font-weight:bold">return</span> dwarf<span style="color:rgb(128,0,128)">::</span>PubIndexEntryDescriptor<span style="color:rgb(128,128,48)">(</span>
        dwarf<span style="color:rgb(128,0,128)">::</span>GIEK_TYPE<span style="color:rgb(128,128,48)">,</span> CU<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>getLanguage<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span> <span style="color:rgb(128,128,48)">!</span><span style="color:rgb(128,128,48)">=</span> dwarf<span style="color:rgb(128,0,128)">::</span>DW_LANG_C_plus_plus
                              <span style="color:rgb(128,0,128)">?</span> dwarf<span style="color:rgb(128,0,128)">::</span>GIEL_STATIC
                              <span style="color:rgb(128,0,128)">:</span> dwarf<span style="color:rgb(128,0,128)">::</span>GIEL_EXTERNAL<span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span></pre>

<pre style="font-size:medium"><span style="color:rgb(128,0,128)"><br></span></pre>versus my formatting of:</div><div><br></div><div><pre style="font-size:medium"><span style="color:rgb(128,0,0);font-weight:bold">return</span> dwarf<span style="color:rgb(128,0,128)">::</span>PubIndexEntryDescriptor<span style="color:rgb(128,128,48)">(</span>dwarf<span style="color:rgb(128,0,128)">::</span>GIEK_TYPE<span style="color:rgb(128,128,48)">,</span>
                                          CU<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>getLanguage<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span> <span style="color:rgb(128,128,48)">!</span><span style="color:rgb(128,128,48)">=</span>
                                                  dwarf<span style="color:rgb(128,0,128)">::</span>DW_LANG_C_plus_plus
                                              <span style="color:rgb(128,0,128)">?</span> dwarf<span style="color:rgb(128,0,128)">::</span>GIEL_STATIC
                                              <span style="color:rgb(128,0,128)">:</span> dwarf<span style="color:rgb(128,0,128)">::</span>GIEL_EXTERNAL<span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span></pre>

</div><div><br></div><div>And while maybe this all just screams that if I see what, to me, is an unreadable wall of text it just means that the code should be factored in a more readable fashion, I do find my preferred formatting a bit easier in the average and don't find the more difficult above to be onerously less so.</div>
<div><br></div><div>Enh, maybe we'll just go with "if it still sucks to look at then maybe refactor the code to be less dense and use small temporary variable names". I don't know if that's what you guys are going for though.</div>


<div><br></div><div>-eric</div><div> </div><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 dir="ltr">


<div class="gmail_extra"><div class="gmail_quote"><div><div><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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote">

<div>This sort of thing is what you get with the current indenting scheme (though to be fair, my patch won't fix this particular one). There's no real hierarchical look going on here, and the indenting isn't helping readability. I.e. if we only optimize for "fewer lines and fewer indents" then we get more and more walls of text - especially when we're looking at lots of nested calls with their own breaks at '('. :)</div>




<div>
<div><br></div><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 dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">- We have explicitly changed this for Google style and we are not changing it back. So if this change to submit this change, we need to introduce an additional style option (and I have no idea what to call it ;-) ). Maybe the best choice would be to pull out the actual penalty into something that can be configured per style. E.g.: PenaltyWrapCallAfterParen.</span></div>






<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div></blockquote><div><br></div></div><div>Totally up for that.</div><div><div> </div><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 dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px"></span></div><div><font face="arial, sans-serif">- There is an alternative to consider. In earlier days of clang-format we used hanging identation (we still do with all other binary operators). I.e. the snippet you mention would be formatted as:</font></div>





<div>
<div><font face="arial, sans-serif"><br></font></div><div><font face="courier new, monospace"><span style="font-size:13px">CharSourceRange LineRange = </span><span style="font-size:13px">CharSourceRange::</span><span style="font-size:13px">getTokenRange(</span></font></div>






<div><font face="courier new, monospace"><span style="font-size:13px">                                Line.Tokens.</span><span style="font-size:13px">front().Tok.getLo(),</span><br style="font-size:13px"><span style="font-size:13px">                                Line.Tokens.back().Tok.getLoc(</span><span style="font-size:13px">));</span></font><font face="arial, sans-serif"><br>






</font></div><div><font face="courier new, monospace"><span style="font-size:13px"><br></span></font></div></div><div><span style="font-size:13px"><font face="arial, helvetica, sans-serif">Now, arguably, this is preferable as it is more structured than what clang-format currently does and at the same time does not need three different indentations (which makes it look 'untidy'). That option, however, did not fly in Google style and we had to special-case all assignment expressions. Again, that is something we could change specifically for LLVM style. However, from offline discussions I assume that breaking after the opening parenthesis bothers you in more places. Just wanted to bring this back onto the table as I know Chandler is a big fan :-).</font></span></div>





</div></blockquote><div><br></div></div><div>It's definitely preferable, though as you surmise, not my preference. I prefer groupings of things that are easy to see and in the "prefer breaking after the ( versus breaking after the =" argument the "type and name of the value being assigned into" is always going to lose to "fewer lines" :)</div>





<div><br></div><div>FWIW I've run this patch across quite a bit of code at this point and it largely comes out neutral for code size - the heuristic aspects in the rest of clang format stop it from getting out of control. I think the net across a bunch of files was about 4 lines. Mostly it just changes where we break, it takes some special arguments or longish chains of names to actually increase the indent.</div>





<div><br></div><div>Thanks :)</div><span><font color="#888888"><div><br></div><div>-eric</div></font></span><div><div><div> </div><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 dir="ltr">
<div><span style="font-size:13px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><span style="font-size:13px"><font face="arial, helvetica, sans-serif">Cheers,<br></font></span></div><div><span style="font-size:13px"><font face="arial, helvetica, sans-serif">Daniel</font></span></div>






</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 23, 2013 at 2:46 AM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</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 dir="ltr">Bah. The formatting didn't go in the email as I'd expected.<br>





<br>Before:<br><div><br></div><div>
<ol style="margin:0px 0px 0px 45px;padding:0px 0px 0px 1px;border-width:0px 0px 0px 1px;border-left-style:solid;border-left-color:rgb(204,204,204);font-family:InconsolataMedium,monospace;font-size:13px;line-height:16px;vertical-align:baseline;list-style-position:initial;color:rgb(40,40,40);background-color:rgb(248,248,248)">






<div>
<li style="margin:0px 0px 0px 3px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;white-space:pre-wrap">







<div style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">    <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">CharSourceRange</span> <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">LineRange</span> <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;color:rgb(102,102,102)">=</span> <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">CharSourceRange</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;color:rgb(102,102,102)">::</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">getTokenRange</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">(</span></div>







</li></div><li style="margin:0px 0px 0px 3px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;white-space:pre-wrap">







<div style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">        <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Line</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Tokens</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">front</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">().</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Tok</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">getLo</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">(),</span> <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Line</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Tokens</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">back</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">().</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Tok</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">getLoc</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">());</span></div>







</li><li style="margin:0px 0px 0px 3px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;white-space:pre-wrap">







</li></ol></div><div><br></div><div>After:</div><div><br></div><div><ol style="margin:0px 0px 0px 45px;padding:0px 0px 0px 1px;border-width:0px 0px 0px 1px;border-left-style:solid;border-left-color:rgb(204,204,204);font-family:InconsolataMedium,monospace;font-size:13px;line-height:16px;vertical-align:baseline;list-style-position:initial;color:rgb(40,40,40);background-color:rgb(248,248,248)">







<li style="margin:0px 0px 0px 3px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;white-space:pre-wrap">







<div style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">    <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">CharSourceRange</span> <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">LineRange</span> <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;color:rgb(102,102,102)">=</span></div>







</li><li style="margin:0px 0px 0px 3px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;white-space:pre-wrap">







<div style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">        <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">CharSourceRange</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;color:rgb(102,102,102)">::</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">getTokenRange</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">(</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Line</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Tokens</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">front</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">().</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Tok</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">getLo</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">(),</span></div>







</li><li style="margin:0px 0px 0px 3px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;white-space:pre-wrap">







<div style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">                                       <span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Line</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Tokens</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">back</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">().</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">Tok</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">.</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">getLoc</span><span style="margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline">());</span></div>







</li></ol></div><div><br></div><div>Whee.</div><span><font color="#888888"><div><br></div><div>-eric</div><div><br></div></font></span></div><div><div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Tue, Oct 22, 2013 at 5:37 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</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">Hi Daniel,<br>
<br>
Thought I'd send it out and get some discussion if people care and<br>
then I can update the tests and commit if we think it's a good idea.<br>
<br>
It'll change code like in (one of the) failing tests:<br>
<br>
Value of: format(messUp(Code), Style)<br>
  Actual: "CharSourceRange LineRange =\n<br>
CharSourceRange::getTokenRange(Line.Tokens.front().Tok.getLo(),\n<br>
                             Line.Tokens.back().Tok.getLoc());"<br>
Expected: Code.str()<br>
Which is: "CharSourceRange LineRange =<br>
CharSourceRange::getTokenRange(\n    Line.Tokens.front().Tok.getLo(),<br>
Line.Tokens.back().Tok.getLoc());"<br>
[  FAILED  ] FormatTest.BreaksAfterAssignments (5 ms)<br>
[----------] 1 test from FormatTest (5 ms total)<br>
<br>
this:<br>
<br>
<pre style='color:#000000;background:#ffffff;'><html><body<br>
style='color:#000000; background:#ffffff; '><pre><br>
CharSourceRange LineRange <span style='color:#808030; '>=</span><br>
      CharSourceRange<span style='color:#800080;<br>
'>::</span>getTokenRange<span style='color:#808030;<br>
'>(</span>Line<span style='color:#808030; '>.</span>Tokens<span<br>
style='color:#808030; '>.</span>front<span style='color:#808030;<br>
'>(</span><span style='color:#808030; '>)</span><span<br>
style='color:#808030; '>.</span>Tok<span style='color:#808030;<br>
'>.</span>getLo<span style='color:#808030; '>(</span><span<br>
style='color:#808030; '>)</span><span style='color:#808030; '>,</span><br>
                                     Line<span style='color:#808030;<br>
'>.</span>Tokens<span style='color:#808030; '>.</span>back<span<br>
style='color:#808030; '>(</span><span style='color:#808030;<br>
'>)</span><span style='color:#808030; '>.</span>Tok<span<br>
style='color:#808030; '>.</span>getLoc<span style='color:#808030;<br>
'>(</span><span style='color:#808030; '>)</span><span<br>
style='color:#808030; '>)</span><span style='color:#800080; '>;</span><br>
</pre><br>
<br>
versus:<br>
<br>
<pre style='color:#000000;background:#ffffff;'><html><body<br>
style='color:#000000; background:#ffffff; '><pre><br>
CharSourceRange LineRange <span style='color:#808030; '>=</span><br>
CharSourceRange<span style='color:#800080;<br>
'>::</span>getTokenRange<span style='color:#808030; '>(</span><br>
        Line<span style='color:#808030; '>.</span>Tokens<span<br>
style='color:#808030; '>.</span>front<span style='color:#808030;<br>
'>(</span><span style='color:#808030; '>)</span><span<br>
style='color:#808030; '>.</span>Tok<span style='color:#808030;<br>
'>.</span>getLo<span style='color:#808030; '>(</span><span<br>
style='color:#808030; '>)</span><span style='color:#808030; '>,</span><br>
Line<span style='color:#808030; '>.</span>Tokens<span<br>
style='color:#808030; '>.</span>back<span style='color:#808030;<br>
'>(</span><span style='color:#808030; '>)</span><span<br>
style='color:#808030; '>.</span>Tok<span style='color:#808030;<br>
'>.</span>getLoc<span style='color:#808030; '>(</span><span<br>
style='color:#808030; '>)</span><span style='color:#808030;<br>
'>)</span><span style='color:#800080; '>;</span><br>
</pre><br>
<br>
which while the former is more lines I think it is a much more legible<br>
general formatting style.<br>
<br>
Thoughts?<br>
<span><font color="#888888"><br>
-eric<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>