lsym_lparen_or_lbracket.c revision 1.2 1 1.2 rillig /* $NetBSD: lsym_lparen_or_lbracket.c,v 1.2 2022/02/13 11:07:48 rillig Exp $ */
2 1.1 rillig /* $FreeBSD$ */
3 1.1 rillig
4 1.1 rillig /*
5 1.1 rillig * Tests for the token lsym_lparen_or_lbracket, which represents a '(' or '['
6 1.1 rillig * in these contexts:
7 1.1 rillig *
8 1.1 rillig * In a type name, '(' constructs a function type.
9 1.1 rillig *
10 1.1 rillig * In an expression, '(' starts an inner expression to override the usual
11 1.1 rillig * operator precedence.
12 1.1 rillig *
13 1.1 rillig * In an expression, an identifier followed by '(' starts a function call
14 1.1 rillig * expression.
15 1.1 rillig *
16 1.1 rillig * In a 'sizeof' expression, '(' is required if the argument is a type name.
17 1.1 rillig *
18 1.1 rillig * After one of the keywords 'for', 'if', 'switch' or 'while', the controlling
19 1.1 rillig * expression must be enclosed in '(' and ')'.
20 1.1 rillig *
21 1.1 rillig * In an expression, '(' followed by a type name starts a cast expression.
22 1.1 rillig */
23 1.1 rillig
24 1.1 rillig #indent input
25 1.1 rillig // TODO: add input
26 1.1 rillig #indent end
27 1.1 rillig
28 1.1 rillig #indent run-equals-input
29 1.2 rillig
30 1.2 rillig /* See t_errors.sh, test case 'compound_literal'. */
31