xref: /netbsd-src/tests/usr.bin/indent/psym_while_expr.c (revision 0e2e28bced52bda3788c857106bde6c44d2df3b8)
1 /* $NetBSD: psym_while_expr.c,v 1.5 2023/06/02 15:07:46 rillig Exp $ */
2 
3 /*
4  * Tests for the parser symbol psym_while_expr, which represents the keyword
5  * 'while' followed by the controlling expression, now waiting for the
6  * statement of the loop body.
7  */
8 
9 //indent input
10 // TODO: add input
11 //indent end
12 
13 //indent run-equals-input
14 
15 
16 //indent input
17 void
18 function(void)
19 {
20 	while(cond){}
21 
22 	do{}while(cond);
23 
24 	if(cmd)while(cond);
25 
26 	{}while(cond);
27 }
28 //indent end
29 
30 //indent run
31 void
32 function(void)
33 {
34 	while (cond) {
35 	}
36 
37 	do {
38 	} while (cond);
39 
40 	if (cmd)
41 		while (cond);
42 
43 	{
44 	}
45 	while (cond);
46 }
47 //indent end
48