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 tests/make: document .MAKE.SAVE_DOLL...



details:   https://anonhg.NetBSD.org/src/rev/1b255975a556
branches:  trunk
changeset: 1026638:1b255975a556
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Dec 03 18:43:52 2021 +0000

description:
tests/make: document .MAKE.SAVE_DOLLARS in modifier ':@'

diffstat:

 usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk |  21 +++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r c4ef825c3dd2 -r 1b255975a556 usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk
--- a/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk  Fri Dec 03 18:29:35 2021 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk  Fri Dec 03 18:43:52 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varname-dot-make-save_dollars.mk,v 1.6 2021/12/02 22:41:01 rillig Exp $
+# $NetBSD: varname-dot-make-save_dollars.mk,v 1.7 2021/12/03 18:43:52 rillig Exp $
 #
 # Tests for the special .MAKE.SAVE_DOLLARS variable, which controls whether
 # the assignment operator ':=' converts '$$' to a single '$' or keeps it
@@ -108,4 +108,23 @@
 .  error
 .endif
 
+
+# In the modifier ':@var@body@', .MAKE.SAVE_DOLLARS does not affect the body.
+# In both cases, each '$$' is replaced with a single '$', no matter whether
+# directly or indirectly via another expression.
+.MAKE.SAVE_DOLLARS=    no
+DOLLARS=               $$$$$$$$
+VAR:=                  ${word:L:@word@$$$$$$$$-${DOLLARS}@}
+.if ${VAR} != "\$\$-\$\$"
+.  error
+.endif
+
+.MAKE.SAVE_DOLLARS=    yes
+DOLLARS=               $$$$$$$$
+VAR:=                  ${word:L:@word@$$$$$$$$-${DOLLARS}@}
+.if ${VAR} != "\$\$-\$\$"
+.  error
+.endif
+
+
 all:



Home | Main Index | Thread Index | Old Index