Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make: in parse errors, mark whitespace more cle...



details:   https://anonhg.NetBSD.org/src/rev/21be0b837191
branches:  trunk
changeset: 1027179:21be0b837191
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Dec 09 20:27:01 2021 +0000

description:
make: in parse errors, mark whitespace more clearly

This prevents any trailing whitespace from going unnoticed.  It also
marks leading whitespace more clearly, as in the examples with the time
value " 1".

diffstat:

 usr.bin/make/unit-tests/var-eval-short.exp      |   4 ++--
 usr.bin/make/unit-tests/varmod-gmtime.exp       |  10 +++++-----
 usr.bin/make/unit-tests/varmod-localtime.exp    |  10 +++++-----
 usr.bin/make/unit-tests/varmod-to-separator.exp |   4 ++--
 usr.bin/make/var.c                              |  10 +++++-----
 5 files changed, 19 insertions(+), 19 deletions(-)

diffs (113 lines):

diff -r bf3296d3607b -r 21be0b837191 usr.bin/make/unit-tests/var-eval-short.exp
--- a/usr.bin/make/unit-tests/var-eval-short.exp        Thu Dec 09 20:13:09 2021 +0000
+++ b/usr.bin/make/unit-tests/var-eval-short.exp        Thu Dec 09 20:27:01 2021 +0000
@@ -1,8 +1,8 @@
 make: "var-eval-short.mk" line 41: In the :@ modifier of "", the variable name "${FAIL}" must not contain a dollar
 make: "var-eval-short.mk" line 41: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@})
-make: "var-eval-short.mk" line 81: Invalid time value: ${FAIL}}
+make: "var-eval-short.mk" line 81: Invalid time value at "${FAIL}}"
 make: "var-eval-short.mk" line 81: Malformed conditional (0 && ${:Uword:gmtime=${FAIL}})
-make: "var-eval-short.mk" line 95: Invalid time value: ${FAIL}}
+make: "var-eval-short.mk" line 95: Invalid time value at "${FAIL}}"
 make: "var-eval-short.mk" line 95: Malformed conditional (0 && ${:Uword:localtime=${FAIL}})
 CondParser_Eval: 0 && ${0:?${FAIL}then:${FAIL}else}
 Var_Parse: ${0:?${FAIL}then:${FAIL}else} (parse-only)
diff -r bf3296d3607b -r 21be0b837191 usr.bin/make/unit-tests/varmod-gmtime.exp
--- a/usr.bin/make/unit-tests/varmod-gmtime.exp Thu Dec 09 20:13:09 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-gmtime.exp Thu Dec 09 20:27:01 2021 +0000
@@ -1,12 +1,12 @@
-make: "varmod-gmtime.mk" line 57: Invalid time value: ${:U1593536400}} != "mtime=11593536400}"
+make: "varmod-gmtime.mk" line 57: Invalid time value at "${:U1593536400}} != "mtime=11593536400}""
 make: "varmod-gmtime.mk" line 57: Malformed conditional (${%Y:L:gmtime=${:U1593536400}} != "mtime=11593536400}")
-make: "varmod-gmtime.mk" line 67: Invalid time value: -1} != ""
+make: "varmod-gmtime.mk" line 67: Invalid time value at "-1} != """
 make: "varmod-gmtime.mk" line 67: Malformed conditional (${:L:gmtime=-1} != "")
-make: "varmod-gmtime.mk" line 76: Invalid time value:  1} != ""
+make: "varmod-gmtime.mk" line 76: Invalid time value at " 1} != """
 make: "varmod-gmtime.mk" line 76: Malformed conditional (${:L:gmtime= 1} != "")
-make: "varmod-gmtime.mk" line 119: Invalid time value: 10000000000000000000000000000000} != ""
+make: "varmod-gmtime.mk" line 119: Invalid time value at "10000000000000000000000000000000} != """
 make: "varmod-gmtime.mk" line 119: Malformed conditional (${:L:gmtime=10000000000000000000000000000000} != "")
-make: "varmod-gmtime.mk" line 130: Invalid time value: error} != ""
+make: "varmod-gmtime.mk" line 130: Invalid time value at "error} != """
 make: "varmod-gmtime.mk" line 130: Malformed conditional (${:L:gmtime=error} != "")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
