head	1.21;
access;
symbols
	netbsd-10-2-RELEASE:1.7
	netbsd-11-0-RELEASE:1.21
	netbsd-11-0-RC7:1.21
	netbsd-11-0-RC6:1.21
	netbsd-11-0-RC5:1.21
	netbsd-11-0-RC4:1.21
	netbsd-11-0-RC3:1.21
	netbsd-11-0-RC2:1.21
	netbsd-11-0-RC1:1.21
	perseant-exfatfs-base-20250801:1.21
	netbsd-11:1.21.0.2
	netbsd-11-base:1.21
	netbsd-10-1-RELEASE:1.7
	perseant-exfatfs-base-20240630:1.11
	perseant-exfatfs:1.11.0.2
	perseant-exfatfs-base:1.11
	netbsd-10-0-RELEASE:1.7
	netbsd-10-0-RC6:1.7
	netbsd-10-0-RC5:1.7
	netbsd-10-0-RC4:1.7
	netbsd-10-0-RC3:1.7
	netbsd-10-0-RC2:1.7
	netbsd-10-0-RC1:1.7
	netbsd-10:1.7.0.2
	netbsd-10-base:1.7
	cjep_sun2x-base1:1.4
	cjep_sun2x:1.4.0.4
	cjep_sun2x-base:1.4
	cjep_staticlib_x-base1:1.4
	cjep_staticlib_x:1.4.0.2
	cjep_staticlib_x-base:1.4;
locks; strict;
comment	@# @;


1.21
date	2025.06.28.22.39.29;	author rillig;	state Exp;
branches;
next	1.20;
commitid	CDDpACH2g2jV3I0G;

1.20
date	2025.03.30.09.51.51;	author rillig;	state Exp;
branches;
next	1.19;
commitid	veGmSzVhPiW2G4PF;

1.19
date	2025.03.29.23.50.07;	author rillig;	state Exp;
branches;
next	1.18;
commitid	Ev93dfuVFJsbm1PF;

1.18
date	2025.03.29.21.30.47;	author rillig;	state Exp;
branches;
next	1.17;
commitid	STEUfZHb8FeWB0PF;

1.17
date	2025.03.29.19.08.53;	author rillig;	state Exp;
branches;
next	1.16;
commitid	y95n9TsA04p0PZOF;

1.16
date	2024.08.29.20.20.37;	author rillig;	state Exp;
branches;
next	1.15;
commitid	EaMgk7FrF8mB1LnF;

1.15
date	2024.07.20.08.54.19;	author rillig;	state Exp;
branches;
next	1.14;
commitid	LxRHKpgnkLfGwyiF;

1.14
date	2024.07.05.19.47.22;	author rillig;	state Exp;
branches;
next	1.13;
commitid	ey8c5i7vJGMuCGgF;

1.13
date	2024.07.05.18.59.33;	author rillig;	state Exp;
branches;
next	1.12;
commitid	GYmxMWv9KnPylGgF;

1.12
date	2024.07.04.18.53.37;	author rillig;	state Exp;
branches;
next	1.11;
commitid	7qUZd0dIKoMjlygF;

1.11
date	2024.04.20.10.18.56;	author rillig;	state Exp;
branches
	1.11.2.1;
next	1.10;
commitid	2fCjOO5HMlf2VR6F;

1.10
date	2023.11.19.22.06.15;	author rillig;	state Exp;
branches;
next	1.9;
commitid	orhWVt8YK9haKgNE;

1.9
date	2023.06.01.20.56.35;	author rillig;	state Exp;
branches;
next	1.8;
commitid	j3tIvMRlxolKQhrE;

1.8
date	2023.02.14.21.56.48;	author rillig;	state Exp;
branches;
next	1.7;
commitid	NFr45lm31yW8DxdE;

1.7
date	2022.08.24.22.09.41;	author rillig;	state Exp;
branches;
next	1.6;
commitid	NKCkzSrs818TdbRD;

1.6
date	2022.08.24.21.38.06;	author rillig;	state Exp;
branches;
next	1.5;
commitid	rcUgMIfWuC7m7bRD;

1.5
date	2022.01.24.22.59.49;	author rillig;	state Exp;
branches;
next	1.4;
commitid	60SMD2FrXLT5oWpD;

