head	1.14;
access;
symbols
	netbsd-11-0-RC4:1.14
	netbsd-11-0-RC3:1.14
	netbsd-11-0-RC2:1.14
	netbsd-11-0-RC1:1.14
	perseant-exfatfs-base-20250801:1.14
	netbsd-11:1.14.0.2
	netbsd-11-base:1.14
	netbsd-10-1-RELEASE:1.2
	perseant-exfatfs-base-20240630:1.6
	perseant-exfatfs:1.6.0.2
	perseant-exfatfs-base:1.6
	netbsd-10-0-RELEASE:1.2
	netbsd-10-0-RC6:1.2
	netbsd-10-0-RC5:1.2
	netbsd-10-0-RC4:1.2
	netbsd-10-0-RC3:1.2
	netbsd-10-0-RC2:1.2
	netbsd-10-0-RC1:1.2
	netbsd-10:1.2.0.6
	netbsd-10-base:1.2
	cjep_sun2x-base1:1.2
	cjep_sun2x:1.2.0.4
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	cjep_staticlib_x:1.2.0.2
	cjep_staticlib_x-base:1.2;
locks; strict;
comment	@# @;


1.14
date	2025.06.28.22.39.28;	author rillig;	state Exp;
branches;
next	1.13;
commitid	CDDpACH2g2jV3I0G;

1.13
date	2025.05.03.08.18.33;	author rillig;	state Exp;
branches;
next	1.12;
commitid	QzWXxdJKvwP26rTF;

1.12
date	2025.03.30.16.43.10;	author rillig;	state Exp;
branches;
next	1.11;
commitid	SOGs5FvaVLCgZ6PF;

1.11
date	2025.03.30.09.51.50;	author rillig;	state Exp;
branches;
next	1.10;
commitid	veGmSzVhPiW2G4PF;

1.10
date	2025.03.29.19.08.52;	author rillig;	state Exp;
branches;
next	1.9;
commitid	y95n9TsA04p0PZOF;

1.9
date	2024.08.29.20.20.36;	author rillig;	state Exp;
branches;
next	1.8;
commitid	EaMgk7FrF8mB1LnF;

1.8
date	2024.07.06.10.14.35;	author rillig;	state Exp;
branches;
next	1.7;
commitid	ZQzzyoOODC5wpLgF;

1.7
date	2024.07.05.19.47.22;	author rillig;	state Exp;
branches;
next	1.6;
commitid	ey8c5i7vJGMuCGgF;

1.6
date	2024.04.20.10.18.55;	author rillig;	state Exp;
branches
	1.6.2.1;
next	1.5;
commitid	2fCjOO5HMlf2VR6F;

1.5
date	2023.06.01.20.56.35;	author rillig;	state Exp;
branches;
next	1.4;
commitid	j3tIvMRlxolKQhrE;

1.4
date	2023.05.09.19.43.12;	author rillig;	state Exp;
branches;
next	1.3;
commitid	0MGmFQ2Y6SPrbkoE;

1.3
date	2023.05.08.10.24.07;	author rillig;	state Exp;
branches;
next	1.2;
commitid	l5kzn0g8BA8b89oE;

1.2
date	2021.02.23.15.19.41;	author rillig;	state Exp;
branches;
next	1.1;
commitid	wGJlKlrQTIQeBQIC;

1.1
date	2020.12.31.03.05.12;	author rillig;	state Exp;
branches;
next	;
commitid	dIpEfPNmZz0HhQBC;

1.6.2.1
date	2025.08.02.05.58.33;	author perseant;	state Exp;
branches;
next	;
commitid	23j6GFaDws3O875G;


desc
@@


1.14
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: directive-for-errors.mk:9: Unknown directive "fori"
make: directive-for-errors.mk:11: warning: <>
make: directive-for-errors.mk:13: for-less endfor
make: directive-for-errors.mk:25: Unknown directive "for"
make: directive-for-errors.mk:27: warning: <>
make: directive-for-errors.mk:29: for-less endfor
make: directive-for-errors.mk:44: Invalid character "$" in .for loop variable name
make: directive-for-errors.mk:52: Missing iteration variables in .for loop
make: directive-for-errors.mk:64: Wrong number of words (5) in .for substitution list with 3 variables
make: directive-for-errors.mk:78: Missing "in" in .for loop
make: directive-for-errors.mk:85: Unknown modifier ":Z"
	while evaluating "${:U3:Z} 4" with value "3"
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1
@


