varmod.mk (bmake-20201101) | : | varmod.mk (bmake-20201117) | ||
---|---|---|---|---|
# $NetBSD: varmod.mk,v 1.3 2020/09/13 07:42:20 rillig Exp $ | # $NetBSD: varmod.mk,v 1.4 2020/11/02 17:30:22 rillig Exp $ | |||
# | # | |||
# Tests for variable modifiers, such as :Q, :S,from,to or :Ufallback. | # Tests for variable modifiers, such as :Q, :S,from,to or :Ufallback. | |||
DOLLAR1= $$ | DOLLAR1= $$ | |||
DOLLAR2= ${:U\$} | DOLLAR2= ${:U\$} | |||
# To get a single '$' sign in the value of a variable expression, it has to | # To get a single '$' sign in the value of a variable expression, it has to | |||
# be written as '$$' in a literal variable value. | # be written as '$$' in a literal variable value. | |||
# | # | |||
# See Var_Parse, where it calls Var_Subst. | # See Var_Parse, where it calls Var_Subst. | |||
skipping to change at line 51 | skipping to change at line 51 | |||
.MAKEFLAGS: -dL | .MAKEFLAGS: -dL | |||
.if ${$$:L} != "" | .if ${$$:L} != "" | |||
. error | . error | |||
.endif | .endif | |||
# A '$' followed by nothing is an error as well. | # A '$' followed by nothing is an error as well. | |||
.if ${:Uword:@word@${word}$@} != "word" | .if ${:Uword:@word@${word}$@} != "word" | |||
. error | . error | |||
.endif | .endif | |||
# The variable modifier :P does not fall back to the SysV modifier. | ||||
# Therefore the modifier :P=RE generates a parse error. | ||||
# XXX: The .error should not be reached since the variable expression is | ||||
# malformed. | ||||
VAR= STOP | ||||
.if ${VAR:P=RE} != "STORE" | ||||
. error | ||||
.endif | ||||
all: # nothing | all: # nothing | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 10 lines changed or added |