blob: ec3a42d04c030c4eeaf91cdc19e9350d8cf3e749 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
/* $NetBSD: opt_ce.c,v 1.7 2023/05/11 09:28:53 rillig Exp $ */
/*
* Tests for the options '-ce' and '-nce'.
*
* The option '-ce' places the 'else' on the same line as the preceding '}'.
*
* The option '-nce' places the 'else' on the next line.
*
* See also:
* opt_ei.c
*/
//indent input
void
example(int n)
{
if (n > 99) {
print("large");
} else if (n > 9) {
print("double-digit");
} else if (n > 0)
print("positive");
else {
print("negative");
}
}
//indent end
//indent run-equals-input -ce
//indent run -nce
void
example(int n)
{
if (n > 99) {
print("large");
}
else if (n > 9) {
print("double-digit");
}
else if (n > 0)
print("positive");
else {
print("negative");
}
}
//indent end
//indent input
void
example(int n)
{
if (n > 99) { print("large"); }
else if (n > 9) { print("double-digit"); }
else if (n > 0) print("positive");
else { print("negative"); }
}
//indent end
/*
* TODO: Remove the newline between '}' and 'else'.
*/
//indent run -ce
void
example(int n)
{
if (n > 99) {
print("large");
}
else if (n > 9) {
print("double-digit");
}
else if (n > 0)
print("positive");
else {
print("negative");
}
}
//indent end
//indent run-equals-prev-output -nce
|