1.4
date	2021.02.23.15.19.41;	author rillig;	state Exp;
branches;
next	1.3;
commitid	wGJlKlrQTIQeBQIC;

1.3
date	2020.12.20.19.47.34;	author rillig;	state Exp;
branches;
next	1.2;
commitid	OfU1BUgRB8hOawAC;

1.2
date	2020.12.01.20.15.23;	author rillig;	state Exp;
branches;
next	1.1;
commitid	u87Y5I9heO5OW4yC;

1.1
date	2020.11.08.16.44.47;	author rillig;	state Exp;
branches;
next	;
commitid	ZAirZ17eXgKow6vC;

1.11.2.1
date	2025.08.02.05.58.41;	author perseant;	state Exp;
branches;
next	;
commitid	23j6GFaDws3O875G;


desc
@@


1.21
log
@make: consistently use double quotes in error messages

Previously, some error messages used single quotes, very few used
backticks or parentheses, most already used double quotes.

While here, reword a few error messages to be clearer or more consistent
with related error messages.
@
text
@make: varparse-errors.mk:38: Unknown modifier ":Z"
	while evaluating "${:U:Z}" with value ""
make: varparse-errors.mk:47: Unknown modifier ":Z"
	while evaluating "${:U:Z}post" with value ""
make: varparse-errors.mk:73: Unknown modifier ":OX"
	while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}" with value ""
make: varparse-errors.mk:73: Unknown modifier ":OX"
	while evaluating "${:OX}" with value ""
	while evaluating variable "IND" with value "${:OX}"
make: varparse-errors.mk:73: Unknown modifier ":OX"
	while evaluating "${:U:OX:U${IND}}" with value ""
make: varparse-errors.mk:73: Unknown modifier ":OX"
	while evaluating "${:OX}" with value ""
	while evaluating variable "IND" with value "${:OX}"
make: varparse-errors.mk:81: Unclosed expression, expecting "}" for modifier "Q"
	while evaluating "${:U:Q" with value ""
make: varparse-errors.mk:83: Unclosed expression, expecting "}" for modifier "sh"
	while evaluating "${:U:sh" with value ""
make: varparse-errors.mk:85: Unclosed expression, expecting "}" for modifier "tA"
	while evaluating "${:U:tA" with value ""
make: varparse-errors.mk:87: Unclosed expression, expecting "}" for modifier "tsX"
	while evaluating "${:U:tsX" with value ""
make: varparse-errors.mk:89: Unclosed expression, expecting "}" for modifier "ts"
	while evaluating "${:U:ts" with value ""
make: varparse-errors.mk:91: Unclosed expression, expecting "}" for modifier "ts\040"
	while evaluating "${:U:ts\040" with value ""
make: varparse-errors.mk:93: Unclosed expression, expecting "}" for modifier "u"
	while evaluating "${:U:u" with value ""
make: varparse-errors.mk:95: Unclosed expression, expecting "}" for modifier "H"
	while evaluating "${:U:H" with value "."
make: varparse-errors.mk:97: Unclosed expression, expecting "}" for modifier "[1]"
	while evaluating "${:U:[1]" with value ""
make: varparse-errors.mk:99: Unclosed expression, expecting "}" for modifier "hash"
	while evaluating "${:U:hash" with value "b2af338b"
make: varparse-errors.mk:101: Unclosed expression, expecting "}" for modifier "range"
	while evaluating "${:U:range" with value "1"
make: varparse-errors.mk:103: Unclosed expression, expecting "}" for modifier "_"
	while evaluating "${:U:_" with value ""
make: varparse-errors.mk:105: Unclosed expression, expecting "}" for modifier "gmtime"
	while evaluating "${:U:gmtime" with value "<timestamp>"
make: varparse-errors.mk:107: Unclosed expression, expecting "}" for modifier "localtime"
	while evaluating "${:U:localtime" with value "<timestamp>"
make: varparse-errors.tmp:1: Unknown modifier ":Z"
	while evaluating "${:Z}" with value ""
	while evaluating variable "INDIRECT" with value "${:Z}"
	while evaluating variable "VALUE" with value "${INDIRECT}"
	in varparse-errors.tmp:1
	in varparse-errors.mk:126
make: varparse-errors.tmp:1: 
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1
@


1.20
log
@make: use '"filename" line 123' for locations instead of 'filename:123'

