<div dir="ltr">Submitted as r191375.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 25, 2013 at 5:08 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry, got side-tracked and forget. Will do this now.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Sep 24, 2013 at 5:49 PM, Aaron Wishnick <span dir="ltr"><<a href="mailto:aaron.s.wishnick@gmail.com" target="_blank">aaron.s.wishnick@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ping!</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Sep 13, 2013 at 11:23 AM, Aaron Wishnick <span dir="ltr"><<a href="mailto:aaron.s.wishnick@gmail.com" target="_blank">aaron.s.wishnick@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks. I didn't know about the auto-generation of the docs; that's pretty slick. Sorry about the tabs vs. spaces; I've corrected this in my editor for the future. I don't have commit access, so if you don't mind fixing the style nits, I really appreciate it.</div>


<div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 13, 2013 at 11:19 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>The few nits below aside, this looks good to go in. Do you have commit access or should I commit this for you? In the latter case, you don't need to worry about the style nits (I'll fix them before committing).</div>




<div><br></div><div>+**SpaceBeforeAssignmentOperators** (``bool``)</div><div>+  If ``false``, spaces will be removed before '=', '+=', etc.</div><div>+</div><div><br></div><div>Not, that these are actually auto-generated using a python script. It doesn't hurt like this, but it will be eventually overwritten by what is in the flags comment.</div>




<div><br></div><div><div>+               R.SpaceAfterControlStatementKeyword &&</div><div>+<span style="white-space:pre-wrap">                </span>   SpaceBeforeAssignmentOperators ==</div><div>+<span style="white-space:pre-wrap">            </span>       R.SpaceBeforeAssignmentOperators;</div>




</div><div><br></div><div>These seem to be indented with tabs. Use spaces instead.</div><div><br></div><div><div>+  if (!Style.SpaceBeforeAssignmentOperators &&</div><div>+<span style="white-space:pre-wrap">   </span>  Tok.getPrecedence() == prec::Assignment)<span style="white-space:pre-wrap">      </span></div>




<div>+    return false;</div></div><div><br></div><div>Same as above.</div><div><br></div><div><div><div>+  FormatStyle Spaces = getLLVMStyle();</div><div>+  </div><div>+  verifyFormat("int a = 5;", Spaces);</div>




</div></div><div><br></div><div>There seem to be unnecessary spaces in the empty line.</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 13, 2013 at 4:12 PM, Aaron Wishnick <span dir="ltr"><<a href="mailto:aaron.s.wishnick@gmail.com" target="_blank">aaron.s.wishnick@gmail.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for the feedback! I've addressed those three issues, and the updated patch is attached.</div>




<div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 13, 2013 at 4:12 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You should be able to use "Tok.getPrecedence() == prec::Assignment" instead of the new IsTokenAssignment function. Also, please put the tests into "unittests/Format/FormatTest.cpp". We have plans to turn (some of) those into file-based tests, but for now, I'd like to keep formatting-specific tests together. Also, in addition to actually testing whether the style-configuration works as expected, there are also tests there which test whether the option can be successfully parsed from JSON (see how it is done for the other flags close to the bottom).</div>






<div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Fri, Sep 13, 2013 at 12:14 AM, Aaron Wishnick <span dir="ltr"><<a href="mailto:aaron.s.wishnick@gmail.com" target="_blank">aaron.s.wishnick@gmail.com</a>></span> wrote:<br>






</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">My organization's coding standards include not putting a space before assignment operators, e.g. "int a= 42;". In order for us to be able to use clang-format, we need support for this.<div>






<br>
</div><div>I've attached a patch that adds a new format style option, "SpaceBeforeAssignmentOperators." All the existing hard-coded styles now default to having it set to true. I've also included a test.</div>







<div><br></div><div>Please let me know if this looks good, or if there's anything else I can do.</div><div><br></div><div>Thank you!</div><span><font color="#888888"><div>Aaron</div></font></span></div>

<br></div></div>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>