blob: 93c01cfb38119b225a281b0d01ad1981d3943e79 (
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
|
/* $NetBSD: psym_if_expr_stmt.c,v 1.4 2022/04/24 09:04:12 rillig Exp $ */
/*
* Tests for the parser symbol psym_if_expr_stmt, which represents the state
* after reading the keyword 'if', the controlling expression and the
* statement for the 'then' branch.
*
* At this point, the 'if' statement is not necessarily complete, it can be
* completed with the keyword 'else' followed by a statement.
*
* Any token other than 'else' completes the 'if' statement.
*/
//indent input
void
function(void)
{
if (cond)
stmt();
if (cond)
stmt();
else /* belongs to the second 'if' */
stmt();
}
//indent end
//indent run-equals-input
|