The format 'filename:123' is commonly used for identifying a location in
a file. Text editors recognize it and allow quick navigation through it.
The previous format was specific to make and would have required custom
support in editors.

The new format was already used in stack traces, except for the first
line. Now all lines use the same format.
@
text
@d15 1
a15 1
make: varparse-errors.mk:81: Unclosed expression, expecting '}' for modifier "Q"
d17 1
a17 1
make: varparse-errors.mk:83: Unclosed expression, expecting '}' for modifier "sh"
d19 1
a19 1
make: varparse-errors.mk:85: Unclosed expression, expecting '}' for modifier "tA"
d21 1
a21 1
make: varparse-errors.mk:87: Unclosed expression, expecting '}' for modifier "tsX"
d23 1
a23 1
make: varparse-errors.mk:89: Unclosed expression, expecting '}' for modifier "ts"
d25 1
a25 1
make: varparse-errors.mk:91: Unclosed expression, expecting '}' for modifier "ts\040"
d27 1
a27 1
make: varparse-errors.mk:93: Unclosed expression, expecting '}' for modifier "u"
d29 1
a29 1
make: varparse-errors.mk:95: Unclosed expression, expecting '}' for modifier "H"
d31 1
a31 1
make: varparse-errors.mk:97: Unclosed expression, expecting '}' for modifier "[1]"
d33 1
a33 1
make: varparse-errors.mk:99: Unclosed expression, expecting '}' for modifier "hash"
d35 1
a35 1
make: varparse-errors.mk:101: Unclosed expression, expecting '}' for modifier "range"
d37 1
a37 1
make: varparse-errors.mk:103: Unclosed expression, expecting '}' for modifier "_"
d39 1
a39 1
make: varparse-errors.mk:105: Unclosed expression, expecting '}' for modifier "gmtime"
d41 1
a41 1
make: varparse-errors.mk:107: Unclosed expression, expecting '}' for modifier "localtime"
@


1.19
log
@make: let unknown ":O" modifiers fall back to the ":from=to" modifier

Inspired by https://bugs.freebsd.org/285726, which concerns the ":t"
modifier instead.

This means that future extensions to the ":O" modifier must not contain
a "=" anywhere, otherwise they may break existing code.
@
text
@d1 1
a1 1
make: "varparse-errors.mk" line 38: Unknown modifier ":Z"
d3 1
a3 1
make: "varparse-errors.mk" line 47: Unknown modifier ":Z"
d5 1
a5 1
make: "varparse-errors.mk" line 73: Unknown modifier ":OX"
d7 1
a7 1
make: "varparse-errors.mk" line 73: Unknown modifier ":OX"
d10 1
a10 1
make: "varparse-errors.mk" line 73: Unknown modifier ":OX"
d12 1
a12 1
make: "varparse-errors.mk" line 73: Unknown modifier ":OX"
d15 1
a15 1
make: "varparse-errors.mk" line 81: Unclosed expression, expecting '}' for modifier "Q"
d17 1
a17 1
make: "varparse-errors.mk" line 83: Unclosed expression, expecting '}' for modifier "sh"
d19 1
a19 1
make: "varparse-errors.mk" line 85: Unclosed expression, expecting '}' for modifier "tA"
d21 1
a21 1
make: "varparse-errors.mk" line 87: Unclosed expression, expecting '}' for modifier "tsX"
d23 1
a23 1
make: "varparse-errors.mk" line 89: Unclosed expression, expecting '}' for modifier "ts"
d25 1
a25 1
make: "varparse-errors.mk" line 91: Unclosed expression, expecting '}' for modifier "ts\040"
d27 1
a27 1
make: "varparse-errors.mk" line 93: Unclosed expression, expecting '}' for modifier "u"
d29 1
a29 1
make: "varparse-errors.mk" line 95: Unclosed expression, expecting '}' for modifier "H"
d31 1
a31 1
make: "varparse-errors.mk" line 97: Unclosed expression, expecting '}' for modifier "[1]"
d33 1
a33 1
make: "varparse-errors.mk" line 99: Unclosed expression, expecting '}' for modifier "hash"
d35 1
a35 1
make: "varparse-errors.mk" line 101: Unclosed expression, expecting '}' for modifier "range"
d37 1
a37 1
make: "varparse-errors.mk" line 103: Unclosed expression, expecting '}' for modifier "_"
d39 1
a39 1
make: "varparse-errors.mk" line 105: Unclosed expression, expecting '}' for modifier "gmtime"
d41 1
a41 1
make: "varparse-errors.mk" line 107: Unclosed expression, expecting '}' for modifier "localtime"
d43 1
a43 1
make: "varparse-errors.tmp" line 1: Unknown modifier ":Z"
d49 1
a49 1
make: "varparse-errors.tmp" line 1: 
@


