home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / indent / projects < prev    next >
Text File  |  2000-03-14  |  3KB  |  127 lines

  1. * Remove support for `+' option prefix.
  2.  
  3. * Consider leaving any whitespace before '#'.
  4.  
  5. * Consider an option to use spaces rather than tabs in output.
  6.  
  7. * 'whitesmiths style', apparently after the examples shipped with
  8.   that firm's compiler.  It differs from the GNU style mainly in that
  9.   the statements inside braces are lined up with the braces.  E.g.:
  10.  
  11.   int main(int argc, char *argv[])
  12.       {
  13.       if (argc <= 1)
  14.       printf("No args\n");
  15.       else
  16.       {
  17.       switch (argc)
  18.           {
  19.           case 2:
  20.           printf("One arg\n");
  21.           break;
  22.           default:
  23.           printf("Lotsa args\n");
  24.           break;
  25.           }
  26.       }
  27.       return EXIT_SUCCESS;
  28.       }
  29.  
  30. * Perhaps indent could process C++ comments ("//")?  Apparently, some versions
  31.   of C use this as well.
  32.  
  33. * Someone requested an option to keep cases statments all on one line.
  34.  
  35. * Consider an option to produce "char* c" rather than  "char *c"
  36.  
  37. *  There is no way to specify that a unary & (as in address-of
  38.    operator) not preceed it's argument by a space.
  39. [rms: I agree that is a desirable mode we should support somehow.]
  40.  
  41.  
  42. *  It would be nice to have a different line length for comments than
  43.    for code.
  44. [rms: I agree that is a desirable mode we should support somehow.
  45. It should not be terribly hard.]
  46.  
  47.  
  48. *  Indent gets confused by a multiple "C" statements nested in a macro:
  49.  
  50.    This line:
  51.  
  52.     CHECK_ZERO(rpmsg->rip_res, tracef(" reserved fields not zero"); break );
  53.  
  54.    yields these errors:
  55.  
  56.     ../rip.c: 115: Unbalanced parens
  57.     ../rip.c: 115: Line broken
  58.     ../rip.c: 115: Extra )
  59.  
  60. [rms: Code like this appears in other programs too.
  61. For example, toplev.c in GCC.  So it is important not to get too upset
  62. when things like this appear in the input.]
  63.  
  64.  
  65. Add a new option specifying how goto labels are indented.
  66.  
  67. Make it so that the line numbers indent reports are the real line
  68. numbers (currently it is often off by a few).
  69.  
  70. Error recover should probably be enhanced.  At a minimum, "indent
  71. foo.c" should not overwrite foo.c when it gets an error.  Fancy error
  72. recover is probably not worth the effort because indent is pretty
  73. fast.  Stopping after the first error might be more helpful than the
  74. current error cascades.
  75.  
  76. Make the -nss option cause
  77.   while (foo)
  78.     ;
  79. This is the real alternative to 
  80.   while (foo) ;
  81.  
  82. Look at all the undocumented options, and determine which of them are
  83. bug-free enough that they should be documented.
  84.  
  85.     1) Is it possible to control how indent puts white space *within*
  86. an expression?  I notice that "(x*y<5)" comes out like "(x * y < 5)".  Can
  87. I configure "indent" to put spaces around "the following list of characters"
  88. and do not put spaces around "the following list of characters"?  I.E. Can
  89. I make it put spaces around "< > + - || &&" and *not* put spaces around
  90. "* / ^ &", etc. ?
  91.  
  92.  
  93. Consider leaving the spacing between the preprocessor
  94. # and the "if", "endif", etc. and indent that line as if it were
  95. a regular if () in C.
  96.  
  97. Thus, given
  98.  
  99. main()
  100. {
  101.     int x = 1, y = 1, z = 1;
  102.     if (x)
  103.     if (y)
  104.         if (z)
  105. #        ifdef FOO
  106.             printf("hello\n");
  107. #        else FOO
  108.             printf("world\n");
  109. #        endif FOO
  110. }
  111.  
  112.  
  113.  
  114. main()
  115. {
  116.     int             x = 1, y = 1, z = 1;
  117.     if (x)
  118.     if (y)
  119.         if (z)
  120. #               ifdef FOO
  121.             printf("hello\n");
  122. #               else    /* FOO */
  123.             printf("world\n");
  124. #               endif    /* FOO */
  125. }
  126.  
  127.