www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D Tidy? (If you don't already have one) - DTidy.js

This horrible wretch of a script in WScript (for Windows) 
will do some things (not enough) to prettify some D code.  
It doesn't (for me) mangle any of the code.

Just thought I'd post it for the sake of helping those without,
and maybe as a hint that (if we don't already have one lying around)
we might want one.


begin 0644 DTidy.js
M#0I&:6QE(#T >PT*("` (&]P96XZ(&9U;F-T:6]N*'!A=& I>PT*("` ("` 
M("!V87( 9G-O(#T ;F5W($%C=&EV95A/8FIE8W0H(E-C<FEP=&EN9RY&:6QE
M4WES=&5M3V)J96-T(BD[#0H ("` ("` ('9A<B!T<R`](&9S;RY/<&5N5&5X
M=$9I;&4H<&%T:"PQ*3L-"B` ("` ("` =F%R('-T<B`]('1S+E)E861!;&PH
M*3L-"B` ("` ("` =',N0VQO<V4H*3L-"B` ("` ("` <F5T=7)N('-T<CL-
M"B` ("!]+`T*("` ('-A=F4Z(&9U;F-T:6]N*'!A=& L<W1R+&%P<&5N9$9L
M86<I>PT*("` ("` ("!V87( 9G-O(#T ;F5W($%C=&EV95A/8FIE8W0H(E-C
M<FEP=&EN9RY&:6QE4WES=&5M3V)J96-T(BD[#0H ("` ("` ('9A<B!T<R`]
M(&9S;RY/<&5N5&5X=$9I;&4H<&%T:"PH87!P96YD1FQA9S\ .#HR*2PQ*3L-
M"B` ("` ("` =',N5W)I=&4H<W1R*3L-"B` ("` ("` =',N0VQO<V4H*3L-
M"B` ("!]#0I].PT*#0IM86EN(#T 9G5N8W1I;VXH<W1R96%M*7L-"B` ("`-
M"B` ("`O+R!B;W1T;VT =&\ =&]P("AR971U<FX ;W)D97(I#0H ("` <W1R
M96%M(#T <W1R96%M+G)E<&QA8V4H+UM<="!=*R]G;2PG("<-"B` ("` ("` 
M*2YR97!L86-E*"]<>R]G+")<;GLB*R)<;B(-"B` ("` ("` *2YR97!L86-E
M*"]<?2]G+")<;GTB*R)<;B(-"B` ("` ("` *2YR97!L86-E*"\[+V<L(CLB
M*R)<;B(-"B` ("` ("` *2YR97!L86-E*"]<+UPJ+V<L(EQN+RHB*R)<;B(-
M"B` ("` ("` *2YR97!L86-E*"]<*EPO+V<L(EQN*B\B*R)<;B(-"B` ("` 
M("` *2YR97!L86-E*"]<<RI;7&Y<<EQF72M<<RHO9VTL(EQN(BD[#0H ("` 
M+RH-"B` ("` ("` 06QL(&]F(&]U<B!I;F1E;G1A=&EO;B!I<R!N;W< <F5M
M;W9E9"X (`T*("` ("` ("![?2=S(&%L;"!S=&%R="!A="!T:&4 9FER<W0 
M8VAA<F%C=&5R(&]N('1H92!L:6YE+ T*("` ("` ("!%=F5R>2!L:6YE(&ES
M(#P](#$ <W1A=&5M96YT.R!T:&5Y(&-A;B!S=&EL;"!B92!M=6QT:2UL:6YE
M9"X-"B` ("` ("` 5V4 86QS;R!R96UO=F5D(&5X=')A(&YE=VQI;F4 8VAA
M<F%C=&5R<RX-"B` ("` ("` #0H ("` ("` (%1H92!N97AT('-T97` :7, 
M=&\ <&5R9F]R;2!I;F1E;G1A=&EO;B!B87-E9"!O;B!T:&4 >WT 9&5P=& N
M#0H ("` *B\-"B` ("!V87( =&%B<R`]("(B.PT*("` (&9O<BAI(#T ,#L 
M:2`\('-T<F5A;2YL96YG=& M,3L :2LK*7L +R\ =&AE("TQ(&UE86YS('=E
M(&1O;B=T(&AA=F4 =&\ 8VAE8VL ='=I8V4L(&%N9"!I<R!A;B!I;7!O<W-I
M8FQE(&EN9&5N=&%T:6]N(&-O;F1I=&EO;BX-"B` ("` ("` :68H<W1R96%M
M+F-H87)!="AI*2`]/2`G>R<I>PT*("` ("` ("` ("` =&%B<R`K/2`B7'0B
M.PT*("` ("` ("` ("` 8V]N=&EN=64[#0H ("` ("` ('T-"B` ("` ("` 
M:68H<W1R96%M+F-H87)!="AI*2`]/2`G?2<I>PT*("` ("` ("` ("` :68H
M=&%B<RYL96YG=&  /3T ,"E[#0H ("` ("` ("` ("` ("` 5U-C<FEP="Y%
M8VAO*"=9;W4 :&%V92!M;W)E('T 8VAA<F%C=&5R<R!T:&%N('L 8VAA<F%C
M=&5R<R!A="!S;VUE('!O:6YT+"<K#0H ("` ("` ("` ("` ("` ("` ("=S
M;R!)(&-O=6QD;EPG="!I;F1E;G0 <')O<&5R;'DN("!4:&4 <')O9W)A;2!P
M<F]B86)L>2!W;VY<)W0 8V]M<&EL92XG*3L-"B` ("` ("` ("` ("` ("!R
M971U<FX <W1R96%M.R`O+R!S=&]P(&EN9&5N=&EN9RP =&AE<F4G<R!A('-Y
M;G1A>"!E<G)O<BX-"B` ("` ("` ("` ('T-"B` ("` ("` ("` ('1A8G, 
M/2!T86)S+G-U8G-T<B Q*3L-"B` ("` ("` ("` ('-T<F5A;2`]('-T<F5A
M;2YS=6)S='(H,"QI+3$I*R)](BLB7&XB*W-T<F5A;2YS=6)S=')I;F<H:2LQ
M*3L-"B` ("` ("` ("` ("\O(&AO=R!T:&4 :&5C:R!D;R!)(&=E="!R:60 
M;V8 =&AE(&YE=VQI;F4 869T97( =&AE(&5N9&)R86-K970 <F5L:6%B;'D_
M#0H ("` ("` ("` ("!C;VYT:6YU93L-"B` ("` ("` ?0T*("` ("` ("!I
M9BAS=')E86TN8VAA<D%T*&DI(#T](")<;B(I>PT*("` ("` ("` ("` <W1R
M96%M(#T <W1R96%M+G-U8G-T<B P+&DK,2DK=&%B<RMS=')E86TN<W5B<W1R
M:6YG*&DK,2D[#0H ("` ("` ('T-"B` ("!]#0H ("` <W1R96%M(#T <W1R
M96%M+G)E<&QA8V4H+UQS*EM<;EQR7&9=*R]G;2PB7&XB#0H ("` ("` ("DN
M<F5P;&%C92 O7'U;7'-<;ETJ+"]G;2PG?2PG*3L-"B` ("!R971U<FX <W1R
M96%M.PT*?0T*#0I&:6QE+G-A=F4H5U-C<FEP="Y!<F=U;65N=',H,"DL;6%I
F;BA&:6QE+F]P96XH5U-C<FEP="Y!<F=U;65N=',H,"DI*2D[#0HH
`
end
Oct 25 2005