Module Name:    src
Committed By:   rillig
Date:           Sat Apr 20 10:18:56 UTC 2024

Modified Files:
        src/usr.bin/make: compat.c job.c make.h parse.c var.c
        src/usr.bin/make/unit-tests: Makefile cmd-errors-jobs.exp
            cmd-errors-jobs.mk cmd-errors-lint.exp cmd-errors.exp
            cond-token-string.exp cond-token-string.mk deptgt.exp deptgt.mk
            directive-for-errors.exp directive-for-errors.mk directive-for.exp
            directive-for.mk directive-include.exp directive-include.mk
            directive-undef.exp directive-undef.mk lint.exp moderrs.exp
            opt-debug-lint.exp opt-debug-lint.mk var-eval-short.exp
            var-eval-short.mk var-op-expand.exp var-op-expand.mk vardebug.exp
            vardebug.mk varmisc.exp varmod-assign.exp varmod-assign.mk
            varmod-edge.exp varmod-edge.mk varmod-gmtime.exp varmod-gmtime.mk
            varmod-hash.exp varmod-ifelse.exp varmod-ifelse.mk
            varmod-indirect.exp varmod-indirect.mk varmod-localtime.exp
            varmod-localtime.mk varmod-loop-delete.exp varmod-loop-delete.mk
            varmod-loop-varname.exp varmod-loop-varname.mk
            varmod-match-escape.exp varmod-match-escape.mk varmod-match.exp
            varmod-match.mk varmod-mtime.exp varmod-mtime.mk varmod-range.exp
            varmod-range.mk varmod-subst-regex.exp varmod-subst.exp
            varmod-to-separator.exp varmod-to-separator.mk varmod.exp varmod.mk
            varparse-errors.exp varparse-errors.mk

Log Message:
make: provide more context information for parse/evaluate errors


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/make/compat.c
cvs rdiff -u -r1.467 -r1.468 src/usr.bin/make/job.c
cvs rdiff -u -r1.329 -r1.330 src/usr.bin/make/make.h
cvs rdiff -u -r1.719 -r1.720 src/usr.bin/make/parse.c
cvs rdiff -u -r1.1101 -r1.1102 src/usr.bin/make/var.c
cvs rdiff -u -r1.342 -r1.343 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/cmd-errors-jobs.exp \
    src/usr.bin/make/unit-tests/cmd-errors-lint.exp \
    src/usr.bin/make/unit-tests/varmod-subst.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/cmd-errors-jobs.mk
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/cmd-errors.exp \
    src/usr.bin/make/unit-tests/varmod-mtime.exp
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/cond-token-string.exp \
    src/usr.bin/make/unit-tests/directive-include.exp \
    src/usr.bin/make/unit-tests/var-eval-short.mk \
    src/usr.bin/make/unit-tests/varmod-range.exp \
    src/usr.bin/make/unit-tests/varmod-to-separator.exp \
    src/usr.bin/make/unit-tests/varparse-errors.mk
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/cond-token-string.mk \
    src/usr.bin/make/unit-tests/directive-for-errors.mk \
    src/usr.bin/make/unit-tests/directive-undef.exp \
    src/usr.bin/make/unit-tests/vardebug.mk \
    src/usr.bin/make/unit-tests/varmod-mtime.mk
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/deptgt.exp \
    src/usr.bin/make/unit-tests/varmod-match-escape.mk
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/unit-tests/deptgt.mk \
    src/usr.bin/make/unit-tests/opt-debug-lint.mk \
    src/usr.bin/make/unit-tests/varmod-edge.exp \
    src/usr.bin/make/unit-tests/varmod-gmtime.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/directive-for-errors.exp
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/make/unit-tests/directive-for.exp \
    src/usr.bin/make/unit-tests/varmod-gmtime.mk
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/make/unit-tests/directive-for.mk \
    src/usr.bin/make/unit-tests/var-eval-short.exp
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/directive-include.mk \
    src/usr.bin/make/unit-tests/directive-undef.mk \
    src/usr.bin/make/unit-tests/varmod-localtime.exp \
    src/usr.bin/make/unit-tests/varmod-to-separator.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/lint.exp \
    src/usr.bin/make/unit-tests/varmod-hash.exp \
    src/usr.bin/make/unit-tests/varmod-loop-delete.exp \
    src/usr.bin/make/unit-tests/varmod-loop-delete.mk
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/make/unit-tests/moderrs.exp \
    src/usr.bin/make/unit-tests/vardebug.exp
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/make/unit-tests/opt-debug-lint.exp \
    src/usr.bin/make/unit-tests/varmod-indirect.mk \
    src/usr.bin/make/unit-tests/varmod-match-escape.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/var-op-expand.exp \
    src/usr.bin/make/unit-tests/varmod.exp
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/make/unit-tests/var-op-expand.mk \
    src/usr.bin/make/unit-tests/varmisc.exp \
    src/usr.bin/make/unit-tests/varmod-assign.exp \
    src/usr.bin/make/unit-tests/varmod-assign.mk \
    src/usr.bin/make/unit-tests/varmod-edge.mk \
    src/usr.bin/make/unit-tests/varmod-ifelse.exp
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/make/unit-tests/varmod-ifelse.mk
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/make/unit-tests/varmod-indirect.exp
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/varmod-localtime.mk \
    src/usr.bin/make/unit-tests/varmod-match.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varmod-loop-varname.exp \
    src/usr.bin/make/unit-tests/varmod-loop-varname.mk \
    src/usr.bin/make/unit-tests/varmod-subst-regex.exp
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/make/unit-tests/varmod-match.mk
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/varmod-range.mk \
    src/usr.bin/make/unit-tests/varmod.mk \
    src/usr.bin/make/unit-tests/varparse-errors.exp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.254 src/usr.bin/make/compat.c:1.255