1.13
log
@make: miscellaneous cleanups
@
text
@d7 2
a8 2
make: directive-for-errors.mk:44: invalid character '$' in .for loop variable name
make: directive-for-errors.mk:52: no iteration variables in for
d10 1
a10 1
make: directive-for-errors.mk:78: missing `in' in for
@


1.12
log
@make: if there is an error in the items of a .for loop, don't iterate
@
text
@d11 1
a11 1
make: directive-for-errors.mk:86: Unknown modifier ":Z"
@


1.11
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
@d11 1
a11 1
make: directive-for-errors.mk:89: Unknown modifier ":Z"
a12 3
make: directive-for-errors.mk:93: warning: Should not be reached.
make: directive-for-errors.mk:93: warning: Should not be reached.
make: directive-for-errors.mk:93: warning: Should not be reached.
@


1.10
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
@d1 11
a11 11
make: "directive-for-errors.mk" line 9: Unknown directive "fori"
make: "directive-for-errors.mk" line 11: warning: <>
make: "directive-for-errors.mk" line 13: for-less endfor
make: "directive-for-errors.mk" line 25: Unknown directive "for"
make: "directive-for-errors.mk" line 27: warning: <>
make: "directive-for-errors.mk" line 29: for-less endfor
make: "directive-for-errors.mk" line 44: invalid character '$' in .for loop variable name
make: "directive-for-errors.mk" line 52: no iteration variables in for
make: "directive-for-errors.mk" line 64: Wrong number of words (5) in .for substitution list with 3 variables
make: "directive-for-errors.mk" line 78: missing `in' in for
make: "directive-for-errors.mk" line 89: Unknown modifier ":Z"
d13 3
a15 3
make: "directive-for-errors.mk" line 93: warning: Should not be reached.
make: "directive-for-errors.mk" line 93: warning: Should not be reached.
make: "directive-for-errors.mk" line 93: warning: Should not be reached.
@


1.9
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
@d11 1
a11 1
make: "directive-for-errors.mk" line 89: Unknown modifier "Z"
@


1.8
log
@tests/make: clean up tests

Prefer "expect+X" directives to be above the code generating them,
instead of "expect-X" directives below the code.

In varmod-edge.mk, separate the tests, as the common loop does not pull
its weight.
@
text
@d11 2
a12 1
make: "directive-for-errors.mk" line 89: while evaluating "${:U3:Z} 4" with value "3": Unknown modifier "Z"
@


1.7
log
@make: in error messages for anonymous variables, log the value
@
text
@d2 2
a3 2
make: "directive-for-errors.mk" line 10: warning: <>
make: "directive-for-errors.mk" line 11: for-less endfor
d5 2
a6 2
make: "directive-for-errors.mk" line 26: warning: <>
make: "directive-for-errors.mk" line 27: for-less endfor
d12 3
a14 3
make: "directive-for-errors.mk" line 90: warning: Should not be reached.
make: "directive-for-errors.mk" line 90: warning: Should not be reached.
make: "directive-for-errors.mk" line 90: warning: Should not be reached.
@


1.6
log
@make: provide more context information for parse/evaluate errors
@
text
@d11 1
a11 1
make: "directive-for-errors.mk" line 89: while evaluating "${:U3:Z} 4": Unknown modifier "Z"
@


1.6.2.1
log
@Sync with HEAD
@
text
@d1 14
a14 12
make: directive-for-errors.mk:9: Unknown directive "fori"
make: directive-for-errors.mk:11: warning: <>
make: directive-for-errors.mk:13: for-less endfor
make: directive-for-errors.mk:25: Unknown directive "for"
make: directive-for-errors.mk:27: warning: <>
make: directive-for-errors.mk:29: for-less endfor
make: directive-for-errors.mk:44: Invalid character "$" in .for loop variable name
make: directive-for-errors.mk:52: Missing iteration variables in .for loop
make: directive-for-errors.mk:64: Wrong number of words (5) in .for substitution list with 3 variables
make: directive-for-errors.mk:78: Missing "in" in .for loop
make: directive-for-errors.mk:85: Unknown modifier ":Z"
	while evaluating "${:U3:Z} 4" with value "3"
