xref: /freebsd/contrib/bmake/unit-tests/cond-op-parentheses.mk (revision dba7b0ef928af88caa38728a73657b837aeeac93)
1*dba7b0efSSimon J. Gerraty# $NetBSD: cond-op-parentheses.mk,v 1.4 2021/01/19 17:49:13 rillig Exp $
22c3632d1SSimon J. Gerraty#
32c3632d1SSimon J. Gerraty# Tests for parentheses in .if conditions.
42c3632d1SSimon J. Gerraty
52c3632d1SSimon J. Gerraty# TODO: Implementation
62c3632d1SSimon J. Gerraty
7e2eeea75SSimon J. Gerraty# Test for deeply nested conditions.
8e2eeea75SSimon J. Gerraty.if	((((((((((((((((((((((((((((((((((((((((((((((((((((((((	\
9e2eeea75SSimon J. Gerraty	((((((((((((((((((((((((((((((((((((((((((((((((((((((((	\
10e2eeea75SSimon J. Gerraty	1								\
11e2eeea75SSimon J. Gerraty	))))))))))))))))))))))))))))))))))))))))))))))))))))))))	\
12e2eeea75SSimon J. Gerraty	))))))))))))))))))))))))))))))))))))))))))))))))))))))))
13e2eeea75SSimon J. Gerraty.  info Parentheses can be nested at least to depth 112.
14e2eeea75SSimon J. Gerraty.else
15e2eeea75SSimon J. Gerraty.  error
16e2eeea75SSimon J. Gerraty.endif
17e2eeea75SSimon J. Gerraty
18*dba7b0efSSimon J. Gerraty# An unbalanced opening parenthesis is a parse error.
19*dba7b0efSSimon J. Gerraty.if (
20*dba7b0efSSimon J. Gerraty.  error
21*dba7b0efSSimon J. Gerraty.else
22*dba7b0efSSimon J. Gerraty.  error
23*dba7b0efSSimon J. Gerraty.endif
24*dba7b0efSSimon J. Gerraty
25*dba7b0efSSimon J. Gerraty# An unbalanced closing parenthesis is a parse error.
26*dba7b0efSSimon J. Gerraty#
27*dba7b0efSSimon J. Gerraty# As of 2021-01-19, CondParser_Term returned TOK_RPAREN even though this
28*dba7b0efSSimon J. Gerraty# function promised to only ever return TOK_TRUE, TOK_FALSE or TOK_ERROR.
29*dba7b0efSSimon J. Gerraty.if )
30*dba7b0efSSimon J. Gerraty.  error
31*dba7b0efSSimon J. Gerraty.else
32*dba7b0efSSimon J. Gerraty.  error
33*dba7b0efSSimon J. Gerraty.endif
34*dba7b0efSSimon J. Gerraty
352c3632d1SSimon J. Gerratyall:
362c3632d1SSimon J. Gerraty	@:;
37