1/* $NetBSD: lsym_rparen_or_rbracket.c,v 1.8 2023/06/16 14:26:27 rillig Exp $ */
2
3/*
4 * Tests for the token lsym_rparen_or_lbracket, which represents ')' or ']',
5 * the counterparts for '(' and '['.
6 *
7 * See also:
8 *	lsym_lparen_or_lbracket.c
9 */
10
11//indent input
12int var = (3);
13int cast = (int)3;
14int cast = (int)(3);
15int call = function(3);
16int array[3] = {1, 2, 3};
17int array[3] = {[2] = 3};
18//indent end
19
20//indent run-equals-input -di0
21
22
23//indent input
24int a = array[
253
26];
27{
28int a = array[
293
30];
31}
32//indent end
33
34//indent run -di0
35int a = array[
36	      3
37];
38{
39	int a = array[
40		      3
41// $ FIXME: Should be one level to the left since it is the outermost bracket.
42		];
43}
44//indent end
45
46//indent run -di0 -nlp
47int a = array[
48	3
49];
50{
51	int a = array[
52		3
53// $ FIXME: Should be one level to the left since it is the outermost bracket.
54		];
55}
56//indent end
57
58
59/*
60 * Cast expressions and compound expressions, taken from lint and make.
61 */
62//indent input
63// This ')' is not a cast.
64char *Buf_DoneData(Buffer *) MAKE_ATTR_USE;
65
66{
67	dcs_align((u_int)dcs);
68	mpools.pools[i] = (memory_pool){NULL, 0, 0};
69	list_add(l, (const char[3]){'-', (char)c, '\0'});
70}
71//indent end
72
73//indent run-equals-input -ci4 -di0 -nlp
74