1.18
log
@make: in a stack trace with details and includes, list the current file
@
text
@d5 1
a5 1
make: "varparse-errors.mk" line 73: Bad modifier ":OX"
d7 1
a7 1
make: "varparse-errors.mk" line 73: Bad modifier ":OX"
d10 1
a10 1
make: "varparse-errors.mk" line 73: Bad modifier ":OX"
d12 1
a12 1
make: "varparse-errors.mk" line 73: Bad modifier ":OX"
@


1.17
log
@make: add ":" to error message about unknown modifier

In the manual page, the modifiers are listed with a preceding ":", so
use the same pattern in the error message. This removes an inconsistency
between the error messages "Unknown modifier" and "Bad modifier".
@
text
@d43 7
@


1.16
log
@make: reduce line length in error messages

The error messages for deeply nested parse errors were hard to decipher,
due to the large amount of text.  Split these messages into individual
lines, just as in the backtrace for .include files and .for loops.  This
unified backtrace makes the output more uniform.
@
text
@d1 1
a1 1
make: "varparse-errors.mk" line 38: Unknown modifier "Z"
d3 1
a3 1
make: "varparse-errors.mk" line 47: Unknown modifier "Z"
@


1.15
log
@make: remove wrong error message about an undefined variable
@
text
@d1 42
a42 20
make: "varparse-errors.mk" line 38: while evaluating "${:U:Z}" with value "": Unknown modifier "Z"
make: "varparse-errors.mk" line 47: while evaluating "${:U:Z}post" with value "": Unknown modifier "Z"
make: "varparse-errors.mk" line 73: while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 73: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 73: while evaluating "${:U:OX:U${IND}}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 73: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 81: while evaluating "${:U:Q" with value "": Unclosed expression, expecting '}' for modifier "Q"
make: "varparse-errors.mk" line 83: while evaluating "${:U:sh" with value "": Unclosed expression, expecting '}' for modifier "sh"
make: "varparse-errors.mk" line 85: while evaluating "${:U:tA" with value "": Unclosed expression, expecting '}' for modifier "tA"
make: "varparse-errors.mk" line 87: while evaluating "${:U:tsX" with value "": Unclosed expression, expecting '}' for modifier "tsX"
make: "varparse-errors.mk" line 89: while evaluating "${:U:ts" with value "": Unclosed expression, expecting '}' for modifier "ts"
make: "varparse-errors.mk" line 91: while evaluating "${:U:ts\040" with value "": Unclosed expression, expecting '}' for modifier "ts\040"
make: "varparse-errors.mk" line 93: while evaluating "${:U:u" with value "": Unclosed expression, expecting '}' for modifier "u"
make: "varparse-errors.mk" line 95: while evaluating "${:U:H" with value ".": Unclosed expression, expecting '}' for modifier "H"
make: "varparse-errors.mk" line 97: while evaluating "${:U:[1]" with value "": Unclosed expression, expecting '}' for modifier "[1]"
make: "varparse-errors.mk" line 99: while evaluating "${:U:hash" with value "b2af338b": Unclosed expression, expecting '}' for modifier "hash"
make: "varparse-errors.mk" line 101: while evaluating "${:U:range" with value "1": Unclosed expression, expecting '}' for modifier "range"
make: "varparse-errors.mk" line 103: while evaluating "${:U:_" with value "": Unclosed expression, expecting '}' for modifier "_"
make: "varparse-errors.mk" line 105: while evaluating "${:U:gmtime" with value "<timestamp>": Unclosed expression, expecting '}' for modifier "gmtime"
make: "varparse-errors.mk" line 107: while evaluating "${:U:localtime" with value "<timestamp>": Unclosed expression, expecting '}' for modifier "localtime"
@


1.14
log
@make: in error messages for anonymous variables, log the value
@
text
@d3 18
a20 20
make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 75: Undefined variable "${:U:OX"
make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 75: Undefined variable "${:U:OX"
make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 83: while evaluating "${:U:Q" with value "": Unclosed expression, expecting '}' for modifier "Q"
make: "varparse-errors.mk" line 85: while evaluating "${:U:sh" with value "": Unclosed expression, expecting '}' for modifier "sh"
make: "varparse-errors.mk" line 87: while evaluating "${:U:tA" with value "": Unclosed expression, expecting '}' for modifier "tA"
make: "varparse-errors.mk" line 89: while evaluating "${:U:tsX" with value "": Unclosed expression, expecting '}' for modifier "tsX"
make: "varparse-errors.mk" line 91: while evaluating "${:U:ts" with value "": Unclosed expression, expecting '}' for modifier "ts"
make: "varparse-errors.mk" line 93: while evaluating "${:U:ts\040" with value "": Unclosed expression, expecting '}' for modifier "ts\040"
make: "varparse-errors.mk" line 95: while evaluating "${:U:u" with value "": Unclosed expression, expecting '}' for modifier "u"
make: "varparse-errors.mk" line 97: while evaluating "${:U:H" with value ".": Unclosed expression, expecting '}' for modifier "H"
make: "varparse-errors.mk" line 99: while evaluating "${:U:[1]" with value "": Unclosed expression, expecting '}' for modifier "[1]"
make: "varparse-errors.mk" line 101: while evaluating "${:U:hash" with value "b2af338b": Unclosed expression, expecting '}' for modifier "hash"
make: "varparse-errors.mk" line 103: while evaluating "${:U:range" with value "1": Unclosed expression, expecting '}' for modifier "range"
make: "varparse-errors.mk" line 105: while evaluating "${:U:_" with value "": Unclosed expression, expecting '}' for modifier "_"
make: "varparse-errors.mk" line 107: while evaluating "${:U:gmtime" with value "<timestamp>": Unclosed expression, expecting '}' for modifier "gmtime"
make: "varparse-errors.mk" line 109: while evaluating "${:U:localtime" with value "<timestamp>": Unclosed expression, expecting '}' for modifier "localtime"
@


1.13
log
@make: error out on unclosed expressions during parse time

In exchange, this adds location information.

For unnamed expressions, the value is no longer printed.  This will be
added back in a follow-up commit.
@
text
@d1 3
a3 3
make: "varparse-errors.mk" line 38: while evaluating "${:U:Z}": Unknown modifier "Z"
make: "varparse-errors.mk" line 47: while evaluating "${:U:Z}post": Unknown modifier "Z"
make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}": Bad modifier ":OX"
d5 2
a6 2
make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}": Bad modifier ":OX"
make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}}": Bad modifier ":OX"
d8 15
a22 15
make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}": Bad modifier ":OX"
make: "varparse-errors.mk" line 83: while evaluating "${:U:Q": Unclosed expression, expecting '}' for modifier "Q"
make: "varparse-errors.mk" line 85: while evaluating "${:U:sh": Unclosed expression, expecting '}' for modifier "sh"
make: "varparse-errors.mk" line 87: while evaluating "${:U:tA": Unclosed expression, expecting '}' for modifier "tA"
make: "varparse-errors.mk" line 89: while evaluating "${:U:tsX": Unclosed expression, expecting '}' for modifier "tsX"
make: "varparse-errors.mk" line 91: while evaluating "${:U:ts": Unclosed expression, expecting '}' for modifier "ts"
make: "varparse-errors.mk" line 93: while evaluating "${:U:ts\040": Unclosed expression, expecting '}' for modifier "ts\040"
make: "varparse-errors.mk" line 95: while evaluating "${:U:u": Unclosed expression, expecting '}' for modifier "u"
make: "varparse-errors.mk" line 97: while evaluating "${:U:H": Unclosed expression, expecting '}' for modifier "H"
make: "varparse-errors.mk" line 99: while evaluating "${:U:[1]": Unclosed expression, expecting '}' for modifier "[1]"
make: "varparse-errors.mk" line 101: while evaluating "${:U:hash": Unclosed expression, expecting '}' for modifier "hash"
make: "varparse-errors.mk" line 103: while evaluating "${:U:range": Unclosed expression, expecting '}' for modifier "range"
make: "varparse-errors.mk" line 105: while evaluating "${:U:_": Unclosed expression, expecting '}' for modifier "_"
make: "varparse-errors.mk" line 107: while evaluating "${:U:gmtime": Unclosed expression, expecting '}' for modifier "gmtime"
make: "varparse-errors.mk" line 109: while evaluating "${:U:localtime": Unclosed expression, expecting '}' for modifier "localtime"
@