@


1.5
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
@d11 1
a11 1
make: "directive-for-errors.mk" line 89: Unknown modifier "Z"
@


1.4
log
@make: skip syntactically wrong .for loops

When a .for loop cannot be interpreted correctly, for example when there
are no iteration variables or the number of words doesn't match the
iteration variables, skip the body of the .for loop instead of
interpreting it once.
@
text
@d1 14
a14 14
make: "directive-for-errors.mk" line 11: Unknown directive "fori"
make: "directive-for-errors.mk" line 12: warning: <>
make: "directive-for-errors.mk" line 13: for-less endfor
make: "directive-for-errors.mk" line 27: Unknown directive "for"
make: "directive-for-errors.mk" line 28: warning: <>
make: "directive-for-errors.mk" line 29: for-less endfor
make: "directive-for-errors.mk" line 46: invalid character '$' in .for loop variable name
make: "directive-for-errors.mk" line 54: no iteration variables in for
make: "directive-for-errors.mk" line 66: Wrong number of words (5) in .for substitution list with 3 variables
make: "directive-for-errors.mk" line 80: missing `in' in for
make: "directive-for-errors.mk" line 91: Unknown modifier "Z"
make: "directive-for-errors.mk" line 92: warning: Should not be reached.
make: "directive-for-errors.mk" line 92: warning: Should not be reached.
make: "directive-for-errors.mk" line 92: warning: Should not be reached.
@


1.3
log
@make: disallow characters like '$' in variable names in .for loops

Fixes PR 53146.
@
text
@d1 14
a14 20
make: "directive-for-errors.mk" line 7: Unknown directive "fori"
make: "directive-for-errors.mk" line 8: warning: 
make: "directive-for-errors.mk" line 9: for-less endfor
make: "directive-for-errors.mk" line 19: Unknown directive "for"
make: "directive-for-errors.mk" line 20: warning: 
make: "directive-for-errors.mk" line 21: for-less endfor
make: "directive-for-errors.mk" line 34: invalid character '$' in .for loop variable name
make: "directive-for-errors.mk" line 35: Dollar $   and backslash backslash backslash backslash.
make: "directive-for-errors.mk" line 36: for-less endfor
make: "directive-for-errors.mk" line 41: no iteration variables in for
make: "directive-for-errors.mk" line 45: warning: Should not be reached.
make: "directive-for-errors.mk" line 46: for-less endfor
make: "directive-for-errors.mk" line 51: Wrong number of words (5) in .for substitution list with 3 variables
make: "directive-for-errors.mk" line 63: missing `in' in for
make: "directive-for-errors.mk" line 65: warning: Should not be reached.
make: "directive-for-errors.mk" line 66: for-less endfor
make: "directive-for-errors.mk" line 72: Unknown modifier "Z"
make: "directive-for-errors.mk" line 73: warning: Should not be reached.
make: "directive-for-errors.mk" line 73: warning: Should not be reached.
make: "directive-for-errors.mk" line 73: warning: Should not be reached.
@


1.2
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
@d7 14
a20 13
make: "directive-for-errors.mk" line 37: Dollar $ 1 1 and backslash 2 2 2.
make: "directive-for-errors.mk" line 37: Dollar $ 3 3 and backslash 4 4 4.
make: "directive-for-errors.mk" line 43: no iteration variables in for
make: "directive-for-errors.mk" line 47: warning: Should not be reached.
make: "directive-for-errors.mk" line 48: for-less endfor
make: "directive-for-errors.mk" line 53: Wrong number of words (5) in .for substitution list with 3 variables
make: "directive-for-errors.mk" line 64: missing `in' in for
make: "directive-for-errors.mk" line 66: warning: Should not be reached.
make: "directive-for-errors.mk" line 67: for-less endfor
make: "directive-for-errors.mk" line 73: Unknown modifier "Z"
make: "directive-for-errors.mk" line 74: warning: Should not be reached.
make: "directive-for-errors.mk" line 74: warning: Should not be reached.
make: "directive-for-errors.mk" line 74: warning: Should not be reached.
@


1.1
log
@make(1): add test for error handling and expansion in .for loops
@
text
@d16 1
a16 1
make: "directive-for-errors.mk" line 73: Unknown modifier 'Z'
@

