blob: 7b7311d6bc1cf30d68309123b7c025fb5caef278 (
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
|
/* $NetBSD: lsym_return.c,v 1.4 2022/04/24 09:04:12 rillig Exp $ */
/*
* Tests for the token lsym_return, which represents the keyword 'return' that
* starts a 'return' statement for leaving the execution of a function.
*/
/*
* Return statements having a single-line expression are simple to format.
* Since 'return' is not a function name, there is a space between the
* 'return' and the '('.
*/
//indent input
void
function(bool cond)
{
if (cond)
return;
}
int
calculate(int a, int b)
{
return a;
return (b);
return (((a))) + b;
return calculate(b, a);
}
//indent end
//indent run-equals-input
/*
* Returning complex expressions may spread the expression over several lines.
* The exact formatting depends on the option '-lp'.
*/
//indent input
int
multi_line(int a)
{
return calculate(3,
4);
return calculate(
3,
4);
return calculate(
3,
4
);
}
//indent end
//indent run-equals-input
//indent run -nlp
int
multi_line(int a)
{
return calculate(3,
4);
return calculate(
3,
4);
return calculate(
3,
4
);
}
//indent end
|