--- src/usr.bin/make/compat.c:1.254	Sun Mar 10 02:53:37 2024
+++ src/usr.bin/make/compat.c	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.254 2024/03/10 02:53:37 sjg Exp $	*/
+/*	$NetBSD: compat.c,v 1.255 2024/04/20 10:18:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -91,7 +91,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.254 2024/03/10 02:53:37 sjg Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.255 2024/04/20 10:18:55 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -234,7 +234,9 @@ Compat_RunCommand(const char *cmdp, GNod
 	errCheck = !(gn->type & OP_IGNORE);
 	doIt = false;
 
+	EvalStack_Push(gn->name, NULL, NULL);
 	cmdStart = Var_Subst(cmd, gn, VARE_WANTRES);
+	EvalStack_Pop();
 	/* TODO: handle errors */
 
 	if (cmdStart[0] == '\0') {

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.467 src/usr.bin/make/job.c:1.468
--- src/usr.bin/make/job.c:1.467	Sun Mar 10 02:53:37 2024
+++ src/usr.bin/make/job.c	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.467 2024/03/10 02:53:37 sjg Exp $	*/
+/*	$NetBSD: job.c,v 1.468 2024/04/20 10:18:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -141,7 +141,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.467 2024/03/10 02:53:37 sjg Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.468 2024/04/20 10:18:55 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -901,7 +901,9 @@ JobWriteCommand(Job *job, ShellWriter *w
 
 	run = GNode_ShouldExecute(job->node);
 
+	EvalStack_Push(job->node->name, NULL, NULL);
 	xcmd = Var_Subst(ucmd, job->node, VARE_WANTRES);
+	EvalStack_Pop();
 	/* TODO: handle errors */
 	xcmdStart = xcmd;
 
@@ -1028,7 +1030,9 @@ JobSaveCommands(Job *job)
 		 * variables such as .TARGET, .IMPSRC.  It is not intended to
 		 * expand the other variables as well; see deptgt-end.mk.
 		 */
+		EvalStack_Push(job->node->name, NULL, NULL);
 		expanded_cmd = Var_Subst(cmd, job->node, VARE_WANTRES);
+		EvalStack_Pop();
 		/* TODO: handle errors */
 		Lst_Append(&Targ_GetEndNode()->commands, expanded_cmd);
 	}

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.329 src/usr.bin/make/make.h:1.330
--- src/usr.bin/make/make.h:1.329	Sun Mar 10 02:53:37 2024
+++ src/usr.bin/make/make.h	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.329 2024/03/10 02:53:37 sjg Exp $	*/
+/*	$NetBSD: make.h,v 1.330 2024/04/20 10:18:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -1023,6 +1023,10 @@ void Global_Append(const char *, const c
 void Global_Delete(const char *);
 void Global_Set_ReadOnly(const char *, const char *);
 
+void EvalStack_Push(const char *, const char *, const char *);
+void EvalStack_Pop(void);
+const char *EvalStack_Details(void);
+
 /* util.c */
 typedef void (*SignalProc)(int);
 SignalProc bmake_signal(int, SignalProc);

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.719 src/usr.bin/make/parse.c:1.720
--- src/usr.bin/make/parse.c:1.719	Sun Apr 14 12:30:47 2024
+++ src/usr.bin/make/parse.c	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.719 2024/04/14 12:30:47 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.720 2024/04/20 10:18:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -105,7 +105,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.719 2024/04/14 12:30:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.720 2024/04/20 10:18:55 rillig Exp $");
 
 /* Detects a multiple-inclusion guard in a makefile. */
 typedef enum {
@@ -521,6 +521,7 @@ ParseVErrorInternal(FILE *f, bool useVar
 	(void)fprintf(f, "%s: ", progname);
 
 	PrintLocation(f, useVars, gn);
+	fprintf(f, "%s", EvalStack_Details());
 	if (level == PARSE_WARNING)
 		(void)fprintf(f, "warning: ");
 	(void)vfprintf(f, fmt, ap);

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1101 src/usr.bin/make/var.c:1.1102
--- src/usr.bin/make/var.c:1.1101	Fri Mar  1 17:53:30 2024
+++ src/usr.bin/make/var.c	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1101 2024/03/01 17:53:30 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1102 2024/04/20 10:18:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -137,7 +137,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1101 2024/03/01 17:53:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1102 2024/04/20 10:18:55 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -258,6 +258,18 @@ typedef struct SepBuf {
 	char sep;
 } SepBuf;
 
+typedef struct {
+	const char *target;
+	const char *varname;
+	const char *expr;
+} EvalStackElement;
+
+typedef struct {
+	EvalStackElement *elems;
+	size_t len;
+	size_t cap;
+	Buffer details;
+} EvalStack;
 
 /* Whether we have replaced the original environ (which we cannot free). */
 char **savedEnv = NULL;
@@ -326,6 +338,58 @@ static const char VarEvalMode_Name[][32]
 	"eval-keep-dollar-and-undefined",
 };
 
+static EvalStack evalStack;
+
+
+void
+EvalStack_Push(const char *target, const char *expr, const char *varname)
+{
+	if (evalStack.len >= evalStack.cap) {
+		evalStack.cap = 16 + 2 * evalStack.cap;
+		evalStack.elems = bmake_realloc(evalStack.elems,
+		    evalStack.cap * sizeof(*evalStack.elems));
+	}
+	evalStack.elems[evalStack.len].target = target;
+	evalStack.elems[evalStack.len].expr = expr;
+	evalStack.elems[evalStack.len].varname = varname;
+	evalStack.len++;
+}
+
+void
+EvalStack_Pop(void)
+{
+	assert(evalStack.len > 0);
+	evalStack.len--;
+}
+
+const char *
+EvalStack_Details(void)
+{
+	size_t i;
+	Buffer *buf = &evalStack.details;
+
+
+	buf->len = 0;
+	for (i = 0; i < evalStack.len; i++) {
+		EvalStackElement *elem = evalStack.elems + i;
+		if (elem->target != NULL) {
+			Buf_AddStr(buf, "in target \"");
+			Buf_AddStr(buf, elem->target);
+			Buf_AddStr(buf, "\": ");
+		}
+		if (elem->expr != NULL) {
+			Buf_AddStr(buf, "while evaluating \"");
+			Buf_AddStr(buf, elem->expr);
+			Buf_AddStr(buf, "\": ");
+		}
+		if (elem->varname != NULL) {
+			Buf_AddStr(buf, "while evaluating variable \"");
+			Buf_AddStr(buf, elem->varname);
+			Buf_AddStr(buf, "\": ");
+		}
+	}
+	return buf->len > 0 ? buf->data : "";
+}
 
 static Var *
 VarNew(FStr name, const char *value,
@@ -2324,9 +2388,9 @@ ApplyModifier_Loop(const char **pp, ModC
 	args.var = tvar.str;
 	if (strchr(args.var, '$') != NULL) {
 		Parse_Error(PARSE_FATAL,
-		    "In the :@ modifier of \"%s\", the variable name \"%s\" "
+		    "In the :@ modifier, the variable name \"%s\" "
 		    "must not contain a dollar",
-		    expr->name, args.var);
+		    args.var);
 		return AMR_CLEANUP;
 	}
 
@@ -4503,6 +4567,11 @@ Var_Parse(const char **pp, GNode *scope,
 	 */
 	expr.value = FStr_InitRefer(v->val.data);
 
+	if (expr.name[0] != '\0')
+		EvalStack_Push(NULL, NULL, expr.name);
+	else
+		EvalStack_Push(NULL, start, NULL);
+
 	/*
 	 * Before applying any modifiers, expand any nested expressions from
 	 * the variable value.
@@ -4559,6 +4628,7 @@ Var_Parse(const char **pp, GNode *scope,
 		VarFreeShortLived(v);
 	}
 
+	EvalStack_Pop();
 	return expr.value;
 }
 

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.342 src/usr.bin/make/unit-tests/Makefile:1.343
--- src/usr.bin/make/unit-tests/Makefile:1.342	Sun Jan  7 02:07:44 2024
+++ src/usr.bin/make/unit-tests/Makefile	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.342 2024/01/07 02:07:44 sjg Exp $
+# $NetBSD: Makefile,v 1.343 2024/04/20 10:18:55 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -559,7 +559,7 @@ SED_CMDS.suff-transform-debug+=	${STD_SE
 SED_CMDS.var-op-shell+=		${STD_SED_CMDS.shell}
 SED_CMDS.var-op-shell+=		-e '/command/s,No such.*,not found,'
 SED_CMDS.vardebug+=		-e 's,${.SHELL},</path/to/shell>,'
-SED_CMDS.varmod-mtime+=		-e "s,': .*,': <ENOENT>,"
+SED_CMDS.varmod-mtime+=		-e "s,\(.*\)': .*,\1': <ENOENT>,"
 SED_CMDS.varmod-subst-regex+=	${STD_SED_CMDS.regex}
 SED_CMDS.varparse-errors+=	${STD_SED_CMDS.timestamp}
 SED_CMDS.varname-dot-make-meta-ignore_filter+= ${SED_CMDS.meta-ignore}

Index: src/usr.bin/make/unit-tests/cmd-errors-jobs.exp
diff -u src/usr.bin/make/unit-tests/cmd-errors-jobs.exp:1.4 src/usr.bin/make/unit-tests/cmd-errors-jobs.exp:1.5
--- src/usr.bin/make/unit-tests/cmd-errors-jobs.exp:1.4	Sun Nov 19 22:06:15 2023
+++ src/usr.bin/make/unit-tests/cmd-errors-jobs.exp	Sat Apr 20 10:18:55 2024
@@ -1,9 +1,9 @@
 : undefined--eol
-make: Unclosed variable "UNCLOSED"
+make: in target "unclosed-variable": Unclosed variable "UNCLOSED"
 : unclosed-variable-
 make: Unclosed expression, expecting '}' for "UNCLOSED"
 : unclosed-modifier-
-make: Unknown modifier "Z"
+make: in target "unknown-modifier": while evaluating variable "UNKNOWN": Unknown modifier "Z"
 : unknown-modifier--eol
 : end-eol
 exit status 0
Index: src/usr.bin/make/unit-tests/cmd-errors-lint.exp
diff -u src/usr.bin/make/unit-tests/cmd-errors-lint.exp:1.4 src/usr.bin/make/unit-tests/cmd-errors-lint.exp:1.5
--- src/usr.bin/make/unit-tests/cmd-errors-lint.exp:1.4	Sun Nov 19 22:06:15 2023
+++ src/usr.bin/make/unit-tests/cmd-errors-lint.exp	Sat Apr 20 10:18:55 2024
@@ -1,9 +1,9 @@
 : undefined 
-make: Unclosed variable "UNCLOSED"
+make: in target "unclosed-variable": Unclosed variable "UNCLOSED"
 : unclosed-variable 
 make: Unclosed expression, expecting '}' for "UNCLOSED"
 : unclosed-modifier 
-make: Unknown modifier "Z"
+make: in target "unknown-modifier": while evaluating variable "UNKNOWN": Unknown modifier "Z"
 : unknown-modifier 
 : end
 exit status 2
Index: src/usr.bin/make/unit-tests/varmod-subst.exp
diff -u src/usr.bin/make/unit-tests/varmod-subst.exp:1.4 src/usr.bin/make/unit-tests/varmod-subst.exp:1.5
--- src/usr.bin/make/unit-tests/varmod-subst.exp:1.4	Tue Feb 23 15:19:41 2021
+++ src/usr.bin/make/unit-tests/varmod-subst.exp	Sat Apr 20 10:18:55 2024
@@ -45,7 +45,7 @@ mod-subst-delimiter:
 1 two 3 tilde
 mod-subst-chain:
 A B c.
-make: Unknown modifier "i"
+make: in target "mod-subst-chain": while evaluating "${:Uvalue:S,a,x,i}.": Unknown modifier "i"
 .
 mod-subst-dollar:$1:
 mod-subst-dollar:$2:

Index: src/usr.bin/make/unit-tests/cmd-errors-jobs.mk
diff -u src/usr.bin/make/unit-tests/cmd-errors-jobs.mk:1.2 src/usr.bin/make/unit-tests/cmd-errors-jobs.mk:1.3
--- src/usr.bin/make/unit-tests/cmd-errors-jobs.mk:1.2	Sun Sep 25 12:51:37 2022
+++ src/usr.bin/make/unit-tests/cmd-errors-jobs.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: cmd-errors-jobs.mk,v 1.2 2022/09/25 12:51:37 rillig Exp $
+# $NetBSD: cmd-errors-jobs.mk,v 1.3 2024/04/20 10:18:55 rillig Exp $
 #
 # Demonstrate how errors in variable expansions affect whether the commands
 # are actually executed in jobs mode.
@@ -8,25 +8,31 @@
 all: undefined unclosed-variable unclosed-modifier unknown-modifier end
 
 # Undefined variables are not an error.  They expand to empty strings.
+# expect: : undefined--eol
 undefined:
 	: $@-${UNDEFINED}-eol
 
-# XXX: As of 2020-11-01, this command is executed even though it contains
-# parse errors.
+# XXX: This command is executed even though it contains parse errors.
+# expect: make: in target "unclosed-variable": Unclosed variable "UNCLOSED"
+# expect: : unclosed-variable-
 unclosed-variable:
 	: $@-${UNCLOSED
 
-# XXX: As of 2020-11-01, this command is executed even though it contains
-# parse errors.
+# XXX: This command is executed even though it contains parse errors.
+# expect: make: Unclosed expression, expecting '}' for "UNCLOSED"
+# expect: : unclosed-modifier-
 unclosed-modifier:
 	: $@-${UNCLOSED:
 
-# XXX: As of 2020-11-01, this command is executed even though it contains
-# parse errors.
+# XXX: This command is executed even though it contains parse errors.
+# expect: make: in target "unknown-modifier": while evaluating variable "UNKNOWN": Unknown modifier "Z"
+# expect: : unknown-modifier--eol
 unknown-modifier:
 	: $@-${UNKNOWN:Z}-eol
 
+# expect: : end-eol
 end:
 	: $@-eol
 
-# XXX: As of 2020-11-02, despite the parse errors, the exit status is 0.
+# XXX: Despite the parse errors, the exit status is 0.
+# expect: exit status 0

Index: src/usr.bin/make/unit-tests/cmd-errors.exp
diff -u src/usr.bin/make/unit-tests/cmd-errors.exp:1.7 src/usr.bin/make/unit-tests/cmd-errors.exp:1.8
--- src/usr.bin/make/unit-tests/cmd-errors.exp:1.7	Sun Nov 19 22:06:15 2023
+++ src/usr.bin/make/unit-tests/cmd-errors.exp	Sat Apr 20 10:18:55 2024
@@ -1,9 +1,9 @@
 : undefined--eol
-make: Unclosed variable "UNCLOSED"
+make: in target "unclosed-variable": Unclosed variable "UNCLOSED"
 : unclosed-variable-
 make: Unclosed expression, expecting '}' for "UNCLOSED"
 : unclosed-modifier-
-make: Unknown modifier "Z"
+make: in target "unknown-modifier": while evaluating variable "UNKNOWN": Unknown modifier "Z"
 : unknown-modifier--eol
 : end-eol
 exit status 0
Index: src/usr.bin/make/unit-tests/varmod-mtime.exp
diff -u src/usr.bin/make/unit-tests/varmod-mtime.exp:1.7 src/usr.bin/make/unit-tests/varmod-mtime.exp:1.8
--- src/usr.bin/make/unit-tests/varmod-mtime.exp:1.7	Sun Nov 19 12:11:34 2023
+++ src/usr.bin/make/unit-tests/varmod-mtime.exp	Sat Apr 20 10:18:55 2024
@@ -1,13 +1,13 @@
-make: "varmod-mtime.mk" line 47: Invalid argument '123x' for modifier ':mtime'
+make: "varmod-mtime.mk" line 47: while evaluating variable "no/such/file": Invalid argument '123x' for modifier ':mtime'
 make: "varmod-mtime.mk" line 47: Malformed conditional (${no/such/file:L:mtime=123x})
-make: "varmod-mtime.mk" line 70: Cannot determine mtime for 'no/such/file1': <ENOENT>
-make: "varmod-mtime.mk" line 70: Cannot determine mtime for 'no/such/file2': <ENOENT>
+make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file1': <ENOENT>
+make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file2': <ENOENT>
 make: "varmod-mtime.mk" line 70: Malformed conditional (${no/such/file1 no/such/file2:L:mtime=error})
-make: "varmod-mtime.mk" line 81: Invalid argument 'errorhandler-no' for modifier ':mtime'
+make: "varmod-mtime.mk" line 81: while evaluating variable "MAKEFILE": Invalid argument 'errorhandler-no' for modifier ':mtime'
 make: "varmod-mtime.mk" line 81: Malformed conditional (${MAKEFILE:mtime=errorhandler-no} > 0)
-make: "varmod-mtime.mk" line 90: Invalid argument 'warn' for modifier ':mtime'
+make: "varmod-mtime.mk" line 90: while evaluating variable "MAKEFILE": Invalid argument 'warn' for modifier ':mtime'
 make: "varmod-mtime.mk" line 90: Malformed conditional (${MAKEFILE:mtime=warn} > 0)
-make: "varmod-mtime.mk" line 115: Unknown modifier "mtim"
+make: "varmod-mtime.mk" line 115: while evaluating variable "anything": Unknown modifier "mtim"
 make: "varmod-mtime.mk" line 115: Malformed conditional (${anything:L:mtim})
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests

Index: src/usr.bin/make/unit-tests/cond-token-string.exp
diff -u src/usr.bin/make/unit-tests/cond-token-string.exp:1.11 src/usr.bin/make/unit-tests/cond-token-string.exp:1.12
--- src/usr.bin/make/unit-tests/cond-token-string.exp:1.11	Sun Nov 19 21:47:52 2023
+++ src/usr.bin/make/unit-tests/cond-token-string.exp	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-make: "cond-token-string.mk" line 15: Unknown modifier "Z"
+make: "cond-token-string.mk" line 15: while evaluating "${:Uvalue:Z}"": Unknown modifier "Z"
 make: "cond-token-string.mk" line 15: Malformed conditional ("" != "${:Uvalue:Z}")
 make: "cond-token-string.mk" line 25: xvalue is not defined.
 make: "cond-token-string.mk" line 32: Malformed conditional (x${:Uvalue} == "")
Index: src/usr.bin/make/unit-tests/directive-include.exp
diff -u src/usr.bin/make/unit-tests/directive-include.exp:1.11 src/usr.bin/make/unit-tests/directive-include.exp:1.12
--- src/usr.bin/make/unit-tests/directive-include.exp:1.11	Sat Aug 19 10:52:14 2023
+++ src/usr.bin/make/unit-tests/directive-include.exp	Sat Apr 20 10:18:55 2024
@@ -4,7 +4,7 @@ CondParser_Eval: ${.MAKE.MAKEFILES:T} !=
 Comparing "directive-include.mk null" != "directive-include.mk null"
 make: "directive-include.mk" line 26: Could not find nonexistent.mk
 make: "directive-include.mk" line 49: Could not find "
-make: "directive-include.mk" line 56: Unknown modifier "Z"
+make: "directive-include.mk" line 56: while evaluating "${:U123:Z}.mk": Unknown modifier "Z"
 make: "directive-include.mk" line 56: Could not find nonexistent.mk
 make: "directive-include.mk" line 61: Cannot open /nonexistent
 make: "directive-include.mk" line 66: Invalid line 'include'
Index: src/usr.bin/make/unit-tests/var-eval-short.mk
diff -u src/usr.bin/make/unit-tests/var-eval-short.mk:1.11 src/usr.bin/make/unit-tests/var-eval-short.mk:1.12
--- src/usr.bin/make/unit-tests/var-eval-short.mk:1.11	Thu Oct 19 18:24:33 2023
+++ src/usr.bin/make/unit-tests/var-eval-short.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: var-eval-short.mk,v 1.11 2023/10/19 18:24:33 rillig Exp $
+# $NetBSD: var-eval-short.mk,v 1.12 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for each variable modifier to ensure that they only do the minimum
 # necessary computations.  If the result of the expression is irrelevant,
@@ -41,7 +41,7 @@ FAIL=	${:!echo unexpected 1>&2!}
 # after the loop, when undefining the temporary global loop variable.
 # Since var.c 1.907 from 2021-04-04, a '$' is no longer allowed in the
 # variable name.
-# expect+2: In the :@ modifier of "", the variable name "${FAIL}" must not contain a dollar
+# expect+2: while evaluating "${:Uword:@${FAIL}@expr@}": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar
 # expect+1: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@})
 .if 0 && ${:Uword:@${FAIL}@expr@}
 .endif
Index: src/usr.bin/make/unit-tests/varmod-range.exp
diff -u src/usr.bin/make/unit-tests/varmod-range.exp:1.11 src/usr.bin/make/unit-tests/varmod-range.exp:1.12
--- src/usr.bin/make/unit-tests/varmod-range.exp:1.11	Sun Dec 17 14:07:22 2023
+++ src/usr.bin/make/unit-tests/varmod-range.exp	Sat Apr 20 10:18:55 2024
@@ -1,13 +1,13 @@
 make: "varmod-range.mk" line 43: Malformed conditional (${:range=5} != "")
-make: "varmod-range.mk" line 67: Invalid number "x}Rest" != "Rest"" for ':range' modifier
+make: "varmod-range.mk" line 67: while evaluating "${:U:range=x}Rest" != "Rest"": Invalid number "x}Rest" != "Rest"" for ':range' modifier
 make: "varmod-range.mk" line 67: Malformed conditional ("${:U:range=x}Rest" != "Rest")
-make: "varmod-range.mk" line 78: Unknown modifier "x0"
+make: "varmod-range.mk" line 78: while evaluating "${:U:range=0x0}Rest" != "Rest"": Unknown modifier "x0"
 make: "varmod-range.mk" line 78: Malformed conditional ("${:U:range=0x0}Rest" != "Rest")
-make: "varmod-range.mk" line 96: Unknown modifier "rang"
+make: "varmod-range.mk" line 96: while evaluating variable "a b c": Unknown modifier "rang"
 make: "varmod-range.mk" line 96: Malformed conditional ("${a b c:L:rang}Rest" != "Rest")
-make: "varmod-range.mk" line 105: Unknown modifier "rango"
+make: "varmod-range.mk" line 105: while evaluating variable "a b c": Unknown modifier "rango"
 make: "varmod-range.mk" line 105: Malformed conditional ("${a b c:L:rango}Rest" != "Rest")
-make: "varmod-range.mk" line 114: Unknown modifier "ranger"
+make: "varmod-range.mk" line 114: while evaluating variable "a b c": Unknown modifier "ranger"
 make: "varmod-range.mk" line 114: Malformed conditional ("${a b c:L:ranger}Rest" != "Rest")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/varmod-to-separator.exp
diff -u src/usr.bin/make/unit-tests/varmod-to-separator.exp:1.11 src/usr.bin/make/unit-tests/varmod-to-separator.exp:1.12
--- src/usr.bin/make/unit-tests/varmod-to-separator.exp:1.11	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/varmod-to-separator.exp	Sat Apr 20 10:18:55 2024
@@ -1,6 +1,6 @@
-make: "varmod-to-separator.mk" line 155: Invalid character number at "400:tu}"
+make: "varmod-to-separator.mk" line 155: while evaluating variable "WORDS": Invalid character number at "400:tu}"
 make: "varmod-to-separator.mk" line 155: Malformed conditional (${WORDS:[1..3]:ts\400:tu})
-make: "varmod-to-separator.mk" line 171: Invalid character number at "100:tu}"
+make: "varmod-to-separator.mk" line 171: while evaluating variable "WORDS": Invalid character number at "100:tu}"
 make: "varmod-to-separator.mk" line 171: Malformed conditional (${WORDS:[1..3]:ts\x100:tu})
 make: Bad modifier ":ts\-300" for variable "WORDS"
 make: "varmod-to-separator.mk" line 179: Malformed conditional (${WORDS:[1..3]:ts\-300:tu})
@@ -18,7 +18,7 @@ make: Bad modifier ":t\X" for variable "
 make: "varmod-to-separator.mk" line 232: Malformed conditional (${WORDS:t\X} != "anything")
 make: Bad modifier ":ts\69" for variable ""
 make: "varmod-to-separator.mk" line 249: Malformed conditional (${:Ua b:ts\69})
-make: "varmod-to-separator.mk" line 258: Invalid character number at "1F60E}"
+make: "varmod-to-separator.mk" line 258: while evaluating "${:Ua b:ts\x1F60E}": Invalid character number at "1F60E}"
 make: "varmod-to-separator.mk" line 258: Malformed conditional (${:Ua b:ts\x1F60E})
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/varparse-errors.mk
diff -u src/usr.bin/make/unit-tests/varparse-errors.mk:1.11 src/usr.bin/make/unit-tests/varparse-errors.mk:1.12
--- src/usr.bin/make/unit-tests/varparse-errors.mk:1.11	Sun Nov 19 22:32:44 2023
+++ src/usr.bin/make/unit-tests/varparse-errors.mk	Sat Apr 20 10:18:56 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varparse-errors.mk,v 1.11 2023/11/19 22:32:44 rillig Exp $
+# $NetBSD: varparse-errors.mk,v 1.12 2024/04/20 10:18:56 rillig Exp $
 
 # Tests for parsing and evaluating all kinds of expressions.
 #
@@ -34,7 +34,7 @@ ERR_EVAL=	An evaluation error ${:Uvalue:
 # As of 2020-12-01, errors in the variable name are silently ignored.
 # Since var.c 1.754 from 2020-12-20, unknown modifiers at parse time result
 # in an error message and a non-zero exit status.
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating "${:U:Z}": Unknown modifier "Z"
 VAR.${:U:Z}=	unknown modifier in the variable name
 .if ${VAR.} != "unknown modifier in the variable name"
 .  error
@@ -43,7 +43,7 @@ VAR.${:U:Z}=	unknown modifier in the var
 # As of 2020-12-01, errors in the variable name are silently ignored.
 # Since var.c 1.754 from 2020-12-20, unknown modifiers at parse time result
 # in an error message and a non-zero exit status.
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating "${:U:Z}post": Unknown modifier "Z"
 VAR.${:U:Z}post=	unknown modifier with text in the variable name
 .if ${VAR.post} != "unknown modifier with text in the variable name"
 .  error

Index: src/usr.bin/make/unit-tests/cond-token-string.mk
diff -u src/usr.bin/make/unit-tests/cond-token-string.mk:1.9 src/usr.bin/make/unit-tests/cond-token-string.mk:1.10
--- src/usr.bin/make/unit-tests/cond-token-string.mk:1.9	Sun Nov 19 21:47:52 2023
+++ src/usr.bin/make/unit-tests/cond-token-string.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: cond-token-string.mk,v 1.9 2023/11/19 21:47:52 rillig Exp $
+# $NetBSD: cond-token-string.mk,v 1.10 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for quoted string literals in .if conditions.
 #
@@ -11,7 +11,7 @@
 # Cover the code in CondParser_String that frees the memory after parsing
 # an expression based on an undefined variable.
 # expect+2: Malformed conditional ("" != "${:Uvalue:Z}")
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating "${:Uvalue:Z}"": Unknown modifier "Z"
 .if "" != "${:Uvalue:Z}"
 .  error
 .else
Index: src/usr.bin/make/unit-tests/directive-for-errors.mk
diff -u src/usr.bin/make/unit-tests/directive-for-errors.mk:1.9 src/usr.bin/make/unit-tests/directive-for-errors.mk:1.10
--- src/usr.bin/make/unit-tests/directive-for-errors.mk:1.9	Tue Dec 19 19:33:40 2023
+++ src/usr.bin/make/unit-tests/directive-for-errors.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for-errors.mk,v 1.9 2023/12/19 19:33:40 rillig Exp $
+# $NetBSD: directive-for-errors.mk,v 1.10 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for error handling in .for loops.
 
@@ -85,7 +85,7 @@ ${:U\\}=	backslash	# see whether the "va
 #
 # XXX: As of 2020-12-31, Var_Subst doesn't report any errors, therefore
 # the loop body is expanded as if no error had happened.
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating "${:U3:Z} 4": Unknown modifier "Z"
 .for i in 1 2 ${:U3:Z} 4
 .  warning Should not be reached.
 .endfor
Index: src/usr.bin/make/unit-tests/directive-undef.exp
diff -u src/usr.bin/make/unit-tests/directive-undef.exp:1.9 src/usr.bin/make/unit-tests/directive-undef.exp:1.10
--- src/usr.bin/make/unit-tests/directive-undef.exp:1.9	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/directive-undef.exp	Sat Apr 20 10:18:55 2024
@@ -1,5 +1,5 @@
 make: "directive-undef.mk" line 30: The .undef directive requires an argument
-make: "directive-undef.mk" line 88: Unknown modifier "Z"
+make: "directive-undef.mk" line 88: while evaluating variable "VARNAMES": Unknown modifier "Z"
 make: "directive-undef.mk" line 105: warning: UT_EXPORTED is still listed in .MAKE.EXPORTED even though spaceit is not exported anymore.
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/vardebug.mk
diff -u src/usr.bin/make/unit-tests/vardebug.mk:1.9 src/usr.bin/make/unit-tests/vardebug.mk:1.10
--- src/usr.bin/make/unit-tests/vardebug.mk:1.9	Wed Dec 20 09:46:00 2023
+++ src/usr.bin/make/unit-tests/vardebug.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: vardebug.mk,v 1.9 2023/12/20 09:46:00 rillig Exp $
+# $NetBSD: vardebug.mk,v 1.10 2024/04/20 10:18:55 rillig Exp $
 #
 # Demonstrates the debugging output for var.c.
 
@@ -59,7 +59,7 @@ VAR+=		3
 # as "is error", without surrounding quotes.
 # expect: Result of ${:unknown} is error (eval-defined, defined)
 # expect+2: Malformed conditional (${:Uvariable:unknown})
-# expect+1: Unknown modifier "unknown"
+# expect+1: while evaluating "${:Uvariable:unknown}": Unknown modifier "unknown"
 .if ${:Uvariable:unknown}
 .endif
 
Index: src/usr.bin/make/unit-tests/varmod-mtime.mk
diff -u src/usr.bin/make/unit-tests/varmod-mtime.mk:1.9 src/usr.bin/make/unit-tests/varmod-mtime.mk:1.10
--- src/usr.bin/make/unit-tests/varmod-mtime.mk:1.9	Sun Dec 17 14:07:22 2023
+++ src/usr.bin/make/unit-tests/varmod-mtime.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-mtime.mk,v 1.9 2023/12/17 14:07:22 rillig Exp $
+# $NetBSD: varmod-mtime.mk,v 1.10 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the ':mtime' variable modifier, which maps each word of the
 # expression to that file's modification time.
@@ -42,7 +42,7 @@ not_found_mtime:=	${no/such/file:L:mtime
 
 
 # The fallback timestamp must only be an integer, without trailing characters.
-# expect+2: Invalid argument '123x' for modifier ':mtime'
+# expect+2: while evaluating variable "no/such/file": Invalid argument '123x' for modifier ':mtime'
 # expect+1: Malformed conditional (${no/such/file:L:mtime=123x})
 .if ${no/such/file:L:mtime=123x}
 .  error
@@ -64,8 +64,8 @@ _!=	rm -f ${COOKIE}
 # If the optional argument of the ':mtime' modifier is the word 'error', the
 # modifier fails with an error message, once for each affected file.
 #
-# expect+3: Cannot determine mtime for 'no/such/file1': <ENOENT>
-# expect+2: Cannot determine mtime for 'no/such/file2': <ENOENT>
+# expect+3: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file1': <ENOENT>
+# expect+2: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file2': <ENOENT>
 # expect+1: Malformed conditional (${no/such/file1 no/such/file2:L:mtime=error})
 .if ${no/such/file1 no/such/file2:L:mtime=error}
 .  error
@@ -76,7 +76,7 @@ _!=	rm -f ${COOKIE}
 
 # Only the word 'error' is a special argument to the ':mtime' modifier, all
 # other words result in a parse error.
-# expect+2: Invalid argument 'errorhandler-no' for modifier ':mtime'
+# expect+2: while evaluating variable "MAKEFILE": Invalid argument 'errorhandler-no' for modifier ':mtime'
 # expect+1: Malformed conditional (${MAKEFILE:mtime=errorhandler-no} > 0)
 .if ${MAKEFILE:mtime=errorhandler-no} > 0
 .else
@@ -85,7 +85,7 @@ _!=	rm -f ${COOKIE}
 
 
 # Only the word 'error' can be used as a fallback argument to the modifier.
-# expect+2: Invalid argument 'warn' for modifier ':mtime'
+# expect+2: while evaluating variable "MAKEFILE": Invalid argument 'warn' for modifier ':mtime'
 # expect+1: Malformed conditional (${MAKEFILE:mtime=warn} > 0)
 .if ${MAKEFILE:mtime=warn} > 0
 .  error
@@ -110,7 +110,7 @@ end:=	${%s:L:gmtime}
 
 
 # If there is a typo in the modifier name, it does not match.
-# expect+2: Unknown modifier "mtim"
+# expect+2: while evaluating variable "anything": Unknown modifier "mtim"
 # expect+1: Malformed conditional (${anything:L:mtim})
 .if ${anything:L:mtim}
 .  error

Index: src/usr.bin/make/unit-tests/deptgt.exp
diff -u src/usr.bin/make/unit-tests/deptgt.exp:1.12 src/usr.bin/make/unit-tests/deptgt.exp:1.13
--- src/usr.bin/make/unit-tests/deptgt.exp:1.12	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/deptgt.exp	Sat Apr 20 10:18:55 2024
@@ -8,7 +8,7 @@ ParseDependency(: empty-source)
 Parsing line 39: 	: command for empty targets list
 Parsing line 40: .MAKEFLAGS: -d0
 ParseDependency(.MAKEFLAGS: -d0)
-make: "deptgt.mk" line 49: Unknown modifier "Z"
+make: "deptgt.mk" line 49: while evaluating "${:U:Z}:": Unknown modifier "Z"
 make: "deptgt.mk" line 52: warning: Extra target 'ordinary' ignored
 make: "deptgt.mk" line 55: warning: Extra target (ordinary) ignored
 make: "deptgt.mk" line 58: warning: Special and mundane targets don't mix. Mundane ones ignored
Index: src/usr.bin/make/unit-tests/varmod-match-escape.mk
diff -u src/usr.bin/make/unit-tests/varmod-match-escape.mk:1.12 src/usr.bin/make/unit-tests/varmod-match-escape.mk:1.13
--- src/usr.bin/make/unit-tests/varmod-match-escape.mk:1.12	Sun Nov 19 21:47:52 2023
+++ src/usr.bin/make/unit-tests/varmod-match-escape.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-match-escape.mk,v 1.12 2023/11/19 21:47:52 rillig Exp $
+# $NetBSD: varmod-match-escape.mk,v 1.13 2024/04/20 10:18:55 rillig Exp $
 #
 # As of 2020-08-01, the :M and :N modifiers interpret backslashes differently,
 # depending on whether there was an expression somewhere before the
@@ -65,7 +65,7 @@ VALUES=		: :: :\:
 
 # In lint mode, the case of a lonely '$' is covered with an error message.
 .MAKEFLAGS: -dL
-# expect+1: Dollar followed by nothing
+# expect+1: while evaluating "${:U\$:M\$} != """: Dollar followed by nothing
 .if ${:U\$:M\$} != ""
 .  error
 .endif
@@ -105,8 +105,8 @@ EXP.[^A-]]=	a
 EXP.[^A-]]]=	a]
 
 .for pattern in [A-] [A-]] [A-]]] [^A-] [^A-]] [^A-]]]
-# expect+2: warning: Unfinished character list in pattern '[A-]' of modifier ':M'
-# expect+1: warning: Unfinished character list in pattern '[^A-]' of modifier ':M'
+# expect+2: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[A-]' of modifier ':M'
+# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[^A-]' of modifier ':M'
 .  if ${WORDS:M${pattern}} != ${EXP.${pattern}}
 .    warning ${pattern}: ${WORDS:M${pattern}} != ${EXP.${pattern}}
 .  endif

Index: src/usr.bin/make/unit-tests/deptgt.mk
diff -u src/usr.bin/make/unit-tests/deptgt.mk:1.16 src/usr.bin/make/unit-tests/deptgt.mk:1.17
--- src/usr.bin/make/unit-tests/deptgt.mk:1.16	Sun Dec 17 09:44:00 2023
+++ src/usr.bin/make/unit-tests/deptgt.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt.mk,v 1.16 2023/12/17 09:44:00 rillig Exp $
+# $NetBSD: deptgt.mk,v 1.17 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for special targets like .BEGIN or .SUFFIXES in dependency
 # declarations.
@@ -45,7 +45,7 @@ ${:U}: empty-source
 # expansion would be to use the variable modifier '::=' to modify the
 # targets.  This in turn would be such an extreme and unreliable edge case
 # that nobody uses it.
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating "${:U:Z}:": Unknown modifier "Z"
 $$$$$$$${:U:Z}:
 
 # expect+1: warning: Extra target 'ordinary' ignored
Index: src/usr.bin/make/unit-tests/opt-debug-lint.mk
diff -u src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.16 src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.17
--- src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.16	Sun Nov 19 21:47:52 2023
+++ src/usr.bin/make/unit-tests/opt-debug-lint.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-lint.mk,v 1.16 2023/11/19 21:47:52 rillig Exp $
+# $NetBSD: opt-debug-lint.mk,v 1.17 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the -dL command line option, which runs additional checks
 # to catch common mistakes, such as unclosed expressions.
@@ -62,8 +62,8 @@ ${UNDEF}: ${UNDEF}
 
 # Since 2020-10-03, in lint mode the variable modifier must be separated
 # by colons.  See varparse-mod.mk.
-# expect+2: Missing delimiter ':' after modifier "L"
-# expect+1: Missing delimiter ':' after modifier "P"
+# expect+2: while evaluating variable "value": Missing delimiter ':' after modifier "L"
+# expect+1: while evaluating variable "value": Missing delimiter ':' after modifier "P"
 .if ${value:LPL} != "value"
 .  error
 .endif
@@ -72,7 +72,7 @@ ${UNDEF}: ${UNDEF}
 # variable modifier had to be separated by colons.  This was wrong though
 # since make always fell back trying to parse the indirect modifier as a
 # SysV modifier.
-# expect+1: Unknown modifier "${"
+# expect+1: while evaluating variable "value": Unknown modifier "${"
 .if ${value:${:UL}PL} != "LPL}"		# FIXME: "LPL}" is unexpected here.
 .  error ${value:${:UL}PL}
 .endif
Index: src/usr.bin/make/unit-tests/varmod-edge.exp
diff -u src/usr.bin/make/unit-tests/varmod-edge.exp:1.16 src/usr.bin/make/unit-tests/varmod-edge.exp:1.17
--- src/usr.bin/make/unit-tests/varmod-edge.exp:1.16	Sun Nov 19 22:06:15 2023
+++ src/usr.bin/make/unit-tests/varmod-edge.exp	Sat Apr 20 10:18:55 2024
@@ -15,10 +15,10 @@ make: "varmod-edge.mk" line 184: ok eq-b
 make: Unfinished modifier for "INP.eq-esc" ('=' missing)
 make: "varmod-edge.mk" line 184: ok eq-esc
 make: "varmod-edge.mk" line 184: ok colon
-make: "varmod-edge.mk" line 167: Unknown modifier ":"
-make: "varmod-edge.mk" line 167: Unknown modifier ":"
+make: "varmod-edge.mk" line 167: while evaluating variable "MOD.colons": while evaluating variable "INP.colons": Unknown modifier ":"
+make: "varmod-edge.mk" line 167: while evaluating variable "MOD.colons": while evaluating variable "INP.colons": Unknown modifier ":"
 make: "varmod-edge.mk" line 184: ok colons
-make: "varmod-edge.mk" line 195: Unknown modifier "Z"
+make: "varmod-edge.mk" line 195: while evaluating "${:Z}": Unknown modifier "Z"
 make: "varmod-edge.mk" line 195: Malformed conditional (${:Z})
 make: Unfinished modifier for "" (',' missing)
 make: "varmod-edge.mk" line 209: Malformed conditional (${:S,})
Index: src/usr.bin/make/unit-tests/varmod-gmtime.exp
diff -u src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.16 src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.17
--- src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.16	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/varmod-gmtime.exp	Sat Apr 20 10:18:55 2024
@@ -1,12 +1,12 @@
-make: "varmod-gmtime.mk" line 61: Invalid time value "-1"
+make: "varmod-gmtime.mk" line 61: while evaluating "${:L:gmtime=-1} != """: Invalid time value "-1"
 make: "varmod-gmtime.mk" line 61: Malformed conditional (${:L:gmtime=-1} != "")
-make: "varmod-gmtime.mk" line 72: Invalid time value " 1"
+make: "varmod-gmtime.mk" line 72: while evaluating "${:L:gmtime= 1} != """: Invalid time value " 1"
 make: "varmod-gmtime.mk" line 72: Malformed conditional (${:L:gmtime= 1} != "")
-make: "varmod-gmtime.mk" line 120: Invalid time value "10000000000000000000000000000000"
+make: "varmod-gmtime.mk" line 120: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000"
 make: "varmod-gmtime.mk" line 120: Malformed conditional (${:L:gmtime=10000000000000000000000000000000} != "")
-make: "varmod-gmtime.mk" line 133: Invalid time value "error"
+make: "varmod-gmtime.mk" line 133: while evaluating "${:L:gmtime=error} != """: Invalid time value "error"
 make: "varmod-gmtime.mk" line 133: Malformed conditional (${:L:gmtime=error} != "")
-make: "varmod-gmtime.mk" line 144: Invalid time value "100000S,1970,bad,"
+make: "varmod-gmtime.mk" line 144: while evaluating variable "%Y": Invalid time value "100000S,1970,bad,"
 make: "varmod-gmtime.mk" line 144: Malformed conditional (${%Y:L:gmtime=100000S,1970,bad,} != "bad")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests

Index: src/usr.bin/make/unit-tests/directive-for-errors.exp
diff -u src/usr.bin/make/unit-tests/directive-for-errors.exp:1.5 src/usr.bin/make/unit-tests/directive-for-errors.exp:1.6
--- src/usr.bin/make/unit-tests/directive-for-errors.exp:1.5	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/directive-for-errors.exp	Sat Apr 20 10:18:55 2024
@@ -8,7 +8,7 @@ make: "directive-for-errors.mk" line 44:
 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"
+make: "directive-for-errors.mk" line 89: while evaluating "${:U3:Z} 4": Unknown modifier "Z"
 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.

Index: src/usr.bin/make/unit-tests/directive-for.exp
diff -u src/usr.bin/make/unit-tests/directive-for.exp:1.21 src/usr.bin/make/unit-tests/directive-for.exp:1.22
--- src/usr.bin/make/unit-tests/directive-for.exp:1.21	Wed Dec  6 22:28:20 2023
+++ src/usr.bin/make/unit-tests/directive-for.exp	Sat Apr 20 10:18:55 2024
@@ -17,7 +17,7 @@ make: "directive-for.mk" line 146: }{ }{
 make: "directive-for.mk" line 166: invalid character ':' in .for loop variable name
 make: "directive-for.mk" line 173: invalid character '$' in .for loop variable name
 make: "directive-for.mk" line 185: invalid character '$' in .for loop variable name
-make: "directive-for.mk" line 210: Unknown modifier "Z"
+make: "directive-for.mk" line 210: while evaluating "${:Uword2:Z}-after word3": Unknown modifier "Z"
 make: "directive-for.mk" line 211: XXX: Should not reach word1
 make: "directive-for.mk" line 211: XXX: Should not reach before--after
 make: "directive-for.mk" line 211: XXX: Should not reach word3
Index: src/usr.bin/make/unit-tests/varmod-gmtime.mk
diff -u src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.21 src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.22
--- src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.21	Sun Nov 19 21:47:52 2023
+++ src/usr.bin/make/unit-tests/varmod-gmtime.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-gmtime.mk,v 1.21 2023/11/19 21:47:52 rillig Exp $
+# $NetBSD: varmod-gmtime.mk,v 1.22 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the :gmtime variable modifier, which formats a timestamp
 # using strftime(3) in UTC.
@@ -56,7 +56,7 @@
 # 1970.  Going back 50 years in the past is not a practical use case for
 # make.  Therefore, since var.c 1.631, negative time stamps produce a
 # parse error.
-# expect+2: Invalid time value "-1"
+# expect+2: while evaluating "${:L:gmtime=-1} != """: Invalid time value "-1"
 # expect+1: Malformed conditional (${:L:gmtime=-1} != "")
 .if ${:L:gmtime=-1} != ""
 .  error
@@ -67,7 +67,7 @@
 
 # Spaces were allowed before var.c 1.631 from 2020-10-31 21:40:20, not
 # because it would make sense but just as a side-effect from using strtoul.
-# expect+2: Invalid time value " 1"
+# expect+2: while evaluating "${:L:gmtime= 1} != """: Invalid time value " 1"
 # expect+1: Malformed conditional (${:L:gmtime= 1} != "")
 .if ${:L:gmtime= 1} != ""
 .  error
@@ -115,7 +115,7 @@
 #
 # Since var.c 1.631 from 2020-10-31, the overflow is detected and produces a
 # parse error.
-# expect+2: Invalid time value "10000000000000000000000000000000"
+# expect+2: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000"
 # expect+1: Malformed conditional (${:L:gmtime=10000000000000000000000000000000} != "")
 .if ${:L:gmtime=10000000000000000000000000000000} != ""
 .  error
@@ -128,7 +128,7 @@
 # stopped after the '=', and the remaining string was parsed for more variable
 # modifiers.  Because of the unknown modifier 'e' from the 'error', the whole
 # variable value was discarded and thus not printed.
-# expect+2: Invalid time value "error"
+# expect+2: while evaluating "${:L:gmtime=error} != """: Invalid time value "error"
 # expect+1: Malformed conditional (${:L:gmtime=error} != "")
 .if ${:L:gmtime=error} != ""
 .  error
@@ -139,7 +139,7 @@
 # Before var.c 1.1050 from 2023-05-09, the timestamp could be directly
 # followed by the next modifier, without a ':' separator.  This was the same
 # bug as for the ':L' and ':P' modifiers.
-# expect+2: Invalid time value "100000S,1970,bad,"
+# expect+2: while evaluating variable "%Y": Invalid time value "100000S,1970,bad,"
 # expect+1: Malformed conditional (${%Y:L:gmtime=100000S,1970,bad,} != "bad")
 .if ${%Y:L:gmtime=100000S,1970,bad,} != "bad"
 .  error

Index: src/usr.bin/make/unit-tests/directive-for.mk
diff -u src/usr.bin/make/unit-tests/directive-for.mk:1.24 src/usr.bin/make/unit-tests/directive-for.mk:1.25
--- src/usr.bin/make/unit-tests/directive-for.mk:1.24	Wed Dec  6 22:28:20 2023
+++ src/usr.bin/make/unit-tests/directive-for.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for.mk,v 1.24 2023/12/06 22:28:20 rillig Exp $
+# $NetBSD: directive-for.mk,v 1.25 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the .for directive.
 #
@@ -206,7 +206,7 @@ INDIRECT=	${DIRECT}
 # XXX: A parse error or evaluation error in the items of the .for loop
 # should skip the whole loop.  As of 2023-05-09, the loop is expanded as
 # usual.
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating "${:Uword2:Z}-after word3": Unknown modifier "Z"
 .for var in word1 before-${:Uword2:Z}-after word3
 .  info XXX: Should not reach ${var}
 .endfor
Index: src/usr.bin/make/unit-tests/var-eval-short.exp
diff -u src/usr.bin/make/unit-tests/var-eval-short.exp:1.24 src/usr.bin/make/unit-tests/var-eval-short.exp:1.25
--- src/usr.bin/make/unit-tests/var-eval-short.exp:1.24	Sun Apr 14 12:30:47 2024
+++ src/usr.bin/make/unit-tests/var-eval-short.exp	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-make: "var-eval-short.mk" line 46: In the :@ modifier of "", the variable name "${FAIL}" must not contain a dollar
+make: "var-eval-short.mk" line 46: while evaluating "${:Uword:@${FAIL}@expr@}": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar
 make: "var-eval-short.mk" line 46: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@})
 Parsing line 159: .if 0 && ${0:?${FAIL}then:${FAIL}else}
 CondParser_Eval: 0 && ${0:?${FAIL}then:${FAIL}else}

Index: src/usr.bin/make/unit-tests/directive-include.mk
diff -u src/usr.bin/make/unit-tests/directive-include.mk:1.13 src/usr.bin/make/unit-tests/directive-include.mk:1.14
--- src/usr.bin/make/unit-tests/directive-include.mk:1.13	Sat Aug 19 10:52:14 2023
+++ src/usr.bin/make/unit-tests/directive-include.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: directive-include.mk,v 1.13 2023/08/19 10:52:14 rillig Exp $
+# $NetBSD: directive-include.mk,v 1.14 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the .include directive, which includes another file.
 
@@ -52,7 +52,7 @@ DQUOT=	"
 # expression is skipped and the file is included nevertheless.
 # FIXME: Add proper error handling, no file must be included here.
 # expect+2: Could not find nonexistent.mk
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating "${:U123:Z}.mk": Unknown modifier "Z"
 .include "nonexistent${:U123:Z}.mk"
 
 # The traditional include directive is seldom used.
Index: src/usr.bin/make/unit-tests/directive-undef.mk
diff -u src/usr.bin/make/unit-tests/directive-undef.mk:1.13 src/usr.bin/make/unit-tests/directive-undef.mk:1.14
--- src/usr.bin/make/unit-tests/directive-undef.mk:1.13	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/directive-undef.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: directive-undef.mk,v 1.13 2023/06/01 20:56:35 rillig Exp $
+# $NetBSD: directive-undef.mk,v 1.14 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the .undef directive.
 #
@@ -84,7 +84,7 @@ ${DOLLAR}=	dollar
 #
 # As of var.c 1.762, this doesn't happen though because the error handling
 # in Var_Parse and Var_Subst is not done properly.
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating variable "VARNAMES": Unknown modifier "Z"
 .undef ${VARNAMES:L:Z}
 
 
Index: src/usr.bin/make/unit-tests/varmod-localtime.exp
diff -u src/usr.bin/make/unit-tests/varmod-localtime.exp:1.13 src/usr.bin/make/unit-tests/varmod-localtime.exp:1.14
--- src/usr.bin/make/unit-tests/varmod-localtime.exp:1.13	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/varmod-localtime.exp	Sat Apr 20 10:18:55 2024
@@ -1,12 +1,12 @@
-make: "varmod-localtime.mk" line 61: Invalid time value "-1"
+make: "varmod-localtime.mk" line 61: while evaluating "${:L:localtime=-1} != """: Invalid time value "-1"
 make: "varmod-localtime.mk" line 61: Malformed conditional (${:L:localtime=-1} != "")
-make: "varmod-localtime.mk" line 72: Invalid time value " 1"
+make: "varmod-localtime.mk" line 72: while evaluating "${:L:localtime= 1} != """: Invalid time value " 1"
 make: "varmod-localtime.mk" line 72: Malformed conditional (${:L:localtime= 1} != "")
-make: "varmod-localtime.mk" line 120: Invalid time value "10000000000000000000000000000000"
+make: "varmod-localtime.mk" line 120: while evaluating "${:L:localtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000"
 make: "varmod-localtime.mk" line 120: Malformed conditional (${:L:localtime=10000000000000000000000000000000} != "")
-make: "varmod-localtime.mk" line 133: Invalid time value "error"
+make: "varmod-localtime.mk" line 133: while evaluating "${:L:localtime=error} != """: Invalid time value "error"
 make: "varmod-localtime.mk" line 133: Malformed conditional (${:L:localtime=error} != "")
-make: "varmod-localtime.mk" line 144: Invalid time value "100000S,1970,bad,"
+make: "varmod-localtime.mk" line 144: while evaluating variable "%Y": Invalid time value "100000S,1970,bad,"
 make: "varmod-localtime.mk" line 144: Malformed conditional (${%Y:L:localtime=100000S,1970,bad,} != "bad")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/varmod-to-separator.mk
diff -u src/usr.bin/make/unit-tests/varmod-to-separator.mk:1.13 src/usr.bin/make/unit-tests/varmod-to-separator.mk:1.14
--- src/usr.bin/make/unit-tests/varmod-to-separator.mk:1.13	Sun Nov 19 21:47:52 2023
+++ src/usr.bin/make/unit-tests/varmod-to-separator.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-to-separator.mk,v 1.13 2023/11/19 21:47:52 rillig Exp $
+# $NetBSD: varmod-to-separator.mk,v 1.14 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the :ts variable modifier, which joins the words of the variable
 # using an arbitrary character as word separator.
@@ -150,7 +150,7 @@ WORDS=	one two three four five six
 # for an unsigned character though.
 #
 # Since 2020-11-01, these out-of-bounds values are rejected.
-# expect+2: Invalid character number at "400:tu}"
+# expect+2: while evaluating variable "WORDS": Invalid character number at "400:tu}"
 # expect+1: Malformed conditional (${WORDS:[1..3]:ts\400:tu})
 .if ${WORDS:[1..3]:ts\400:tu}
 .  warning The separator \400 is accepted even though it is out of bounds.
@@ -166,7 +166,7 @@ WORDS=	one two three four five six
 # The hexadecimal number must be in the range of an unsigned char.
 #
 # Since 2020-11-01, these out-of-bounds values are rejected.
-# expect+2: Invalid character number at "100:tu}"
+# expect+2: while evaluating variable "WORDS": Invalid character number at "100:tu}"
 # expect+1: Malformed conditional (${WORDS:[1..3]:ts\x100:tu})
 .if ${WORDS:[1..3]:ts\x100:tu}
 .  warning The separator \x100 is accepted even though it is out of bounds.
@@ -253,7 +253,7 @@ WORDS=	one two three four five six
 .endif
 
 # Try whether bmake is Unicode-ready.
-# expect+2: Invalid character number at "1F60E}"
+# expect+2: while evaluating "${:Ua b:ts\x1F60E}": Invalid character number at "1F60E}"
 # expect+1: Malformed conditional (${:Ua b:ts\x1F60E})
 .if ${:Ua b:ts\x1F60E}		# U+1F60E "smiling face with sunglasses"
 .  error

Index: src/usr.bin/make/unit-tests/lint.exp
diff -u src/usr.bin/make/unit-tests/lint.exp:1.3 src/usr.bin/make/unit-tests/lint.exp:1.4
--- src/usr.bin/make/unit-tests/lint.exp:1.3	Thu Dec  9 20:13:10 2021
+++ src/usr.bin/make/unit-tests/lint.exp	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-make: In the :@ modifier of "VAR", the variable name "${:Ubar:S,b,v,}" must not contain a dollar
+make: in target "mod-loop-varname": while evaluating variable "VAR": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar
 y@:Q}
 xvaluey
 exit status 2
Index: src/usr.bin/make/unit-tests/varmod-hash.exp
diff -u src/usr.bin/make/unit-tests/varmod-hash.exp:1.3 src/usr.bin/make/unit-tests/varmod-hash.exp:1.4
--- src/usr.bin/make/unit-tests/varmod-hash.exp:1.3	Tue Feb 23 15:19:41 2021
+++ src/usr.bin/make/unit-tests/varmod-hash.exp	Sat Apr 20 10:18:55 2024
@@ -1,9 +1,9 @@
-make: Unknown modifier "has"
+make: in target "all": while evaluating variable "12345": Unknown modifier "has"
 
 26bb0f5f
 12345
-make: Unknown modifier "hasX"
+make: in target "all": while evaluating variable "12345": Unknown modifier "hasX"
 
-make: Unknown modifier "hashed"
+make: in target "all": while evaluating variable "12345": Unknown modifier "hashed"
 
 exit status 0
Index: src/usr.bin/make/unit-tests/varmod-loop-delete.exp
diff -u src/usr.bin/make/unit-tests/varmod-loop-delete.exp:1.3 src/usr.bin/make/unit-tests/varmod-loop-delete.exp:1.4
--- src/usr.bin/make/unit-tests/varmod-loop-delete.exp:1.3	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/varmod-loop-delete.exp	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-make: "varmod-loop-delete.mk" line 20: Cannot delete variable "VAR" while it is used
+make: "varmod-loop-delete.mk" line 20: while evaluating variable "VAR": while evaluating "${:U:@VAR@@} rest of the value": Cannot delete variable "VAR" while it is used
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
Index: src/usr.bin/make/unit-tests/varmod-loop-delete.mk
diff -u src/usr.bin/make/unit-tests/varmod-loop-delete.mk:1.3 src/usr.bin/make/unit-tests/varmod-loop-delete.mk:1.4
--- src/usr.bin/make/unit-tests/varmod-loop-delete.mk:1.3	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/varmod-loop-delete.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-loop-delete.mk,v 1.3 2023/06/01 20:56:35 rillig Exp $
+# $NetBSD: varmod-loop-delete.mk,v 1.4 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the variable modifier ':@', which as a side effect allows to
 # delete an arbitrary variable.
@@ -16,7 +16,7 @@ VAR=	${:U:@VAR@@} rest of the value
 
 # In an assignment, the scope is 'Global'.  Since the variable 'VAR' is
 # defined in the global scope, it deletes itself.
-# expect+1: Cannot delete variable "VAR" while it is used
+# expect+1: while evaluating variable "VAR": while evaluating "${:U:@VAR@@} rest of the value": Cannot delete variable "VAR" while it is used
 EVAL:=	${VAR}
 .if ${EVAL} != " rest of the value"
 .  error

Index: src/usr.bin/make/unit-tests/moderrs.exp
diff -u src/usr.bin/make/unit-tests/moderrs.exp:1.34 src/usr.bin/make/unit-tests/moderrs.exp:1.35
--- src/usr.bin/make/unit-tests/moderrs.exp:1.34	Sun Nov 19 22:32:44 2023
+++ src/usr.bin/make/unit-tests/moderrs.exp	Sat Apr 20 10:18:55 2024
@@ -1,11 +1,11 @@
 mod-unknown-direct:
 want: Unknown modifier 'Z'
-make: Unknown modifier "Z"
+make: in target "mod-unknown-direct": while evaluating variable "VAR": Unknown modifier "Z"
 VAR:Z=before--after
 
 mod-unknown-indirect:
 want: Unknown modifier 'Z'
-make: Unknown modifier "Z"
+make: in target "mod-unknown-indirect": while evaluating variable "VAR": Unknown modifier "Z"
 VAR:Z=before-inner}-after
 
 unclosed-direct:
@@ -119,17 +119,17 @@ then
 
 mod-remember-parse:
 1 1 2 3 5 8 13 21 34
-make: Unknown modifier "__"
+make: in target "mod-remember-parse": while evaluating variable "FIB": Unknown modifier "__"
 
 
 mod-sysv-parse:
-make: Unknown modifier "3"
+make: in target "mod-sysv-parse": while evaluating variable "FIB": Unknown modifier "3"
 make: Unclosed expression, expecting '}' for modifier "3" of variable "FIB" with value ""
 
-make: Unknown modifier "3="
+make: in target "mod-sysv-parse": while evaluating variable "FIB": Unknown modifier "3="
 make: Unclosed expression, expecting '}' for modifier "3=" of variable "FIB" with value ""
 
-make: Unknown modifier "3=x3"
+make: in target "mod-sysv-parse": while evaluating variable "FIB": Unknown modifier "3=x3"
 make: Unclosed expression, expecting '}' for modifier "3=x3" of variable "FIB" with value ""
 
 1 1 2 x3 5 8 1x3 21 34
Index: src/usr.bin/make/unit-tests/vardebug.exp
diff -u src/usr.bin/make/unit-tests/vardebug.exp:1.34 src/usr.bin/make/unit-tests/vardebug.exp:1.35
--- src/usr.bin/make/unit-tests/vardebug.exp:1.34	Wed Dec 20 09:46:00 2023
+++ src/usr.bin/make/unit-tests/vardebug.exp	Sat Apr 20 10:18:55 2024
@@ -54,7 +54,7 @@ Var_Parse: ${:Uvariable:unknown} (eval-d
 Evaluating modifier ${:U...} on value "" (eval-defined, undefined)
 Result of ${:Uvariable} is "variable" (eval-defined, defined)
 Evaluating modifier ${:u...} on value "variable" (eval-defined, defined)
-make: "vardebug.mk" line 63: Unknown modifier "unknown"
+make: "vardebug.mk" line 63: while evaluating "${:Uvariable:unknown}": Unknown modifier "unknown"
 Result of ${:unknown} is error (eval-defined, defined)
 make: "vardebug.mk" line 63: Malformed conditional (${:Uvariable:unknown})
 Var_Parse: ${UNDEFINED} (eval-defined)

Index: src/usr.bin/make/unit-tests/opt-debug-lint.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.18 src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.19
--- src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.18	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/opt-debug-lint.exp	Sat Apr 20 10:18:55 2024
@@ -2,9 +2,9 @@ make: "opt-debug-lint.mk" line 21: Varia
 make: "opt-debug-lint.mk" line 21: Malformed conditional ($X)
 make: "opt-debug-lint.mk" line 45: Variable "UNDEF" is undefined
 make: "opt-debug-lint.mk" line 45: Malformed conditional (${UNDEF})
-make: "opt-debug-lint.mk" line 67: Missing delimiter ':' after modifier "L"
-make: "opt-debug-lint.mk" line 67: Missing delimiter ':' after modifier "P"
-make: "opt-debug-lint.mk" line 76: Unknown modifier "${"
+make: "opt-debug-lint.mk" line 67: while evaluating variable "value": Missing delimiter ':' after modifier "L"
+make: "opt-debug-lint.mk" line 67: while evaluating variable "value": Missing delimiter ':' after modifier "P"
+make: "opt-debug-lint.mk" line 76: while evaluating variable "value": Unknown modifier "${"
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
Index: src/usr.bin/make/unit-tests/varmod-indirect.mk
diff -u src/usr.bin/make/unit-tests/varmod-indirect.mk:1.18 src/usr.bin/make/unit-tests/varmod-indirect.mk:1.19
--- src/usr.bin/make/unit-tests/varmod-indirect.mk:1.18	Sun Feb  4 10:03:10 2024
+++ src/usr.bin/make/unit-tests/varmod-indirect.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-indirect.mk,v 1.18 2024/02/04 10:03:10 rillig Exp $
+# $NetBSD: varmod-indirect.mk,v 1.19 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for indirect variable modifiers, such as in ${VAR:${M_modifiers}}.
 # These can be used for very basic purposes like converting a string to either
@@ -15,7 +15,7 @@
 # The following expression generates a parse error since its indirect
 # modifier contains more than a sole expression.
 #
-# expect+1: Unknown modifier "${"
+# expect+1: while evaluating variable "value": Unknown modifier "${"
 .if ${value:L:${:US}${:U,value,replacement,}} != "S,value,replacement,}"
 .  warning unexpected
 .endif
@@ -47,7 +47,7 @@
 # error.  Because of this parse error, this feature cannot be used reasonably
 # in practice.
 #
-# expect+2: Unknown modifier "${"
+# expect+2: while evaluating variable "value": Unknown modifier "${"
 #.MAKEFLAGS: -dvc
 .if ${value:L:${:UM*}S,value,replaced,} == "M*S,value,replaced,}"
 # expect+1: warning: FIXME: this expression should have resulted in a parse error rather than returning the unparsed portion of the expression.
@@ -160,7 +160,7 @@ M_NoPrimes=	${PRIMES:${M_ListToSkip}}
 .endfor
 
 # An error in an indirect modifier.
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating variable "UNDEF": Unknown modifier "Z"
 .for var in before ${UNDEF:${:UZ}} after
 # expect+2: before
 # expect+1: after
@@ -191,7 +191,7 @@ _:=	before ${UNDEF:${:U}} after
 # XXX: This expands to ${UNDEF:Z}, which will behave differently if the
 # variable '_' is used in a context where the expression ${_} is
 # parsed but not evaluated.
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating variable "UNDEF": Unknown modifier "Z"
 _:=	before ${UNDEF:${:UZ}} after
 
 .MAKEFLAGS: -d0
Index: src/usr.bin/make/unit-tests/varmod-match-escape.exp
diff -u src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.18 src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.19
--- src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.18	Fri Jun 23 04:56:54 2023
+++ src/usr.bin/make/unit-tests/varmod-match-escape.exp	Sat Apr 20 10:18:55 2024
@@ -33,9 +33,9 @@ Comparing ":" != "::"
 make: "varmod-match-escape.mk" line 43: warning: XXX: Oops
 Global: .MAKEFLAGS =  -r -k -d cv -d
 Global: .MAKEFLAGS =  -r -k -d cv -d 0
-make: "varmod-match-escape.mk" line 69: Dollar followed by nothing
-make: "varmod-match-escape.mk" line 110: warning: Unfinished character list in pattern '[A-]' of modifier ':M'
-make: "varmod-match-escape.mk" line 110: warning: Unfinished character list in pattern '[^A-]' of modifier ':M'
+make: "varmod-match-escape.mk" line 69: while evaluating "${:U\$:M\$} != """: Dollar followed by nothing
+make: "varmod-match-escape.mk" line 110: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[A-]' of modifier ':M'
+make: "varmod-match-escape.mk" line 110: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[^A-]' of modifier ':M'
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/var-op-expand.exp
diff -u src/usr.bin/make/unit-tests/var-op-expand.exp:1.8 src/usr.bin/make/unit-tests/var-op-expand.exp:1.9
--- src/usr.bin/make/unit-tests/var-op-expand.exp:1.8	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/var-op-expand.exp	Sat Apr 20 10:18:55 2024
@@ -1,6 +1,6 @@
-make: "var-op-expand.mk" line 274: Unknown modifier "s,value,replaced,"
+make: "var-op-expand.mk" line 274: while evaluating variable "indirect": while evaluating variable "later": Unknown modifier "s,value,replaced,"
 make: "var-op-expand.mk" line 278: warning: XXX Neither branch should be taken.
-make: "var-op-expand.mk" line 283: Unknown modifier "s,value,replaced,"
+make: "var-op-expand.mk" line 283: while evaluating variable "indirect": while evaluating variable "later": Unknown modifier "s,value,replaced,"
 make: "var-op-expand.mk" line 285: warning: XXX Neither branch should be taken.
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/varmod.exp
diff -u src/usr.bin/make/unit-tests/varmod.exp:1.8 src/usr.bin/make/unit-tests/varmod.exp:1.9
--- src/usr.bin/make/unit-tests/varmod.exp:1.8	Sat Feb  3 00:20:23 2024
+++ src/usr.bin/make/unit-tests/varmod.exp	Sat Apr 20 10:18:56 2024
@@ -1,7 +1,7 @@
 make: "varmod.mk" line 101: To escape a dollar, use \$, not $$, at "$$:L} != """
 make: "varmod.mk" line 101: Invalid variable name ':', at "$:L} != """
-make: "varmod.mk" line 107: Dollar followed by nothing
-make: "varmod.mk" line 117: Missing delimiter ':' after modifier "P"
+make: "varmod.mk" line 107: while evaluating "${:Uword:@word@${word}$@} != "word"": Dollar followed by nothing
+make: "varmod.mk" line 117: while evaluating variable "VAR": Missing delimiter ':' after modifier "P"
 make: "varmod.mk" line 119: Missing argument for ".error"
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests

Index: src/usr.bin/make/unit-tests/var-op-expand.mk
diff -u src/usr.bin/make/unit-tests/var-op-expand.mk:1.19 src/usr.bin/make/unit-tests/var-op-expand.mk:1.20
--- src/usr.bin/make/unit-tests/var-op-expand.mk:1.19	Sun Nov 19 21:47:52 2023
+++ src/usr.bin/make/unit-tests/var-op-expand.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: var-op-expand.mk,v 1.19 2023/11/19 21:47:52 rillig Exp $
+# $NetBSD: var-op-expand.mk,v 1.20 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the := variable assignment operator, which expands its
 # right-hand side.
@@ -270,7 +270,7 @@ later=	lowercase-value
 .undef later
 INDIRECT:=	${LATER:S,value,replaced,} OK ${LATER:value=sysv}
 indirect:=	${INDIRECT:tl}
-# expect+1: Unknown modifier "s,value,replaced,"
+# expect+1: while evaluating variable "indirect": while evaluating variable "later": Unknown modifier "s,value,replaced,"
 .if ${indirect} != " ok "
 .  error
 .else
@@ -279,7 +279,7 @@ indirect:=	${INDIRECT:tl}
 .endif
 LATER=	uppercase-value
 later=	lowercase-value
-# expect+1: Unknown modifier "s,value,replaced,"
+# expect+1: while evaluating variable "indirect": while evaluating variable "later": Unknown modifier "s,value,replaced,"
 .if ${indirect} != "uppercase-replaced ok uppercase-sysv"
 # expect+1: warning: XXX Neither branch should be taken.
 .  warning	XXX Neither branch should be taken.
Index: src/usr.bin/make/unit-tests/varmisc.exp
diff -u src/usr.bin/make/unit-tests/varmisc.exp:1.19 src/usr.bin/make/unit-tests/varmisc.exp:1.20
--- src/usr.bin/make/unit-tests/varmisc.exp:1.19	Sun Nov 19 22:06:15 2023
+++ src/usr.bin/make/unit-tests/varmisc.exp	Sat Apr 20 10:18:55 2024
@@ -44,26 +44,26 @@ parse-dynamic: parse-dynamic parse-dynam
 parse-dynamic: parse-dynamic parse-dynamic after
 parse-dynamic: parse-dynamic parse-dynamic after
 varerror-unclosed:begin
-make: Unclosed variable ""
+make: in target "varerror-unclosed": Unclosed variable ""
 
-make: Unclosed variable "UNCLOSED"
+make: in target "varerror-unclosed": Unclosed variable "UNCLOSED"
 
-make: Unclosed variable "UNCLOSED"
+make: in target "varerror-unclosed": Unclosed variable "UNCLOSED"
 
-make: Unclosed variable "PATTERN"
+make: in target "varerror-unclosed": while evaluating variable "UNCLOSED": Unclosed variable "PATTERN"
 make: Unclosed expression, expecting '}' for modifier "M${PATTERN" of variable "UNCLOSED" with value ""
 
-make: Unclosed variable "param"
-make: Unclosed variable "UNCLOSED."
+make: in target "varerror-unclosed": Unclosed variable "param"
+make: in target "varerror-unclosed": Unclosed variable "UNCLOSED."
 
 
-make: Unclosed variable "UNCLOSED.1"
+make: in target "varerror-unclosed": Unclosed variable "UNCLOSED.1"
 
-make: Unclosed variable "UNCLOSED.2"
+make: in target "varerror-unclosed": Unclosed variable "UNCLOSED.2"
 
-make: Unclosed variable "UNCLOSED.3"
+make: in target "varerror-unclosed": Unclosed variable "UNCLOSED.3"
 
-make: Unclosed variable "UNCLOSED_ORIG"
+make: in target "varerror-unclosed": while evaluating variable "UNCLOSED_INDIR_2": while evaluating variable "UNCLOSED_INDIR_1": Unclosed variable "UNCLOSED_ORIG"
 
 varerror-unclosed:end
 target1-flags: we have: one two
Index: src/usr.bin/make/unit-tests/varmod-assign.exp
diff -u src/usr.bin/make/unit-tests/varmod-assign.exp:1.19 src/usr.bin/make/unit-tests/varmod-assign.exp:1.20
--- src/usr.bin/make/unit-tests/varmod-assign.exp:1.19	Sun Jan  7 11:42:22 2024
+++ src/usr.bin/make/unit-tests/varmod-assign.exp	Sat Apr 20 10:18:55 2024
@@ -42,7 +42,7 @@ mod-assign-empty: value}
 make: Bad modifier ":" for variable ""
 mod-assign-empty: overwritten}
 mod-assign-empty: VAR=overwritten
-make: Unknown modifier ":x"
+make: in target "mod-assign-parse": while evaluating variable "ASSIGN": Unknown modifier ":x"
 
 sysv:y
 make: Unfinished modifier for "ASSIGN" ('}' missing)
Index: src/usr.bin/make/unit-tests/varmod-assign.mk
diff -u src/usr.bin/make/unit-tests/varmod-assign.mk:1.19 src/usr.bin/make/unit-tests/varmod-assign.mk:1.20
--- src/usr.bin/make/unit-tests/varmod-assign.mk:1.19	Sun Jan  7 11:42:22 2024
+++ src/usr.bin/make/unit-tests/varmod-assign.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-assign.mk,v 1.19 2024/01/07 11:42:22 rillig Exp $
+# $NetBSD: varmod-assign.mk,v 1.20 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the obscure ::= variable modifiers, which perform variable
 # assignments during evaluation, just like the = operator in C.
@@ -90,7 +90,7 @@ mod-assign-empty:
 mod-assign-parse:
 	# The modifier for assignment operators starts with a ':'.
 	# An 'x' after that is an invalid modifier.
-	# expect: make: Unknown modifier ":x"
+	# expect: make: in target "mod-assign-parse": while evaluating variable "ASSIGN": Unknown modifier ":x"
 	@echo ${ASSIGN::x}
 
 	# When parsing an assignment operator fails because the operator is
Index: src/usr.bin/make/unit-tests/varmod-edge.mk
diff -u src/usr.bin/make/unit-tests/varmod-edge.mk:1.19 src/usr.bin/make/unit-tests/varmod-edge.mk:1.20
--- src/usr.bin/make/unit-tests/varmod-edge.mk:1.19	Sun Nov 19 22:06:15 2023
+++ src/usr.bin/make/unit-tests/varmod-edge.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-edge.mk,v 1.19 2023/11/19 22:06:15 rillig Exp $
+# $NetBSD: varmod-edge.mk,v 1.20 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for edge cases in variable modifiers.
 #
@@ -162,8 +162,8 @@ MOD.colons=	${INP.colons::::}
 EXP.colons=	# empty
 
 .for test in ${TESTS}
-# expect+2: Unknown modifier ":"
-# expect+1: Unknown modifier ":"
+# expect+2: while evaluating variable "MOD.colons": while evaluating variable "INP.colons": Unknown modifier ":"
+# expect+1: while evaluating variable "MOD.colons": while evaluating variable "INP.colons": Unknown modifier ":"
 .  if ${MOD.${test}} == ${EXP.${test}}
 # expect+16: ok M-paren
 # expect+15: ok M-mixed
@@ -191,7 +191,7 @@ EXP.colons=	# empty
 # XXX: The error message should mention the variable name of the expression,
 # even though that name is empty in this case.
 # expect+2: Malformed conditional (${:Z})
-# expect+1: Unknown modifier "Z"
+# expect+1: while evaluating "${:Z}": Unknown modifier "Z"
 .if ${:Z}
 .  error
 .else
Index: src/usr.bin/make/unit-tests/varmod-ifelse.exp
diff -u src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.19 src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.20
--- src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.19	Sun Dec 10 20:12:28 2023
+++ src/usr.bin/make/unit-tests/varmod-ifelse.exp	Sat Apr 20 10:18:55 2024
@@ -16,7 +16,7 @@ CondParser_Eval: ${VAR} == value
 Comparing "value" == "value"
 Comparing "ok" != "ok"
 make: "varmod-ifelse.mk" line 158: no.
-make: "varmod-ifelse.mk" line 162: Comparison with '>=' requires both operands 'no' and '10' to be numeric
+make: "varmod-ifelse.mk" line 162: while evaluating variable "string == "literal" || no >= 10": Comparison with '>=' requires both operands 'no' and '10' to be numeric
 make: Bad conditional expression 'string == "literal" || no >= 10' before '?yes:no'
 make: "varmod-ifelse.mk" line 162: .
 make: Bad conditional expression 'string == "literal" &&  >= 10' before '?yes:no'

Index: src/usr.bin/make/unit-tests/varmod-ifelse.mk
diff -u src/usr.bin/make/unit-tests/varmod-ifelse.mk:1.26 src/usr.bin/make/unit-tests/varmod-ifelse.mk:1.27
--- src/usr.bin/make/unit-tests/varmod-ifelse.mk:1.26	Sun Dec 10 20:12:28 2023
+++ src/usr.bin/make/unit-tests/varmod-ifelse.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-ifelse.mk,v 1.26 2023/12/10 20:12:28 rillig Exp $
+# $NetBSD: varmod-ifelse.mk,v 1.27 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the ${cond:?then:else} variable modifier, which evaluates either
 # the then-expression or the else-expression, depending on the condition.
@@ -156,7 +156,7 @@ STRING=		string
 NUMBER=		no		# not really a number
 # expect+1: no.
 .info ${${STRING} == "literal" && ${NUMBER} >= 10:?yes:no}.
-# expect+3: Comparison with '>=' requires both operands 'no' and '10' to be numeric
+# expect+3: while evaluating variable "string == "literal" || no >= 10": Comparison with '>=' requires both operands 'no' and '10' to be numeric
 # expect: make: Bad conditional expression 'string == "literal" || no >= 10' before '?yes:no'
 # expect+1: .
 .info ${${STRING} == "literal" || ${NUMBER} >= 10:?yes:no}.

Index: src/usr.bin/make/unit-tests/varmod-indirect.exp
diff -u src/usr.bin/make/unit-tests/varmod-indirect.exp:1.27 src/usr.bin/make/unit-tests/varmod-indirect.exp:1.28
--- src/usr.bin/make/unit-tests/varmod-indirect.exp:1.27	Sun Feb  4 10:03:10 2024
+++ src/usr.bin/make/unit-tests/varmod-indirect.exp	Sat Apr 20 10:18:55 2024
@@ -1,5 +1,5 @@
-make: "varmod-indirect.mk" line 19: Unknown modifier "${"
-make: "varmod-indirect.mk" line 52: Unknown modifier "${"
+make: "varmod-indirect.mk" line 19: while evaluating variable "value": Unknown modifier "${"
+make: "varmod-indirect.mk" line 52: while evaluating variable "value": Unknown modifier "${"
 make: "varmod-indirect.mk" line 54: warning: FIXME: this expression should have resulted in a parse error rather than returning the unparsed portion of the expression.
 make: "varmod-indirect.mk" line 143: before
 make: "varmod-indirect.mk" line 143: after
@@ -7,7 +7,7 @@ make: "varmod-indirect.mk" line 151: bef
 make: "varmod-indirect.mk" line 151: after
 make: "varmod-indirect.mk" line 159: before
 make: "varmod-indirect.mk" line 159: after
-make: "varmod-indirect.mk" line 164: Unknown modifier "Z"
+make: "varmod-indirect.mk" line 164: while evaluating variable "UNDEF": Unknown modifier "Z"
 make: "varmod-indirect.mk" line 167: before
 make: "varmod-indirect.mk" line 167: after
 Parsing line 176: _:=	before ${UNDEF} after
@@ -31,7 +31,7 @@ Parsing line 195: _:=	before ${UNDEF:${:
 Var_Parse: ${UNDEF:${:UZ}} after (eval-keep-dollar-and-undefined)
 Indirect modifier "Z" from "${:UZ}"
 Evaluating modifier ${UNDEF:Z} on value "" (eval-keep-dollar-and-undefined, undefined)
-make: "varmod-indirect.mk" line 195: Unknown modifier "Z"
+make: "varmod-indirect.mk" line 195: while evaluating variable "UNDEF": Unknown modifier "Z"
 Result of ${UNDEF:Z} is error (eval-keep-dollar-and-undefined, undefined)
 Global: _ = before ${UNDEF:Z} after
 Parsing line 197: .MAKEFLAGS: -d0

Index: src/usr.bin/make/unit-tests/varmod-localtime.mk
diff -u src/usr.bin/make/unit-tests/varmod-localtime.mk:1.14 src/usr.bin/make/unit-tests/varmod-localtime.mk:1.15
--- src/usr.bin/make/unit-tests/varmod-localtime.mk:1.14	Sun Nov 19 21:47:52 2023
+++ src/usr.bin/make/unit-tests/varmod-localtime.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-localtime.mk,v 1.14 2023/11/19 21:47:52 rillig Exp $
+# $NetBSD: varmod-localtime.mk,v 1.15 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the :localtime variable modifier, which formats a timestamp
 # using strftime(3) in local time.
@@ -56,7 +56,7 @@
 # 1970.  Going back 50 years in the past is not a practical use case for
 # make.  Therefore, since var.c 1.631, negative time stamps produce a
 # parse error.
-# expect+2: Invalid time value "-1"
+# expect+2: while evaluating "${:L:localtime=-1} != """: Invalid time value "-1"
 # expect+1: Malformed conditional (${:L:localtime=-1} != "")
 .if ${:L:localtime=-1} != ""
 .  error
@@ -67,7 +67,7 @@
 
 # Spaces were allowed before var.c 1.631 from 2020-10-31 21:40:20, not
 # because it would make sense but just as a side-effect from using strtoul.
-# expect+2: Invalid time value " 1"
+# expect+2: while evaluating "${:L:localtime= 1} != """: Invalid time value " 1"
 # expect+1: Malformed conditional (${:L:localtime= 1} != "")
 .if ${:L:localtime= 1} != ""
 .  error
@@ -115,7 +115,7 @@
 #
 # Since var.c 1.631 from 2020-10-31, the overflow is detected and produces a
 # parse error.
-# expect+2: Invalid time value "10000000000000000000000000000000"
+# expect+2: while evaluating "${:L:localtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000"
 # expect+1: Malformed conditional (${:L:localtime=10000000000000000000000000000000} != "")
 .if ${:L:localtime=10000000000000000000000000000000} != ""
 .  error
@@ -128,7 +128,7 @@
 # stopped after the '=', and the remaining string was parsed for more variable
 # modifiers.  Because of the unknown modifier 'e' from the 'error', the whole
 # variable value was discarded and thus not printed.
-# expect+2: Invalid time value "error"
+# expect+2: while evaluating "${:L:localtime=error} != """: Invalid time value "error"
 # expect+1: Malformed conditional (${:L:localtime=error} != "")
 .if ${:L:localtime=error} != ""
 .  error
@@ -139,7 +139,7 @@
 # Before var.c 1.1050 from 2023-05-09, the timestamp could be directly
 # followed by the next modifier, without a ':' separator.  This was the same
 # bug as for the ':L' and ':P' modifiers.
-# expect+2: Invalid time value "100000S,1970,bad,"
+# expect+2: while evaluating variable "%Y": Invalid time value "100000S,1970,bad,"
 # expect+1: Malformed conditional (${%Y:L:localtime=100000S,1970,bad,} != "bad")
 .if ${%Y:L:localtime=100000S,1970,bad,} != "bad"
 .  error
Index: src/usr.bin/make/unit-tests/varmod-match.exp
diff -u src/usr.bin/make/unit-tests/varmod-match.exp:1.14 src/usr.bin/make/unit-tests/varmod-match.exp:1.15
--- src/usr.bin/make/unit-tests/varmod-match.exp:1.14	Sun Dec 17 23:19:02 2023
+++ src/usr.bin/make/unit-tests/varmod-match.exp	Sat Apr 20 10:18:55 2024
@@ -1,13 +1,13 @@
-make: "varmod-match.mk" line 289: warning: Unfinished character list in pattern 'a[' of modifier ':M'
-make: "varmod-match.mk" line 297: warning: Unfinished character list in pattern 'a[^' of modifier ':M'
-make: "varmod-match.mk" line 305: warning: Unfinished character list in pattern '[-x1-3' of modifier ':M'
-make: "varmod-match.mk" line 313: warning: Unfinished character list in pattern '*[-x1-3' of modifier ':M'
-make: "varmod-match.mk" line 322: warning: Unfinished character list in pattern '[^-x1-3' of modifier ':M'
-make: "varmod-match.mk" line 336: warning: Unfinished character list in pattern '?[\' of modifier ':M'
-make: "varmod-match.mk" line 344: warning: Unfinished character range in pattern '[x-' of modifier ':M'
-make: "varmod-match.mk" line 356: warning: Unfinished character range in pattern '[^x-' of modifier ':M'
-make: "varmod-match.mk" line 364: warning: Unfinished character list in pattern '[' of modifier ':M'
-make: "varmod-match.mk" line 364: Unknown modifier "]"
+make: "varmod-match.mk" line 289: while evaluating variable "WORDS": warning: Unfinished character list in pattern 'a[' of modifier ':M'
+make: "varmod-match.mk" line 297: while evaluating variable "WORDS": warning: Unfinished character list in pattern 'a[^' of modifier ':M'
+make: "varmod-match.mk" line 305: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[-x1-3' of modifier ':M'
+make: "varmod-match.mk" line 313: while evaluating variable "WORDS": warning: Unfinished character list in pattern '*[-x1-3' of modifier ':M'
+make: "varmod-match.mk" line 322: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[^-x1-3' of modifier ':M'
+make: "varmod-match.mk" line 336: while evaluating variable "WORDS": warning: Unfinished character list in pattern '?[\' of modifier ':M'
+make: "varmod-match.mk" line 344: while evaluating variable "WORDS": warning: Unfinished character range in pattern '[x-' of modifier ':M'
+make: "varmod-match.mk" line 356: while evaluating variable "WORDS": warning: Unfinished character range in pattern '[^x-' of modifier ':M'
+make: "varmod-match.mk" line 364: while evaluating variable " : :: ": warning: Unfinished character list in pattern '[' of modifier ':M'
+make: "varmod-match.mk" line 364: while evaluating variable " : :: ": Unknown modifier "]"
 make: "varmod-match.mk" line 364: Malformed conditional (${ ${:U\:} ${:U\:\:} :L:M[:]} != ":")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests

Index: src/usr.bin/make/unit-tests/varmod-loop-varname.exp
diff -u src/usr.bin/make/unit-tests/varmod-loop-varname.exp:1.6 src/usr.bin/make/unit-tests/varmod-loop-varname.exp:1.7
--- src/usr.bin/make/unit-tests/varmod-loop-varname.exp:1.6	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/varmod-loop-varname.exp	Sat Apr 20 10:18:55 2024
@@ -1,10 +1,10 @@
-make: "varmod-loop-varname.mk" line 18: In the :@ modifier of "", the variable name "${:Ubar:S,b,v,}" must not contain a dollar
+make: "varmod-loop-varname.mk" line 18: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar
 make: "varmod-loop-varname.mk" line 18: Malformed conditional (${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+")
-make: "varmod-loop-varname.mk" line 89: In the :@ modifier of "1 2 3", the variable name "v$" must not contain a dollar
+make: "varmod-loop-varname.mk" line 89: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$" must not contain a dollar
 make: "varmod-loop-varname.mk" line 89: Malformed conditional (${1 2 3:L:@v$@($v)@} != "(1) (2) (3)")
-make: "varmod-loop-varname.mk" line 96: In the :@ modifier of "1 2 3", the variable name "v$$" must not contain a dollar
+make: "varmod-loop-varname.mk" line 96: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$$" must not contain a dollar
 make: "varmod-loop-varname.mk" line 96: Malformed conditional (${1 2 3:L:@v$$@($v)@} != "() () ()")
-make: "varmod-loop-varname.mk" line 103: In the :@ modifier of "1 2 3", the variable name "v$$$" must not contain a dollar
+make: "varmod-loop-varname.mk" line 103: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$$$" must not contain a dollar
 make: "varmod-loop-varname.mk" line 103: Malformed conditional (${1 2 3:L:@v$$$@($v)@} != "() () ()")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/varmod-loop-varname.mk
diff -u src/usr.bin/make/unit-tests/varmod-loop-varname.mk:1.6 src/usr.bin/make/unit-tests/varmod-loop-varname.mk:1.7
--- src/usr.bin/make/unit-tests/varmod-loop-varname.mk:1.6	Sun Nov 19 21:47:52 2023
+++ src/usr.bin/make/unit-tests/varmod-loop-varname.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-loop-varname.mk,v 1.6 2023/11/19 21:47:52 rillig Exp $
+# $NetBSD: varmod-loop-varname.mk,v 1.7 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the first part of the variable modifier ':@var@...@', which
 # contains the variable name to use during the loop.
@@ -13,7 +13,7 @@
 # dynamically.  There was no practical use-case for this.
 # Since var.c 1.907 from 2021-04-04, a '$' is no longer allowed in the
 # variable name.
-# expect+2: In the :@ modifier of "", the variable name "${:Ubar:S,b,v,}" must not contain a dollar
+# expect+2: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar
 # expect+1: Malformed conditional (${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+")
 .if ${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"
 .  error
@@ -84,21 +84,21 @@ RES3=		3
 # There's no point in allowing a dollar sign in that position.
 # Since var.c 1.907 from 2021-04-04, a '$' is no longer allowed in the
 # variable name.
-# expect+2: In the :@ modifier of "1 2 3", the variable name "v$" must not contain a dollar
+# expect+2: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$" must not contain a dollar
 # expect+1: Malformed conditional (${1 2 3:L:@v$@($v)@} != "(1) (2) (3)")
 .if ${1 2 3:L:@v$@($v)@} != "(1) (2) (3)"
 .  error
 .else
 .  error
 .endif
-# expect+2: In the :@ modifier of "1 2 3", the variable name "v$$" must not contain a dollar
+# expect+2: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$$" must not contain a dollar
 # expect+1: Malformed conditional (${1 2 3:L:@v$$@($v)@} != "() () ()")
 .if ${1 2 3:L:@v$$@($v)@} != "() () ()"
 .  error
 .else
 .  error
 .endif
-# expect+2: In the :@ modifier of "1 2 3", the variable name "v$$$" must not contain a dollar
+# expect+2: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$$$" must not contain a dollar
 # expect+1: Malformed conditional (${1 2 3:L:@v$$$@($v)@} != "() () ()")
 .if ${1 2 3:L:@v$$$@($v)@} != "() () ()"
 .  error
Index: src/usr.bin/make/unit-tests/varmod-subst-regex.exp
diff -u src/usr.bin/make/unit-tests/varmod-subst-regex.exp:1.6 src/usr.bin/make/unit-tests/varmod-subst-regex.exp:1.7
--- src/usr.bin/make/unit-tests/varmod-subst-regex.exp:1.6	Mon Jun 21 08:17:39 2021
+++ src/usr.bin/make/unit-tests/varmod-subst-regex.exp	Sat Apr 20 10:18:55 2024
@@ -20,7 +20,7 @@ mod-regex-limits:22-ok:1 33 556
 mod-regex-limits:capture:ihgfedcbaabcdefghijABCDEFGHIJa0a1a2rest
 make: Regex compilation error: (details omitted)
 mod-regex-errors:
-make: Unknown modifier "Z"
+make: in target "mod-regex-errors": while evaluating variable "word": while evaluating "${:U:Z}y,W}": Unknown modifier "Z"
 mod-regex-errors: xy
 unmatched-subexpression.ok: one one 2 3 5 8 one3 2one 34
 make: No match for subexpression \2

Index: src/usr.bin/make/unit-tests/varmod-match.mk
diff -u src/usr.bin/make/unit-tests/varmod-match.mk:1.20 src/usr.bin/make/unit-tests/varmod-match.mk:1.21
--- src/usr.bin/make/unit-tests/varmod-match.mk:1.20	Sun Dec 17 23:19:02 2023
+++ src/usr.bin/make/unit-tests/varmod-match.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-match.mk,v 1.20 2023/12/17 23:19:02 rillig Exp $
+# $NetBSD: varmod-match.mk,v 1.21 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the ':M' modifier, which keeps only those words that match the
 # given pattern.
@@ -285,7 +285,7 @@ ${:U*}=		asterisk
 
 #	[	Incomplete empty character list, never matches.
 WORDS=		a a[
-# expect+1: warning: Unfinished character list in pattern 'a[' of modifier ':M'
+# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern 'a[' of modifier ':M'
 .if ${WORDS:Ma[} != ""
 .  error
 .endif
@@ -293,7 +293,7 @@ WORDS=		a a[
 #	[^	Incomplete negated empty character list, matches any single
 #		character.
 WORDS=		a a[ aX
-# expect+1: warning: Unfinished character list in pattern 'a[^' of modifier ':M'
+# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern 'a[^' of modifier ':M'
 .if ${WORDS:Ma[^} != "a[ aX"
 .  error
 .endif
@@ -301,7 +301,7 @@ WORDS=		a a[ aX
 #	[-x1-3	Incomplete character list, matches those elements that can be
 #		parsed without lookahead.
 WORDS=		- + x xx 0 1 2 3 4 [x1-3
-# expect+1: warning: Unfinished character list in pattern '[-x1-3' of modifier ':M'
+# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[-x1-3' of modifier ':M'
 .if ${WORDS:M[-x1-3} != "- x 1 2 3"
 .  error
 .endif
@@ -309,7 +309,7 @@ WORDS=		- + x xx 0 1 2 3 4 [x1-3
 #	*[-x1-3	Incomplete character list after a wildcard, matches those
 #		words that end with one of the characters from the list.
 WORDS=		- + x xx 0 1 2 3 4 00 01 10 11 000 001 010 011 100 101 110 111 [x1-3
-# expect+1: warning: Unfinished character list in pattern '*[-x1-3' of modifier ':M'
+# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '*[-x1-3' of modifier ':M'
 .if ${WORDS:M*[-x1-3} != "- x xx 1 2 3 01 11 001 011 101 111 [x1-3"
 .  warning ${WORDS:M*[-x1-3}
 .endif
@@ -318,7 +318,7 @@ WORDS=		- + x xx 0 1 2 3 4 00 01 10 11 0
 #		Incomplete negated character list, matches any character
 #		except those elements that can be parsed without lookahead.
 WORDS=		- + x xx 0 1 2 3 4 [x1-3
-# expect+1: warning: Unfinished character list in pattern '[^-x1-3' of modifier ':M'
+# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[^-x1-3' of modifier ':M'
 .if ${WORDS:M[^-x1-3} != "+ 0 4"
 .  error
 .endif
@@ -332,7 +332,7 @@ WORDS=		- + x xx 0 1 2 3 4 [x1-3
 #		'\', as there is no following space that could be escaped.
 WORDS=		\\ \a ${:Ux\\}
 PATTERN=	${:U?[\\}
-# expect+1: warning: Unfinished character list in pattern '?[\' of modifier ':M'
+# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '?[\' of modifier ':M'
 .if ${WORDS:M${PATTERN}} != "\\\\ x\\"
 .  error
 .endif
@@ -340,7 +340,7 @@ PATTERN=	${:U?[\\}
 #	[x-	Incomplete character list containing an incomplete character
 #		range, matches only the 'x'.
 WORDS=		[x- x x- y
-# expect+1: warning: Unfinished character range in pattern '[x-' of modifier ':M'
+# expect+1: while evaluating variable "WORDS": warning: Unfinished character range in pattern '[x-' of modifier ':M'
 .if ${WORDS:M[x-} != "x"
 .  error
 .endif
@@ -352,14 +352,14 @@ WORDS=		[x- x x- y
 #		XXX: Even matches strings that are longer than a single
 #		character.
 WORDS=		[x- x x- y yyyyy
-# expect+1: warning: Unfinished character range in pattern '[^x-' of modifier ':M'
+# expect+1: while evaluating variable "WORDS": warning: Unfinished character range in pattern '[^x-' of modifier ':M'
 .if ${WORDS:M[^x-} != "[x- y yyyyy"
 .  error
 .endif
 
 #	[:]	matches never since the ':' starts the next modifier
-# expect+3: warning: Unfinished character list in pattern '[' of modifier ':M'
-# expect+2: Unknown modifier "]"
+# expect+3: while evaluating variable " : :: ": warning: Unfinished character list in pattern '[' of modifier ':M'
+# expect+2: while evaluating variable " : :: ": Unknown modifier "]"
 # expect+1: Malformed conditional (${ ${:U\:} ${:U\:\:} :L:M[:]} != ":")
 .if ${ ${:U\:} ${:U\:\:} :L:M[:]} != ":"
 .  error

Index: src/usr.bin/make/unit-tests/varmod-range.mk
diff -u src/usr.bin/make/unit-tests/varmod-range.mk:1.10 src/usr.bin/make/unit-tests/varmod-range.mk:1.11
--- src/usr.bin/make/unit-tests/varmod-range.mk:1.10	Sun Dec 17 14:07:22 2023
+++ src/usr.bin/make/unit-tests/varmod-range.mk	Sat Apr 20 10:18:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-range.mk,v 1.10 2023/12/17 14:07:22 rillig Exp $
+# $NetBSD: varmod-range.mk,v 1.11 2024/04/20 10:18:55 rillig Exp $
 #
 # Tests for the :range variable modifier, which generates sequences
 # of integers from the given range.
@@ -62,7 +62,7 @@
 #
 # Since 2020-11-01, the parser issues a more precise "Invalid number" error
 # instead.
-# expect+2: Invalid number "x}Rest" != "Rest"" for ':range' modifier
+# expect+2: while evaluating "${:U:range=x}Rest" != "Rest"": Invalid number "x}Rest" != "Rest"" for ':range' modifier
 # expect+1: Malformed conditional ("${:U:range=x}Rest" != "Rest")
 .if "${:U:range=x}Rest" != "Rest"
 .  error
@@ -73,7 +73,7 @@
 # The upper limit of the range must always be given in decimal.
 # This parse error stops at the 'x', trying to parse it as a variable
 # modifier.
-# expect+2: Unknown modifier "x0"
+# expect+2: while evaluating "${:U:range=0x0}Rest" != "Rest"": Unknown modifier "x0"
 # expect+1: Malformed conditional ("${:U:range=0x0}Rest" != "Rest")
 .if "${:U:range=0x0}Rest" != "Rest"
 .  error
@@ -91,7 +91,7 @@
 #.endif
 
 # modifier name too short
-# expect+2: Unknown modifier "rang"
+# expect+2: while evaluating variable "a b c": Unknown modifier "rang"
 # expect+1: Malformed conditional ("${a b c:L:rang}Rest" != "Rest")
 .if "${a b c:L:rang}Rest" != "Rest"
 .  error
@@ -100,7 +100,7 @@
 .endif
 
 # misspelled modifier name
-# expect+2: Unknown modifier "rango"
+# expect+2: while evaluating variable "a b c": Unknown modifier "rango"
 # expect+1: Malformed conditional ("${a b c:L:rango}Rest" != "Rest")
 .if "${a b c:L:rango}Rest" != "Rest"
 .  error
@@ -109,7 +109,7 @@
 .endif
 
 # modifier name too long
-# expect+2: Unknown modifier "ranger"
+# expect+2: while evaluating variable "a b c": Unknown modifier "ranger"
 # expect+1: Malformed conditional ("${a b c:L:ranger}Rest" != "Rest")
 .if "${a b c:L:ranger}Rest" != "Rest"
 .  error
Index: src/usr.bin/make/unit-tests/varmod.mk
diff -u src/usr.bin/make/unit-tests/varmod.mk:1.10 src/usr.bin/make/unit-tests/varmod.mk:1.11
--- src/usr.bin/make/unit-tests/varmod.mk:1.10	Sat Feb  3 00:20:23 2024
+++ src/usr.bin/make/unit-tests/varmod.mk	Sat Apr 20 10:18:56 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod.mk,v 1.10 2024/02/03 00:20:23 sjg Exp $
+# $NetBSD: varmod.mk,v 1.11 2024/04/20 10:18:56 rillig Exp $
 #
 # Tests for variable modifiers, such as :Q, :S,from,to or :Ufallback.
 #
@@ -103,7 +103,7 @@ DOLLAR2=	${:U\$}
 .endif
 
 # A '$' followed by nothing is an error as well.
-# expect+1: Dollar followed by nothing
+# expect+1: while evaluating "${:Uword:@word@${word}$@} != "word"": Dollar followed by nothing
 .if ${:Uword:@word@${word}$@} != "word"
 .  error
 .endif
@@ -113,7 +113,7 @@ DOLLAR2=	${:U\$}
 # XXX: The .error should not be reached since the expression is
 # malformed, and this error should be propagated up to Cond_EvalLine.
 VAR=	STOP
-# expect+1: Missing delimiter ':' after modifier "P"
+# expect+1: while evaluating variable "VAR": Missing delimiter ':' after modifier "P"
 .if ${VAR:P=RE} != "STORE"
 # expect+1: Missing argument for ".error"
 .  error
Index: src/usr.bin/make/unit-tests/varparse-errors.exp
diff -u src/usr.bin/make/unit-tests/varparse-errors.exp:1.10 src/usr.bin/make/unit-tests/varparse-errors.exp:1.11
--- src/usr.bin/make/unit-tests/varparse-errors.exp:1.10	Sun Nov 19 22:06:15 2023
+++ src/usr.bin/make/unit-tests/varparse-errors.exp	Sat Apr 20 10:18:56 2024
@@ -1,5 +1,5 @@
-make: "varparse-errors.mk" line 38: Unknown modifier "Z"
-make: "varparse-errors.mk" line 47: Unknown modifier "Z"
+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: Bad modifier ":OX" for variable ""
 make: "varparse-errors.mk" line 71: Undefined variable "${:U:OX"
 make: Bad modifier ":OX" for variable ""

Reply via email to