1.12
log
@make: error out on the "Bad modifier" error message

Previously, the "Bad modifier" error message did not affect make's exit
status.  As a side effect, this kind of error now gets more context
information.
@
text
@d9 14
a22 14
make: Unclosed expression, expecting '}' for modifier "Q" of variable "" with value ""
make: Unclosed expression, expecting '}' for modifier "sh" of variable "" with value ""
make: Unclosed expression, expecting '}' for modifier "tA" of variable "" with value ""
make: Unclosed expression, expecting '}' for modifier "tsX" of variable "" with value ""
make: Unclosed expression, expecting '}' for modifier "ts" of variable "" with value ""
make: Unclosed expression, expecting '}' for modifier "ts\040" of variable "" with value ""
make: Unclosed expression, expecting '}' for modifier "u" of variable "" with value ""
make: Unclosed expression, expecting '}' for modifier "H" of variable "" with value "."
make: Unclosed expression, expecting '}' for modifier "[1]" of variable "" with value ""
make: Unclosed expression, expecting '}' for modifier "hash" of variable "" with value "b2af338b"
make: Unclosed expression, expecting '}' for modifier "range" of variable "" with value "1"
make: Unclosed expression, expecting '}' for modifier "_" of variable "" with value ""
make: Unclosed expression, expecting '}' for modifier "gmtime" of variable "" with value "<timestamp>"
make: Unclosed expression, expecting '}' for modifier "localtime" of variable "" with value "<timestamp>"
@


