home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / i / indnt16.zip / indent-1.6 / Projects < prev    next >
Text File  |  1992-07-01  |  3KB  |  121 lines

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