Or improve your google-fu by finding some existing tools that do the job right. :)<br><br>I'm pretty sure Uncrustify is good at most of these issues, not to mention it's a very nice source-code "prettifier/indenter". There's a front-end called UniversalIndentGUI, which has about a dozen integrated versions of source-code prettifiers (including uncrustify, and for many languages). It has varios settings on the left, and togglable *Live* preview mode which you can view on the right.<br>
<br>I invite you guys to try it out sometime:<br><br><a href="http://universalindent.sourceforge.net/">http://universalindent.sourceforge.net/</a><br><br>(+ you can save different settings which is neat when you're coding for different projects that have different "code design & look" standards)<br>
<br><div class="gmail_quote">On Sat, Aug 7, 2010 at 3:50 AM, Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 08/06/2010 08:34 PM, Walter Bright wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I wrote these two trivial utilities for the purpose of canonicalizing<br>
source code before checkins and to deal with FreeBSD's inability to deal<br>
with CRLF line endings, and because I can never figure out the right<br>
settings for git to make it do the canonicalization.<br>
<br>
tolf - converts LF, CR, and CRLF line endings to LF.<br>
<br>
detab - converts all tabs to the correct number of spaces. Assumes tabs<br>
are 8 column tabs. Removes trailing whitespace from lines.<br>
<br>
Posted here just in case someone wonders what they are.<br>
</blockquote></div>
[snip]<br>
<br>
Nice, though they don't account for multiline string literals.<br>
<br>
A good exercise would be rewriting these tools in idiomatic D2 and assess the differences.<br><font color="#888888">
<br>
<br>
Andrei<br>
</font></blockquote></div><br>