1.11
log
@make: provide more context information for parse/evaluate errors
@
text
@d3 6
a8 6
make: Bad modifier ":OX" for variable ""
make: "varparse-errors.mk" line 71: Undefined variable "${:U:OX"
make: Bad modifier ":OX" for variable ""
make: Bad modifier ":OX" for variable ""
make: "varparse-errors.mk" line 71: Undefined variable "${:U:OX"
make: Bad modifier ":OX" for variable ""
@


1.11.2.1
log
@Sync with HEAD
@
text
@d1 22
a22 49
make: varparse-errors.mk:38: Unknown modifier ":Z"
	while evaluating "${:U:Z}" with value ""
make: varparse-errors.mk:47: Unknown modifier ":Z"
	while evaluating "${:U:Z}post" with value ""
make: varparse-errors.mk:73: Unknown modifier ":OX"
	while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}" with value ""
make: varparse-errors.mk:73: Unknown modifier ":OX"
	while evaluating "${:OX}" with value ""
	while evaluating variable "IND" with value "${:OX}"
make: varparse-errors.mk:73: Unknown modifier ":OX"
	while evaluating "${:U:OX:U${IND}}" with value ""
make: varparse-errors.mk:73: Unknown modifier ":OX"
	while evaluating "${:OX}" with value ""
	while evaluating variable "IND" with value "${:OX}"
make: varparse-errors.mk:81: Unclosed expression, expecting "}" for modifier "Q"
	while evaluating "${:U:Q" with value ""
make: varparse-errors.mk:83: Unclosed expression, expecting "}" for modifier "sh"
	while evaluating "${:U:sh" with value ""
make: varparse-errors.mk:85: Unclosed expression, expecting "}" for modifier "tA"
	while evaluating "${:U:tA" with value ""
make: varparse-errors.mk:87: Unclosed expression, expecting "}" for modifier "tsX"
	while evaluating "${:U:tsX" with value ""
make: varparse-errors.mk:89: Unclosed expression, expecting "}" for modifier "ts"
	while evaluating "${:U:ts" with value ""
make: varparse-errors.mk:91: Unclosed expression, expecting "}" for modifier "ts\040"
	while evaluating "${:U:ts\040" with value ""
make: varparse-errors.mk:93: Unclosed expression, expecting "}" for modifier "u"
	while evaluating "${:U:u" with value ""
make: varparse-errors.mk:95: Unclosed expression, expecting "}" for modifier "H"
	while evaluating "${:U:H" with value "."
make: varparse-errors.mk:97: Unclosed expression, expecting "}" for modifier "[1]"
	while evaluating "${:U:[1]" with value ""
