head 1.13; access; symbols netbsd-11-0-RC4:1.11 netbsd-11-0-RC3:1.11 netbsd-11-0-RC2:1.11 netbsd-11-0-RC1:1.11 perseant-exfatfs-base-20250801:1.11 netbsd-11:1.11.0.2 netbsd-11-base:1.11 netbsd-10-1-RELEASE:1.4 perseant-exfatfs-base-20240630:1.5 perseant-exfatfs:1.5.0.2 perseant-exfatfs-base:1.5 netbsd-10-0-RELEASE:1.4 netbsd-10-0-RC6:1.4 netbsd-10-0-RC5:1.4 netbsd-10-0-RC4:1.4 netbsd-10-0-RC3:1.4 netbsd-10-0-RC2:1.4 netbsd-10-0-RC1:1.4 netbsd-10:1.4.0.6 netbsd-10-base:1.4 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.13 date 2026.02.01.16.42.35; author rillig; state Exp; branches; next 1.12; commitid QDTzAMUxdyOj5HsG; 1.12 date 2026.01.03.20.48.35; author rillig; state Exp; branches; next 1.11; commitid 8ZNiuMRrkiQvnZoG; 1.11 date 2025.03.29.19.08.53; author rillig; state Exp; branches; next 1.10; commitid y95n9TsA04p0PZOF; 1.10 date 2025.03.29.10.39.49; author rillig; state Exp; branches; next 1.9; commitid 22Yp9aLGm4mSZWOF; 1.9 date 2024.08.29.20.20.37; author rillig; state Exp; branches; next 1.8; commitid EaMgk7FrF8mB1LnF; 1.8 date 2024.07.20.11.05.12; author rillig; state Exp; branches; next 1.7; commitid Bey1UaNE0WVGeziF; 1.7 date 2024.07.09.19.43.01; author rillig; state Exp; branches; next 1.6; commitid qrdgBafp1onZqchF; 1.6 date 2024.07.05.19.47.22; author rillig; state Exp; branches; next 1.5; commitid ey8c5i7vJGMuCGgF; 1.5 date 2024.04.20.10.18.55; author rillig; state Exp; branches 1.5.2.1; next 1.4; commitid 2fCjOO5HMlf2VR6F; 1.4 date 2021.02.23.15.19.41; author rillig; state Exp; branches; next 1.3; commitid wGJlKlrQTIQeBQIC; 1.3 date 2020.11.03.18.18.31; author rillig; state Exp; branches; next 1.2; commitid egrx1NocNiNmctuC; 1.2 date 2020.08.16.12.30.45; author rillig; state Exp; branches; next 1.1; commitid UOehUssBtowJOhkC; 1.1 date 2020.08.16.12.07.51; author rillig; state Exp; branches; next ; commitid coEgPk3hgfeYGhkC; 1.5.2.1 date 2025.08.02.05.58.39; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.13 log @make: in stack traces, add location information for targets @ text @mod-subst: :a b b c: :a b b c: : b c: :a c: :x__ 3 x__ 3: 12345 mod-subst-delimiter: 1 two 3 horizontal tabulator 1 two 3 space 1 two 3 exclamation mark 1 two 3 quotation mark 1 two 3 number sign 1 two 3 dollar sign 1 two 3 percent sign 1 two 3 ampersand 1 two 3 apostrophe 1 two 3 left parenthesis 1 two 3 right parenthesis 1 two 3 asterisk 1 two 3 plus sign 1 two 3 comma 1 two 3 hyphen-minus 1 two 3 full stop 1 two 3 solidus 1 two 3 digit 1 two 3 colon 1 two 3 semicolon 1 two 3 less-than sign 1 two 3 equals sign 1 two 3 greater-than sign 1 two 3 question mark 1 two 3 commercial at 1 two 3 capital letter 1 two 3 left square bracket 1 two 3 reverse solidus 1 two 3 right square bracket 1 two 3 circumflex accent 1 two 3 low line 1 two 3 grave accent 1 two 3 small letter 1 two 3 left curly bracket 1 two 3 vertical line 1 two 3 right curly bracket 1 two 3 tilde 123 two34 345 circumflex accent make: Regex compilation error: (details omitted) while evaluating "${:U 123 234 345 :C^^2^two^:Q} circumflex accent" with value " 123 234 345 " in command "@@echo ${:U 123 234 345 :C^^2^two^:Q} circumflex accent" in target "mod-subst-delimiter-circumflex" from varmod-subst.mk:250 mod-subst-chain: A B c. make: Unknown modifier ":i" while evaluating "${:Uvalue:S,a,x,i}." with value "vxlue" in command "@@echo ${:Uvalue:S,a,x,i}." in target "mod-subst-chain" from varmod-subst.mk:268 mod-subst-dollar:$1: mod-subst-dollar:$2: mod-subst-dollar:$3: mod-subst-dollar:$4: mod-subst-dollar:$5: mod-subst-dollar:$6: mod-subst-dollar:$7: mod-subst-dollar:$8: mod-subst-dollar:$40: mod-subst-dollar:U8: mod-subst-dollar:$$$$: mod-subst-dollar:$$$good3 exit status 2 @ 1.12 log @make: test the ":S" modifier with "^" as delimiter @ text @d50 1 a50 1 in target "mod-subst-delimiter-circumflex" d56 1 a56 1 in target "mod-subst-chain" @ 1.11 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 @d46 5 @ 1.10 log @make: in stack traces from target commands, add the command level A target can contain several commands, and these commands are likely to contain the same expressions. To distinguish them, add one more line to the stack trace, to narrow down the source of the error. @ text @d48 1 a48 1 make: Unknown modifier "i" @ 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 @d50 1 @ 1.8 log @make: don't run erroneous commands in compat mode When there is a parse or evaluation error in an expression that becomes part of the command, don't run that command, as the result of the failed evaluation typically contains garbage characters. Skip the remaining commands from that target as well, as they may depend on the erroneous command. @ text @d48 3 a50 1 make: in target "mod-subst-chain": while evaluating "${:Uvalue:S,a,x,i}." with value "vxlue": Unknown modifier "i" @ 1.7 log @make: error out on parse/evaluation errors in shell commands The expression ${VAR:X} has an unknown modifier ':X'. Previously, this expression errored out when the expression was evaluated at parse time, but not when the expression was evaluated when generating the commands to bring a target up to date. The errors were previously reported, they didn't affect the exit status, though. Now, errors in expressions are handled in the same way, regardless of the time at which they are evaluated. @ text @a48 1 . @ 1.6 log @make: in error messages for anonymous variables, log the value @ text @d62 1 a62 1 exit status 0 @ 1.5 log @make: provide more context information for parse/evaluate errors @ text @d48 1 a48 1 make: in target "mod-subst-chain": while evaluating "${:Uvalue:S,a,x,i}.": Unknown modifier "i" @ 1.5.2.1 log @Sync with HEAD @ text @d48 2 a49 4 make: Unknown modifier ":i" while evaluating "${:Uvalue:S,a,x,i}." with value "vxlue" in command "@@echo ${:Uvalue:S,a,x,i}." in target "mod-subst-chain" d62 1 a62 1 exit status 2 @ 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 @d48 1 a48 1 make: Unknown modifier "i" @ 1.3 log @make(1): add all printable ASCII characters to the varmod-subst test I must have missed some of them when I originally wrote the test. Not sure how that happened. While here, use the official Unicode names. @ text @d48 1 a48 1 make: Unknown modifier 'i' @ 1.2 log @make(1): move tests for :S, :C, :@@ from modmisc to their separate tests @ text @d12 5 a16 4 1 two 3 double quotes 1 two 3 hash 1 two 3 dollar 1 two 3 percent d18 8 a25 2 1 two 3 opening parenthesis 1 two 3 closing parenthesis d28 4 a31 3 1 two 3 less than sign 1 two 3 equal sign 1 two 3 greater than sign d33 10 a42 7 1 two 3 at 1 two 3 letter 1 two 3 opening bracket 1 two 3 backslash 1 two 3 closing bracket 1 two 3 caret 1 two 3 opening brace d44 1 a44 1 1 two 3 closing brace @ 1.1 log @make(1): add dummies for fine-grained tests, one per single feature The test names have been derived from the current manual page. All these tests are dummies right now, and the code from the existing tests will be moved into the new tests step by step. This is done to prevent modmisc, escape, varmod-edge and varmisc from growing without any bounds, and to reduce the side-effects of one test to the others. @ text @d1 50 @