cond-op-parentheses.mk revision 1.4 1 # $NetBSD: cond-op-parentheses.mk,v 1.4 2021/01/19 17:49:13 rillig Exp $
2 #
3 # Tests for parentheses in .if conditions.
4
5 # TODO: Implementation
6
7 # Test for deeply nested conditions.
8 .if (((((((((((((((((((((((((((((((((((((((((((((((((((((((( \
9 (((((((((((((((((((((((((((((((((((((((((((((((((((((((( \
10 1 \
11 )))))))))))))))))))))))))))))))))))))))))))))))))))))))) \
12 ))))))))))))))))))))))))))))))))))))))))))))))))))))))))
13 . info Parentheses can be nested at least to depth 112.
14 .else
15 . error
16 .endif
17
18 # An unbalanced opening parenthesis is a parse error.
19 .if (
20 . error
21 .else
22 . error
23 .endif
24
25 # An unbalanced closing parenthesis is a parse error.
26 #
27 # As of 2021-01-19, CondParser_Term returned TOK_RPAREN even though this
28 # function promised to only ever return TOK_TRUE, TOK_FALSE or TOK_ERROR.
29 .if )
30 . error
31 .else
32 . error
33 .endif
34
35 all:
36 @:;
37