make: varparse-errors.mk:99: Unclosed expression, expecting "}" for modifier "hash"
	while evaluating "${:U:hash" with value "b2af338b"
make: varparse-errors.mk:101: Unclosed expression, expecting "}" for modifier "range"
	while evaluating "${:U:range" with value "1"
make: varparse-errors.mk:103: Unclosed expression, expecting "}" for modifier "_"
	while evaluating "${:U:_" with value ""
make: varparse-errors.mk:105: Unclosed expression, expecting "}" for modifier "gmtime"
	while evaluating "${:U:gmtime" with value "<timestamp>"
make: varparse-errors.mk:107: Unclosed expression, expecting "}" for modifier "localtime"
	while evaluating "${:U:localtime" with value "<timestamp>"
make: varparse-errors.tmp:1: Unknown modifier ":Z"
	while evaluating "${:Z}" with value ""
	while evaluating variable "INDIRECT" with value "${:Z}"
	while evaluating variable "VALUE" with value "${INDIRECT}"
	in varparse-errors.tmp:1
	in varparse-errors.mk:126
make: varparse-errors.tmp:1: 
@


1.10
log
@make: replace 'variable expression' with 'expression' in diagnostics
@
text
@d1 2
a2 2
make: "varparse-errors.mk" line 38: Unknown modifier "Z"
make: "varparse-errors.mk" line 47: Unknown modifier "Z"
@


1.9
log
@tests/make: force line-based diagnostics to be listed in the tests

This way, contradictions between the intended output and the actual
output are closer together and have a better chance of being spotted.
@
text
@d9 14
a22 14
make: Unclosed variable expression, expecting '}' for modifier "Q" of variable "" with value ""
make: Unclosed variable expression, expecting '}' for modifier "sh" of variable "" with value ""
make: Unclosed variable expression, expecting '}' for modifier "tA" of variable "" with value ""
make: Unclosed variable expression, expecting '}' for modifier "tsX" of variable "" with value ""
make: Unclosed variable expression, expecting '}' for modifier "ts" of variable "" with value ""
make: Unclosed variable expression, expecting '}' for modifier "ts\040" of variable "" with value ""
make: Unclosed variable expression, expecting '}' for modifier "u" of variable "" with value ""
make: Unclosed variable expression, expecting '}' for modifier "H" of variable "" with value "."
make: Unclosed variable expression, expecting '}' for modifier "[1]" of variable "" with value ""
make: Unclosed variable expression, expecting '}' for modifier "hash" of variable "" with value "b2af338b"
make: Unclosed variable expression, expecting '}' for modifier "range" of variable "" with value "1"
make: Unclosed variable expression, expecting '}' for modifier "_" of variable "" with value ""
make: Unclosed variable expression, expecting '}' for modifier "gmtime" of variable "" with value "<timestamp>"
make: Unclosed variable expression, expecting '}' for modifier "localtime" of variable "" with value "<timestamp>"
@


1.8
log
@make: remove redundant type VarParseResult

No functional change.
@
text
@d1 2
a2 2
make: "varparse-errors.mk" line 37: Unknown modifier "Z"
make: "varparse-errors.mk" line 45: Unknown modifier "Z"
d4 1
a4 1
make: "varparse-errors.mk" line 67: Undefined variable "${:U:OX"
d7 1
a7 1
make: "varparse-errors.mk" line 67: Undefined variable "${:U:OX"
@


1.7
log
@make: prevent future out-of-bounds errors when parsing expressions

A modifier in an expression ends not only at the next ':' or at the
closing '}' or ')', but also at the end of the string.

Previously, testing for the end of the string had been done separately,
which was error-prone since 2006-05-11, when indirect modifiers were
introduced.  Since then, it was possible that the string terminator '\0'
was accidentally skipped in cases where the loop condition only tested
for the ending character.  When parsing indirect modifiers, the ending
character is indeed '\0', but when parsing direct modifiers, it is '}'
or ')'.

A welcome side effect is that in the case of unclosed expressions such
as '${VAR:Modifier', the amount of error messages is reduced from 2 or 3
to only 1.  The removed error messages were wrong and thus confusing
anyway.
@
text
@d1 2
a2 2
make: "varparse-errors.mk" line 38: Unknown modifier "Z"
make: "varparse-errors.mk" line 46: Unknown modifier "Z"
d4 1
a4 1
make: "varparse-errors.mk" line 68: Undefined variable "${:U:OX"
d7 1
a7 1
make: "varparse-errors.mk" line 68: Undefined variable "${:U:OX"
@


