Home | History | Annotate | Line # | Download | only in indent
opt_l.c revision 1.1
      1 /* $NetBSD: opt_l.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */
      2 /* $FreeBSD$ */
      3 
      4 #indent input
      5 /*
      6  * With a line length of 38, this comment and the next one are broken.
      7  */
      8 
      9 /* The options -l and -lc produce the same output. */
     10 #indent end
     11 
     12 #indent run -l38
     13 /*
     14  * With a line length of 38, this
     15  * comment and the next one are
     16  * broken.
     17  */
     18 
     19 /*
     20  * The options -l and -lc produce the
     21  * same output.
     22  */
     23 #indent end
     24 #indent run-equals-prev-output -lc38
     25 
     26 
     27 #indent input
     28 int decl; /* comment comment comment comment */
     29 #indent end
     30 
     31 #indent run -di8 -c17 -lc32
     32 int	decl;	/* comment comment comment comment */
     33 #indent end
     34 
     35 #indent run -di8 -c17 -l32
     36 int	decl;	/* comment comment
     37 		 * comment comment */
     38 #indent end
     39 
     40 
     41 /*
     42  * FIXME: Even though the line length is limited with -l38,
     43  * the overly long lines in the code are not broken.
     44  */
     45 #indent input
     46 void
     47 example(int a, int b, int c, const char *cp)
     48 {
     49 	for (const char *p = cp; *p != '\0'; p++)
     50 		if (*p > a)
     51 			if (*p > b)
     52 				if (*p > c)
     53 					return;
     54 
     55 	function(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
     56 }
     57 #indent end
     58 
     59 #indent run-equals-input -l38
     60