| @@ -1,89 +1,104 @@ | | | @@ -1,89 +1,104 @@ |
1 | /* $NetBSD: opt_bbb.c,v 1.9 2023/06/17 22:09:24 rillig Exp $ */ | | 1 | /* $NetBSD: opt_bbb.c,v 1.10 2023/06/18 07:29:36 rillig Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Tests for the options '-bbb' and '-nbbb'. | | 4 | * Tests for the options '-bbb' and '-nbbb'. |
5 | * | | 5 | * |
6 | * The option '-bbb' forces a blank line before every block comment. | | 6 | * The option '-bbb' forces a blank line before every block comment. |
7 | * | | 7 | * |
8 | * The option '-nbbb' keeps everything as is. | | 8 | * The option '-nbbb' keeps everything as is. |
9 | */ | | 9 | */ |
10 | | | 10 | |
11 | //indent input | | 11 | //indent input |
12 | /* | | 12 | /* |
13 | * This is a block comment. | | 13 | * This is a block comment. |
14 | */ | | 14 | */ |
15 | /* This is not a block comment since it is single-line. */ | | 15 | /* This is not a block comment since it is single-line. */ |
16 | /* | | 16 | /* |
17 | * This is a second block comment. | | 17 | * This is a second block comment. |
18 | */ | | 18 | */ |
19 | /* This is not a block comment. */ | | 19 | /* This is not a block comment. */ |
20 | /* | | 20 | /* |
21 | * Documentation of global_variable. | | 21 | * Documentation of global_variable. |
22 | */ | | 22 | */ |
23 | int global_variable; | | 23 | int global_variable; |
24 | /* | | 24 | /* |
25 | * Documentation of function_declaration. | | 25 | * Documentation of function_declaration. |
26 | */ | | 26 | */ |
27 | void function_declaration(void); | | 27 | void function_declaration(void); |
28 | /* | | 28 | /* |
29 | * Documentation of function_definition. | | 29 | * Documentation of function_definition. |
30 | */ | | 30 | */ |
31 | void | | 31 | void |
32 | function_definition(void) | | 32 | function_definition(void) |
33 | { | | 33 | { |
34 | } | | 34 | } |
35 | //indent end | | 35 | //indent end |
36 | | | 36 | |
37 | //indent run -bbb | | 37 | //indent run -bbb |
38 | /* | | 38 | /* |
39 | * This is a block comment. | | 39 | * This is a block comment. |
40 | */ | | 40 | */ |
41 | /* This is not a block comment since it is single-line. */ | | 41 | /* This is not a block comment since it is single-line. */ |
42 | | | 42 | |
43 | /* | | 43 | /* |
44 | * This is a second block comment. | | 44 | * This is a second block comment. |
45 | */ | | 45 | */ |
46 | /* This is not a block comment. */ | | 46 | /* This is not a block comment. */ |
47 | | | 47 | |
48 | /* | | 48 | /* |
49 | * Documentation of global_variable. | | 49 | * Documentation of global_variable. |
50 | */ | | 50 | */ |
51 | int global_variable; | | 51 | int global_variable; |
52 | | | 52 | |
53 | /* | | 53 | /* |
54 | * Documentation of function_declaration. | | 54 | * Documentation of function_declaration. |
55 | */ | | 55 | */ |
56 | void function_declaration(void); | | 56 | void function_declaration(void); |
57 | | | 57 | |
58 | /* | | 58 | /* |
59 | * Documentation of function_definition. | | 59 | * Documentation of function_definition. |
60 | */ | | 60 | */ |
61 | void | | 61 | void |
62 | function_definition(void) | | 62 | function_definition(void) |
63 | { | | 63 | { |
64 | } | | 64 | } |
65 | //indent end | | 65 | //indent end |
66 | | | 66 | |
67 | //indent run-equals-input -nbbb | | 67 | //indent run-equals-input -nbbb |
68 | | | 68 | |
69 | | | 69 | |
70 | //indent input | | 70 | //indent input |
71 | { | | 71 | { |
72 | label: /* not a block comment */ | | 72 | label: /* not a block comment */ |
73 | stmt; /* not a block comment */ | | 73 | stmt; /* not a block comment */ |
| | | 74 | label: /* |
| | | 75 | * This is not a block comment, as it goes to the right. |
| | | 76 | */ |
| | | 77 | stmt; /* |
| | | 78 | * This is not a block comment, as it goes to |
| | | 79 | * the right. |
| | | 80 | */ |
74 | /** | | 81 | /** |
75 | * block comment | | 82 | * This is a block comment. |
76 | */ | | 83 | */ |
77 | } | | 84 | } |
78 | //indent end | | 85 | //indent end |
79 | | | 86 | |
80 | //indent run -bbb | | 87 | //indent run -bbb |
81 | { | | 88 | { |
82 | label: /* not a block comment */ | | 89 | label: /* not a block comment */ |
83 | stmt; /* not a block comment */ | | 90 | stmt; /* not a block comment */ |
84 | | | 91 | |
| | | 92 | // $ TODO: No blank line before this comment. |
| | | 93 | label: /* This is not a block comment, as it goes to |
| | | 94 | * the right. */ |
| | | 95 | |
| | | 96 | // $ TODO: No blank line before this comment. |
| | | 97 | stmt; /* This is not a block comment, as it goes to |
| | | 98 | * the right. */ |
| | | 99 | |
85 | /** | | 100 | /** |
86 | * block comment | | 101 | * This is a block comment. |
87 | */ | | 102 | */ |
88 | } | | 103 | } |
89 | //indent end | | 104 | //indent end |