home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
indent-1.9.1-src.tgz
/
tar.out
/
fsf
/
indent
/
Projects
< prev
next >
Wrap
Text File
|
1996-09-28
|
4KB
|
135 lines
* wishlist from tarjeij@ulrik.uio.no
struct a { /* Cuddling variable with declaration independent of other */
int b; /* settings */
} c;
if (condition) /* Force a blank line after single statement ifs. */
whatever; /* force single statment to begin on new line */
while (*c = *p) /* Force semicolon on new line. Same with for and if */
; /* (Force single statement while, do, to begin statement
/* on new line) */
* Consider an option to use spaces rather than tabs in output.
* 'whitesmiths style', apparently after the examples shipped with
that firm's compiler. It differs from the GNU style mainly in that
the statements inside braces are lined up with the braces. E.g.:
int main(int argc, char *argv[])
{
if (argc <= 1)
printf("No args\n");
else
{
switch (argc)
{
case 2:
printf("One arg\n");
break;
default:
printf("Lotsa args\n");
break;
}
}
return EXIT_SUCCESS;
}
* Someone requested an option to keep cases statments all on one line.
* Consider an option to produce "char* c" rather than "char *c"
* There is no way to specify that a unary & (as in address-of
operator) not preceed it's argument by a space.
[rms: I agree that is a desirable mode we should support somehow.]
* It would be nice to have a different line length for comments than
for code.
[rms: I agree that is a desirable mode we should support somehow.
It should not be terribly hard.]
* Indent gets confused by a multiple "C" statements nested in a macro:
This line:
CHECK_ZERO(rpmsg->rip_res, tracef(" reserved fields not zero"); break );
yields these errors:
../rip.c: 115: Unbalanced parens
../rip.c: 115: Line broken
../rip.c: 115: Extra )
[rms: Code like this appears in other programs too.
For example, toplev.c in GCC. So it is important not to get too upset
when things like this appear in the input.]
Add a new option specifying how goto labels are indented.
Make it so that the line numbers indent reports are the real line
numbers (currently it is often off by a few).
Error recover should probably be enhanced. At a minimum, "indent
foo.c" should not overwrite foo.c when it gets an error. Fancy error
recover is probably not worth the effort because indent is pretty
fast. Stopping after the first error might be more helpful than the
current error cascades.
Make the -nss option cause
while (foo)
;
This is the real alternative to
while (foo) ;
Look at all the undocumented options, and determine which of them are
bug-free enough that they should be documented.
1) Is it possible to control how indent puts white space *within*
an expression? I notice that "(x*y<5)" comes out like "(x * y < 5)". Can
I configure "indent" to put spaces around "the following list of characters"
and do not put spaces around "the following list of characters"? I.E. Can
I make it put spaces around "< > + - || &&" and *not* put spaces around
"* / ^ &", etc. ?
Consider leaving the spacing between the preprocessor
# and the "if", "endif", etc. and indent that line as if it were
a regular if () in C.
Thus, given
main()
{
int x = 1, y = 1, z = 1;
if (x)
if (y)
if (z)
# ifdef FOO
printf("hello\n");
# else FOO
printf("world\n");
# endif FOO
}
main()
{
int x = 1, y = 1, z = 1;
if (x)
if (y)
if (z)
# ifdef FOO
printf("hello\n");
# else /* FOO */
printf("world\n");
# endif /* FOO */
}