summaryrefslogtreecommitdiff
path: root/tests/usr.bin/indent/opt_T.c
blob: e9ce35e2bd14faa217c184779c05a5747ae1f4ad (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
/* $NetBSD: opt_T.c,v 1.5 2023/06/17 22:09:24 rillig Exp $ */

/*
 * Tests for the option '-T', which specifies a single identifier that indent
 * will recognize as a type name.  This affects the formatting of
 * syntactically ambiguous expressions that could be casts or multiplications,
 * among others.
 */

//indent input
int cast = (custom_type_name)   *   arg;

int mult = (unknown_type_name)   *   arg;

/* See the option -ta for handling these types. */
int suff = (unknown_type_name_t)   *   arg;
//indent end

//indent run -Tcustom_type_name -di0
int cast = (custom_type_name)*arg;

int mult = (unknown_type_name) * arg;

/* See the option -ta for handling these types. */
int suff = (unknown_type_name_t) * arg;
//indent end

//indent run -Tcustom_type_name -di0 -cs
int cast = (custom_type_name) *arg;

int mult = (unknown_type_name) * arg;

/* See the option -ta for handling these types. */
int suff = (unknown_type_name_t) * arg;
//indent end


/*
 * The keyword table has precedence over the custom-specified types; otherwise,
 * the following lines would be declarations, and the declarators would be
 * indented by 16.
 */
//indent input
{
	break x;
	continue x;
	goto x;
	return x;
}
//indent end

//indent run-equals-input -Tbreak -Tcontinue -Tgoto -Treturn