Home | History | Annotate | Line # | Download | only in indent
opt_fcb.c revision 1.3
      1 /* $NetBSD: opt_fcb.c,v 1.3 2021/10/16 21:32:10 rillig Exp $ */
      2 /* $FreeBSD$ */
      3 
      4 /*
      5  * Tests for the options '-fcb' and '-nfcb'.
      6  *
      7  * The option '-fcb' formats block comments (ones that begin with '/' '*'
      8  * '\n').
      9  *
     10  * The option '-nfcb' formats block comments like other box comments.
     11  */
     12 
     13 /* FIXME: The options -fcb and -nfcb result in exactly the same output. */
     14 
     15 #indent input
     16 /* Not
     17  *
     18  * so carefully
     19  * formatted
     20  *      comment */
     21 
     22 /*-
     23  * car         mat         men
     24  *    efu   for   ted   com   t
     25  *       lly         box       .
     26  */
     27 #indent end
     28 
     29 #indent run -fcb
     30 /*
     31  * Not
     32  *
     33  * so carefully formatted comment
     34  */
     35 
     36 /*-
     37  * car         mat         men
     38  *    efu   for   ted   com   t
     39  *       lly         box       .
     40  */
     41 #indent end
     42 
     43 #indent run -nfcb
     44 /*
     45  * Not
     46  *
     47  * so carefully formatted comment
     48  */
     49 
     50 /*-
     51  * car         mat         men
     52  *    efu   for   ted   com   t
     53  *       lly         box       .
     54  */
     55 #indent end
     56 
     57 
     58 #indent input
     59 void
     60 example(void)
     61 {
     62 	/* Not
     63 	 *
     64 	 * so carefully
     65 	 * formatted
     66 	 *      comment */
     67 
     68 	/*-
     69 	 * car         mat         men
     70 	 *    efu   for   ted   com   t
     71 	 *       lly         box       .
     72 	 */
     73 }
     74 #indent end
     75 
     76 #indent run -fcb
     77 void
     78 example(void)
     79 {
     80 	/*
     81 	 * Not
     82 	 *
     83 	 * so carefully formatted comment
     84 	 */
     85 
     86 	/*-
     87 	 * car         mat         men
     88 	 *    efu   for   ted   com   t
     89 	 *       lly         box       .
     90 	 */
     91 }
     92 #indent end
     93 
     94 #indent run -nfcb
     95 void
     96 example(void)
     97 {
     98 	/*
     99 	 * Not
    100 	 *
    101 	 * so carefully formatted comment
    102 	 */
    103 
    104 	/*-
    105 	 * car         mat         men
    106 	 *    efu   for   ted   com   t
    107 	 *       lly         box       .
    108 	 */
    109 }
    110 #indent end
    111