1.6
log
@tests/make: test misleading error messages on unclosed expressions

The error messages say 'Unknown modifier' or 'Bad modifier', which is
not entirely correct.  The modifier in itself is valid, it's just that
make doesn't expect the end of the string after the modifier.
@
text
@a8 1
make: "varparse-errors.mk" line 72: Unknown modifier "Q"
a9 2
make: "varparse-errors.mk" line 72: Undefined variable "${:U:Q"
make: "varparse-errors.mk" line 74: Unknown modifier "sh"
d11 4
a14 10
make: "varparse-errors.mk" line 74: Undefined variable "${:U:sh"
make: Bad modifier ":tA" for variable ""
make: "varparse-errors.mk" line 76: Undefined variable "${:U:tA"
make: Bad modifier ":tsX" for variable ""
make: "varparse-errors.mk" line 78: Undefined variable "${:U:ts"
make: Bad modifier ":ts" for variable ""
make: "varparse-errors.mk" line 80: Undefined variable "${:U:ts"
make: Bad modifier ":ts\040" for variable ""
make: "varparse-errors.mk" line 82: Undefined variable "${:U:ts"
make: "varparse-errors.mk" line 84: Unknown modifier "u"
d16 4
a19 13
make: "varparse-errors.mk" line 84: Undefined variable "${:U:u"
make: "varparse-errors.mk" line 86: Unknown modifier "H"
make: Unclosed variable expression, expecting '}' for modifier "H" of variable "" with value ""
make: "varparse-errors.mk" line 86: Undefined variable "${:U:H"
make: Bad modifier ":[1]" for variable ""
make: "varparse-errors.mk" line 88: Undefined variable "${:U:[1]"
make: "varparse-errors.mk" line 90: Unknown modifier "hash"
make: Unclosed variable expression, expecting '}' for modifier "hash" of variable "" with value ""
make: "varparse-errors.mk" line 90: Undefined variable "${:U:hash"
make: "varparse-errors.mk" line 92: Unknown modifier "range"
make: Unclosed variable expression, expecting '}' for modifier "range" of variable "" with value ""
make: "varparse-errors.mk" line 92: Undefined variable "${:U:range"
make: "varparse-errors.mk" line 94: Unknown modifier "_"
d21 2
a22 7
make: "varparse-errors.mk" line 94: Undefined variable "${:U:_"
make: "varparse-errors.mk" line 96: Unknown modifier "gmtime"
make: Unclosed variable expression, expecting '}' for modifier "gmtime" of variable "" with value ""
make: "varparse-errors.mk" line 96: Undefined variable "${:U:gmtime"
make: "varparse-errors.mk" line 98: Unknown modifier "localtime"
make: Unclosed variable expression, expecting '}' for modifier "localtime" of variable "" with value ""
make: "varparse-errors.mk" line 98: Undefined variable "${:U:localtime"
@


1.5
log
@tests/make: demonstrate that the 'static' in Var_Parse has an effect
@
text
@d9 37
@


1.4
log
@make: improve error message for unknown modifier

Back in 1995, the modifiers were all single-character, and it made sense
to print only the first character.  Nowadays, with ':S', ':@@var@@...@@',
'::=' and several others, a little more context is useful to see where
the exact error is.  The actual modifier is still guessed, and the guess
may be wrong as soon as backslashes get involved, but it is still better
than before.
@
text
@d3 6
@


1.3
log
@make(1): error out on unknown variable modifiers at parse time

Before, make printed an "error message" that did not include the word
error and thus was not easily identified as such.  This "error message"
also did not influence the exit status in the default mode but only in
-dL mode.  The error message also didn't include any line number
information and was thus rude.
@
text
@d1 2
a2 2
make: "varparse-errors.mk" line 38: Unknown modifier 'Z'
make: "varparse-errors.mk" line 46: Unknown modifier 'Z'
@


1.2
log
@make(1): add test for parse errors in variable name in Var_SetWithFlags
@
text
@d1 5
a5 3
make: Unknown modifier 'Z'
make: Unknown modifier 'Z'
exit status 0
@


1.1
log
@make(1): add test for expanding variable expressions
@
text
@d1 2
@

