Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): document limitations of def...



details:   https://anonhg.NetBSD.org/src/rev/7b28defc1894
branches:  trunk
changeset: 957756:7b28defc1894
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Dec 10 16:47:42 2020 +0000

description:
make(1): document limitations of deferred '$' in ':?' modifier

diffstat:

 usr.bin/make/unit-tests/varmod-ifelse.mk |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r a1ca062ca56d -r 7b28defc1894 usr.bin/make/unit-tests/varmod-ifelse.mk
--- a/usr.bin/make/unit-tests/varmod-ifelse.mk  Thu Dec 10 16:36:47 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-ifelse.mk  Thu Dec 10 16:47:42 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-ifelse.mk,v 1.7 2020/12/10 16:36:47 rillig Exp $
+# $NetBSD: varmod-ifelse.mk,v 1.8 2020/12/10 16:47:42 rillig Exp $
 #
 # Tests for the ${cond:?then:else} variable modifier, which evaluates either
 # the then-expression or the else-expression, depending on the condition.
@@ -99,6 +99,11 @@
 # the '$' of the intended '${VAR}' escapes from the parser in form of the
 # expression ${:U\$}.  Because of this escaping, the variable "name" and thus
 # the condition ends up as "${VAR} == value", just as intended.
+#
+# This hack does not work for variables from .for loops since these are
+# expanded at parse time to their corresponding ${:Uvalue} expressions.
+# Making the '$' of the '${VAR}' expression indirect hides this expression
+# from the parser of the .for loop body.  See SubstVarLong.
 .MAKEFLAGS: -dc
 VAR=   value
 .if ${ ${:U\$}{VAR} == value :?ok:bad} != "ok"



Home | Main Index | Thread Index | Old Index