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): fix typo and reasoning in t...



details:   https://anonhg.NetBSD.org/src/rev/d97338a71a87
branches:  trunk
changeset: 956665:d97338a71a87
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Nov 04 05:10:01 2020 +0000

description:
make(1): fix typo and reasoning in test varparse-undef-partial.mk

diffstat:

 usr.bin/make/unit-tests/varparse-undef-partial.mk |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 1c0b83e58382 -r d97338a71a87 usr.bin/make/unit-tests/varparse-undef-partial.mk
--- a/usr.bin/make/unit-tests/varparse-undef-partial.mk Wed Nov 04 04:49:32 2020 +0000
+++ b/usr.bin/make/unit-tests/varparse-undef-partial.mk Wed Nov 04 05:10:01 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varparse-undef-partial.mk,v 1.2 2020/09/27 09:53:41 rillig Exp $
+# $NetBSD: varparse-undef-partial.mk,v 1.3 2020/11/04 05:10:01 rillig Exp $
 
 # When an undefined variable is expanded in a ':=' assignment, only the
 # initial '$' of the variable expression is skipped by the parser, while
@@ -9,7 +9,7 @@
 DEF=   defined
 PARAM= :Q
 
-# The expression ${VAR.{PARAM}} refers to the variable named "VAR.:Q",
+# The expression ${VAR.${PARAM}} refers to the variable named "VAR.:Q",
 # with the ":Q" being part of the name.  This variable is not defined,
 # therefore the initial '$' of that whole expression is skipped by the
 # parser (see Var_Subst, the Buf_AddByte in the else branch) and the rest
@@ -28,15 +28,15 @@
 ${:UVAR.\:Q}=  var-dot with parameter :Q
 
 # At this point, the variable "VAR." is defined, therefore the expression
-# ${VAR.:Q} is expanded as usual.
+# ${VAR.:Q} is expanded, consisting of the variable name "VAR." and the
+# modifier ":Q".
 .if ${EVAL} != "defined  var-dot\\ without\\ parameter end"
 .  error ${EVAL}
 .endif
 
 # In contrast to the previous line, evaluating the original LIST again now
-# produces a different result since the ":Q" has already been inserted
-# literally into the expression.  The variable named "VAR.:Q" is defined,
-# therefore it is resolved as usual.  The ":Q" is interpreted as part of the
+# produces a different result since the variable named "VAR.:Q" is now
+# defined.  It is expanded as usual, interpreting the ":Q" as part of the
 # variable name, as would be expected from reading the variable expression.
 EVAL:= ${LIST}
 .if ${EVAL} != "defined  var-dot with parameter :Q end"



Home | Main Index | Thread Index | Old Index