diff -r bf3296d3607b -r 21be0b837191 usr.bin/make/unit-tests/varmod-localtime.exp
--- a/usr.bin/make/unit-tests/varmod-localtime.exp      Thu Dec 09 20:13:09 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-localtime.exp      Thu Dec 09 20:27:01 2021 +0000
@@ -1,12 +1,12 @@
-make: "varmod-localtime.mk" line 57: Invalid time value: ${:U1593536400}} != "mtime=11593536400}"
+make: "varmod-localtime.mk" line 57: Invalid time value at "${:U1593536400}} != "mtime=11593536400}""
 make: "varmod-localtime.mk" line 57: Malformed conditional (${%Y:L:localtime=${:U1593536400}} != "mtime=11593536400}")
-make: "varmod-localtime.mk" line 67: Invalid time value: -1} != ""
+make: "varmod-localtime.mk" line 67: Invalid time value at "-1} != """
 make: "varmod-localtime.mk" line 67: Malformed conditional (${:L:localtime=-1} != "")
-make: "varmod-localtime.mk" line 76: Invalid time value:  1} != ""
+make: "varmod-localtime.mk" line 76: Invalid time value at " 1} != """
 make: "varmod-localtime.mk" line 76: Malformed conditional (${:L:localtime= 1} != "")
-make: "varmod-localtime.mk" line 119: Invalid time value: 10000000000000000000000000000000} != ""
+make: "varmod-localtime.mk" line 119: Invalid time value at "10000000000000000000000000000000} != """
 make: "varmod-localtime.mk" line 119: Malformed conditional (${:L:localtime=10000000000000000000000000000000} != "")
-make: "varmod-localtime.mk" line 130: Invalid time value: error} != ""
+make: "varmod-localtime.mk" line 130: Invalid time value at "error} != """
 make: "varmod-localtime.mk" line 130: Malformed conditional (${:L:localtime=error} != "")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
diff -r bf3296d3607b -r 21be0b837191 usr.bin/make/unit-tests/varmod-to-separator.exp
--- a/usr.bin/make/unit-tests/varmod-to-separator.exp   Thu Dec 09 20:13:09 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-to-separator.exp   Thu Dec 09 20:27:01 2021 +0000
@@ -1,6 +1,6 @@
-make: "varmod-to-separator.mk" line 107: Invalid character number: 400:tu}
+make: "varmod-to-separator.mk" line 107: Invalid character number at "400:tu}"
 make: "varmod-to-separator.mk" line 107: Malformed conditional (${WORDS:[1..3]:ts\400:tu})
-make: "varmod-to-separator.mk" line 121: Invalid character number: 100:tu}
+make: "varmod-to-separator.mk" line 121: Invalid character number at "100:tu}"
 make: "varmod-to-separator.mk" line 121: Malformed conditional (${WORDS:[1..3]:ts\x100:tu})
 make: Bad modifier ":ts\-300" for variable "WORDS"
 make: "varmod-to-separator.mk" line 128: Malformed conditional (${WORDS:[1..3]:ts\-300:tu})
diff -r bf3296d3607b -r 21be0b837191 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Thu Dec 09 20:13:09 2021 +0000
+++ b/usr.bin/make/var.c        Thu Dec 09 20:27:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.969 2021/12/09 20:13:10 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.970 2021/12/09 20:27:01 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.969 2021/12/09 20:13:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.970 2021/12/09 20:27:01 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -2587,7 +2587,7 @@
                const char *p = mod + 7;
                if (!TryParseTime(&p, &utc)) {
                        Parse_Error(PARSE_FATAL,
-                           "Invalid time value: %s", mod + 7);
+                           "Invalid time value at \"%s\"", mod + 7);
                        return AMR_CLEANUP;
                }
                *pp = p;
@@ -2619,7 +2619,7 @@
                const char *p = mod + 10;
                if (!TryParseTime(&p, &utc)) {
                        Parse_Error(PARSE_FATAL,
-                           "Invalid time value: %s", mod + 10);
+                           "Invalid time value at \"%s\"", mod + 10);
                        return AMR_CLEANUP;
                }
                *pp = p;
@@ -3092,7 +3092,7 @@
 
                if (!TryParseChar(&p, base, &ch->sep)) {
                        Parse_Error(PARSE_FATAL,
-                           "Invalid character number: %s", p);
+                           "Invalid character number at \"%s\"", p);
                        return AMR_CLEANUP;
                }
                if (!IsDelimiter(*p, ch)) {



Home | Main Index | Thread Index | Old Index