<div dir="ltr">generally the design of clang-format is to only make formatting changes, not adding or removing tokens (there are some exceptions to this, like wrapping string literals). I believe the intent/desire is to have higher level linting operations built on top of clang-format, in clang-tidy or similar.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 27, 2016 at 6:44 PM, phi clang via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</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">Hi,<br><br><div>

<p>I'd like to know if clang-format could be setup to reduce 
non-compound_statement into { non-compound_statement; } in 
iteration_statement.</p>

<pre><code>statement
: labeled_statement
| compound_statement
| expression_statement
| selection_statement
| iteration_statement
| jump_statement
;
iteration_statement
: WHILE '(' expression ')' statement
| DO statement WHILE '(' expression ')' ';'
| FOR '(' expression_statement expression_statement ')' statement
| FOR '(' expression_statement expression_statement expression ')' statement
;
</code></pre>

<p>i.e for construct like if(exp)foo=1; I'd like to get if(exp){foo=1;}
Then the beautifier would indent as needed.</p>

<p>Thanx in advance 
Cheers,
Phi</p>
    </div><br></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>