Module Name:    src
Committed By:   rillig
Date:           Sun Nov 19 22:50:11 UTC 2023

Modified Files:
        src/usr.bin/make: arch.c cond.c for.c parse.c suff.c var.c

Log Message:
make: replace 'variable expression' with 'expression' in comments

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/usr.bin/make/arch.c
cvs rdiff -u -r1.354 -r1.355 src/usr.bin/make/cond.c
cvs rdiff -u -r1.176 -r1.177 src/usr.bin/make/for.c
cvs rdiff -u -r1.709 -r1.710 src/usr.bin/make/parse.c
cvs rdiff -u -r1.369 -r1.370 src/usr.bin/make/suff.c
cvs rdiff -u -r1.1074 -r1.1075 src/usr.bin/make/var.c

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/arch.c
diff -u src/usr.bin/make/arch.c:1.213 src/usr.bin/make/arch.c:1.214
--- src/usr.bin/make/arch.c:1.213	Tue Feb 14 21:08:00 2023
+++ src/usr.bin/make/arch.c	Sun Nov 19 22:50:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.213 2023/02/14 21:08:00 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.214 2023/11/19 22:50:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.213 2023/02/14 21:08:00 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.214 2023/11/19 22:50:11 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -205,7 +205,7 @@ Arch_ParseArchive(char **pp, GNodeList *
 	FStr lib;		/* Library-part of specification */
 	FStr mem;		/* Member-part of specification */
 	char saveChar;		/* Ending delimiter of member-name */
-	bool expandLib;		/* Whether the parsed lib contains variable
+	bool expandLib;		/* Whether the parsed lib contains
 				 * expressions that need to be expanded */
 
 	spec = *pp;
@@ -214,7 +214,7 @@ Arch_ParseArchive(char **pp, GNodeList *
 
 	for (cp = lib.str; *cp != '(' && *cp != '\0';) {
 		if (*cp == '$') {
-			/* Expand nested variable expressions. */
+			/* Expand nested expressions. */
 			/* XXX: This code can probably be shortened. */
 			const char *nested_p = cp;
 			FStr result;
@@ -251,7 +251,7 @@ Arch_ParseArchive(char **pp, GNodeList *
 		mem = FStr_InitRefer(cp);
 		while (*cp != '\0' && *cp != ')' && !ch_isspace(*cp)) {
 			if (*cp == '$') {
-				/* Expand nested variable expressions. */
+				/* Expand nested expressions. */
 				/*
 				 * XXX: This code can probably be shortened.
 				 */

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.354 src/usr.bin/make/cond.c:1.355
--- src/usr.bin/make/cond.c:1.354	Fri Aug 11 04:56:31 2023
+++ src/usr.bin/make/cond.c	Sun Nov 19 22:50:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.354 2023/08/11 04:56:31 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.355 2023/11/19 22:50:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -92,7 +92,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.354 2023/08/11 04:56:31 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.355 2023/11/19 22:50:11 rillig Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -154,10 +154,10 @@ typedef struct CondParser {
 	 * expanded before it is evaluated, due to ease of implementation.
 	 * This means that at the point where the condition is evaluated,
 	 * make cannot know anymore whether the left-hand side had originally
-	 * been a variable expression or a plain word.
+	 * been an expression or a plain word.
 	 *
 	 * In conditional directives like '.if', the left-hand side must
-	 * either be a variable expression, a quoted string or a number.
+	 * either be an expression, a quoted string or a number.
 	 */
 	bool leftUnquotedOK;
 
@@ -383,7 +383,7 @@ is_separator(char ch)
 }
 
 /*
- * In a quoted or unquoted string literal or a number, parse a variable
+ * In a quoted or unquoted string literal or a number, parse an
  * expression and add its value to the buffer.
  *
  * Return whether to continue parsing the leaf.
@@ -429,7 +429,7 @@ CondParser_StringExpr(CondParser *par, c
 }
 
 /*
- * Parse a string from a variable expression or an optionally quoted string,
+ * Parse a string from an expression or an optionally quoted string,
  * on the left-hand and right-hand sides of comparisons.
  *
  * Results:
@@ -489,7 +489,7 @@ CondParser_Leaf(CondParser *par, bool do
 			    !ch_isdigit(*start)) {
 				/*
 				 * The left-hand side must be quoted,
-				 * a variable expression or a number.
+				 * an expression or a number.
 				 */
 				str = FStr_InitRefer(NULL);
 				goto return_str;
@@ -734,7 +734,7 @@ CondParser_FuncCall(CondParser *par, boo
 /*
  * Parse a comparison that neither starts with '"' nor '$', such as the
  * unusual 'bare == right' or '3 == ${VAR}', or a simple leaf without
- * operator, which is a number, a variable expression or a string literal.
+ * operator, which is a number, an expression or a string literal.
  *
  * TODO: Can this be merged into CondParser_Comparison?
  */
@@ -759,7 +759,7 @@ CondParser_ComparisonOrLeaf(CondParser *
 	 * as an expression.
 	 */
 	/*
-	 * XXX: In edge cases, a variable expression may be evaluated twice,
+	 * XXX: In edge cases, an expression may be evaluated twice,
 	 *  see cond-token-plain.mk, keyword 'twice'.
 	 */
 	arg = ParseWord(&cp, doEval);
@@ -961,7 +961,7 @@ CondParser_Eval(CondParser *par)
 }
 
 /*
- * Evaluate the condition, including any side effects from the variable
+ * Evaluate the condition, including any side effects from the
  * expressions in the condition. The condition consists of &&, ||, !,
  * function(arg), comparisons and parenthetical groupings thereof.
  */

Index: src/usr.bin/make/for.c
diff -u src/usr.bin/make/for.c:1.176 src/usr.bin/make/for.c:1.177
--- src/usr.bin/make/for.c:1.176	Thu Jun  1 09:02:14 2023
+++ src/usr.bin/make/for.c	Sun Nov 19 22:50:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: for.c,v 1.176 2023/06/01 09:02:14 rillig Exp $	*/
+/*	$NetBSD: for.c,v 1.177 2023/11/19 22:50:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -45,7 +45,7 @@
  *
  * After reaching the .endfor, the values from the .for line are grouped
  * according to the number of variables.  For each such group, the unexpanded
- * body is scanned for variable expressions, and those that match the
+ * body is scanned for expressions, and those that match the
  * variable names are replaced with expressions of the form ${:U...}.  After
  * that, the body is treated like a file from an .include directive.
  *
@@ -58,7 +58,7 @@
 #include "make.h"
 
 /*	"@(#)for.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: for.c,v 1.176 2023/06/01 09:02:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.177 2023/11/19 22:50:11 rillig Exp $");
 
 
 typedef struct ForLoop {
@@ -298,8 +298,8 @@ For_Accum(const char *line, int *forLeve
 /*
  * When the body of a '.for i' loop is prepared for an iteration, each
  * occurrence of $i in the body is replaced with ${:U...}, inserting the
- * value of the item.  If this item contains a '$', it may be the start of a
- * variable expression.  This expression is copied verbatim, its length is
+ * value of the item.  If this item contains a '$', it may be the start of an
+ * expression.  This expression is copied verbatim, its length is
  * determined here, in a rather naive way, ignoring escape characters and
  * funny delimiters in modifiers like ':S}from}to}'.
  */
@@ -428,7 +428,7 @@ ForLoop_SubstVarLong(ForLoop *f, unsigne
 
 /*
  * While expanding the body of a .for loop, replace single-character
- * variable expressions like $i with their ${:U...} expansion.
+ * expressions like $i with their ${:U...} expansion.
  */
 static void
 ForLoop_SubstVarShort(ForLoop *f, unsigned int firstItem, Buffer *body,
@@ -464,7 +464,7 @@ found:
  * Compute the body for the current iteration by copying the unexpanded body,
  * replacing the expressions for the iteration variables on the way.
  *
- * Using variable expressions ensures that the .for loop can't generate
+ * Using expressions ensures that the .for loop can't generate
  * syntax, and that the later parsing will still see an expression.
  * This code assumes that the variable with the empty name is never defined,
  * see unit-tests/varname-empty.mk.

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.709 src/usr.bin/make/parse.c:1.710
--- src/usr.bin/make/parse.c:1.709	Thu Nov  2 05:55:22 2023
+++ src/usr.bin/make/parse.c	Sun Nov 19 22:50:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.709 2023/11/02 05:55:22 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.710 2023/11/19 22:50:11 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.709 2023/11/02 05:55:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.710 2023/11/19 22:50:11 rillig Exp $");
 
 /* Detects a multiple-inclusion guard in a makefile. */
 typedef enum {
@@ -1918,7 +1918,7 @@ Parse_Var(VarAssign *var, GNode *scope)
 
 
 /*
- * See if the command possibly calls a sub-make by using the variable
+ * See if the command possibly calls a sub-make by using the
  * expressions ${.MAKE}, ${MAKE} or the plain word "make".
  */
 static bool
@@ -2847,7 +2847,7 @@ ParseDependencyLine(char *line)
 	 * as well.
 	 *
 	 * Parsing the line first would also prevent that targets
-	 * generated from variable expressions are interpreted as the
+	 * generated from expressions are interpreted as the
 	 * dependency operator, such as in "target${:U\:} middle: source",
 	 * in which the middle is interpreted as a source, not a target.
 	 */

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.369 src/usr.bin/make/suff.c:1.370
--- src/usr.bin/make/suff.c:1.369	Sun Nov 19 22:06:15 2023
+++ src/usr.bin/make/suff.c	Sun Nov 19 22:50:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.369 2023/11/19 22:06:15 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.370 2023/11/19 22:50:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -115,7 +115,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.369 2023/11/19 22:06:15 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.370 2023/11/19 22:50:11 rillig Exp $");
 
 typedef List SuffixList;
 typedef ListNode SuffixListNode;
@@ -1287,7 +1287,7 @@ ExpandWildcards(GNodeListNode *cln, GNod
  * add those nodes to the members list.
  *
  * Unfortunately, we can't use Str_Words because it doesn't understand about
- * variable expressions with spaces in them.
+ * expressions with spaces in them.
  */
 static void
 ExpandChildrenRegular(char *cp, GNode *pgn, GNodeList *members)
@@ -1310,7 +1310,7 @@ ExpandChildrenRegular(char *cp, GNode *p
 			/* Continue at the next non-space. */
 			start = cp;
 		} else if (*cp == '$') {
-			/* Skip over the variable expression. */
+			/* Skip over the expression. */
 			const char *nested_p = cp;
 			FStr junk = Var_Parse(&nested_p, pgn, VARE_PARSE_ONLY);
 			/* TODO: handle errors */
@@ -1347,7 +1347,7 @@ ExpandChildrenRegular(char *cp, GNode *p
 }
 
 /*
- * Expand the names of any children of a given node that contain variable
+ * Expand the names of any children of a given node that contain
  * expressions or file wildcards into actual targets.
  *
  * The expanded node is removed from the parent's list of children, and the

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1074 src/usr.bin/make/var.c:1.1075
--- src/usr.bin/make/var.c:1.1074	Sun Nov 19 22:06:15 2023
+++ src/usr.bin/make/var.c	Sun Nov 19 22:50:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1074 2023/11/19 22:06:15 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1075 2023/11/19 22:50:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -98,9 +98,9 @@
  *	Var_Value	Return the unexpanded value of a variable, or NULL if
  *			the variable is undefined.
  *
- *	Var_Subst	Substitute all variable expressions in a string.
+ *	Var_Subst	Substitute all expressions in a string.
  *
- *	Var_Parse	Parse a variable expression such as ${VAR:Mpattern}.
+ *	Var_Parse	Parse an expression such as ${VAR:Mpattern}.
  *
  *	Var_Delete
  *			Delete a variable.
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1074 2023/11/19 22:06:15 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1075 2023/11/19 22:50:11 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -158,7 +158,7 @@ MAKE_RCSID("$NetBSD: var.c,v 1.1074 2023
  * Environment variables are short-lived.  They are returned by VarFind, and
  * after using them, they must be freed using VarFreeShortLived.
  *
- * Undefined variables occur during evaluation of variable expressions such
+ * Undefined variables occur during evaluation of expressions such
  * as ${UNDEF:Ufallback} in Var_Parse and ApplyModifiers.
  */
 typedef struct Var {
@@ -1337,7 +1337,7 @@ SepBuf_DoneData(SepBuf *buf)
 
 
 /*
- * This callback for ModifyWords gets a single word from a variable expression
+ * This callback for ModifyWords gets a single word from an expression
  * and typically adds a modification of this word to the buffer. It may also
  * do nothing or add several words.
  *
@@ -1927,7 +1927,7 @@ FormatTime(const char *fmt, time_t t, bo
  * If parsing fails and the SysV modifier ${VAR:from=to} should not be used
  * as a fallback, issue an error message using Parse_Error (preferred over
  * Error) and then return AMR_CLEANUP, or return AMR_BAD for the default error
- * message.  Both of these return values will stop processing the variable
+ * message.  Both of these return values will stop processing the
  * expression.  (XXX: As of 2020-08-23, evaluation of the whole string
  * continues nevertheless after skipping a few bytes, which essentially is
  * undefined behavior.  Not in the sense of C, but still the resulting string
@@ -1936,12 +1936,12 @@ FormatTime(const char *fmt, time_t t, bo
  * Evaluating the modifier
  *
  * After parsing, the modifier is evaluated.  The side effects from evaluating
- * nested variable expressions in the modifier text often already happen
+ * nested expressions in the modifier text often already happen
  * during parsing though.  For most modifiers this doesn't matter since their
  * only noticeable effect is that they update the value of the expression.
  * Some modifiers such as ':sh' or '::=' have noticeable side effects though.
  *
- * Evaluating the modifier usually takes the current value of the variable
+ * Evaluating the modifier usually takes the current value of the
  * expression from ch->expr->value, or the variable name from ch->var->name
  * and stores the result back in ch->expr->value via Expr_SetValueOwn or
  * Expr_SetValueRefer.
@@ -1961,12 +1961,12 @@ FormatTime(const char *fmt, time_t t, bo
  */
 
 typedef enum ExprDefined {
-	/* The variable expression is based on a regular, defined variable. */
+	/* The expression is based on a regular, defined variable. */
 	DEF_REGULAR,
-	/* The variable expression is based on an undefined variable. */
+	/* The expression is based on an undefined variable. */
 	DEF_UNDEF,
 	/*
-	 * The variable expression started as an undefined expression, but one
+	 * The expression started as an undefined expression, but one
 	 * of the modifiers (such as ':D' or ':U') has turned the expression
 	 * from undefined to defined.
 	 */
@@ -2137,7 +2137,7 @@ ParseModifierPartExpr(const char **pp, L
  * If the text starts with '$(', any '(' and ')' must be balanced.
  * If the text starts with '${', any '{' and '}' must be balanced.
  * If the text starts with '$', that '$' is copied verbatim, it is not parsed
- * as a short-name variable expression.
+ * as a short-name expression.
  */
 static void
 ParseModifierPartBalanced(const char **pp, LazyBuf *part)
@@ -3729,7 +3729,7 @@ ApplyModifier_SysV(const char **pp, ModC
 		return AMR_CLEANUP;
 
 	/*
-	 * The SysV modifier lasts until the end of the variable expression.
+	 * The SysV modifier lasts until the end of the expression.
 	 */
 	if (!ParseModifierPart(pp, ch->endc, expr->emode, ch, &rhsBuf)) {
 		LazyBuf_Done(&lhsBuf);
@@ -3930,16 +3930,16 @@ typedef enum ApplyModifiersIndirectResul
 } ApplyModifiersIndirectResult;
 
 /*
- * While expanding a variable expression, expand and apply indirect modifiers,
+ * While expanding an expression, expand and apply indirect modifiers,
  * such as in ${VAR:${M_indirect}}.
  *
- * All indirect modifiers of a group must come from a single variable
+ * All indirect modifiers of a group must come from a single
  * expression.  ${VAR:${M1}} is valid but ${VAR:${M1}${M2}} is not.
  *
  * Multiple groups of indirect modifiers can be chained by separating them
  * with colons.  ${VAR:${M1}:${M2}} contains 2 indirect modifiers.
  *
- * If the variable expression is not followed by ch->endc or ':', fall
+ * If the expression is not followed by ch->endc or ':', fall
  * back to trying the SysV modifier, such as in ${VAR:${FROM}=${TO}}.
  */
 static ApplyModifiersIndirectResult
@@ -4428,7 +4428,7 @@ ParseVarnameLong(
 		}
 
 		/*
-		 * The variable expression is based on an undefined variable.
+		 * The expression is based on an undefined variable.
 		 * Nevertheless it needs a Var, for modifiers that access the
 		 * variable name, such as :L or :?.
 		 *
@@ -4504,7 +4504,7 @@ Var_Parse_FastLane(const char **pp, VarE
 }
 
 /*
- * Given the start of a variable expression (such as $v, $(VAR),
+ * Given the start of an expression (such as $v, $(VAR),
  * ${VAR:Mpattern}), extract the variable name and value, and the modifiers,
  * if any.  While doing that, apply the modifiers to the value of the
  * expression, forming its final value.  A few of the modifiers such as :!cmd!
@@ -4524,7 +4524,7 @@ Var_Parse_FastLane(const char **pp, VarE
  *			point to some random character in the string, to the
  *			location of the parse error, or at the end of the
  *			string.
- *	return		The value of the variable expression, never NULL.
+ *	return		The value of the expression, never NULL.
  *	return		var_Error if there was a parse error.
  *	return		var_Error if the base variable of the expression was
  *			undefined, emode is VARE_UNDEFERR, and none of
@@ -4732,8 +4732,8 @@ VarSubstExpr(const char **pp, Buffer *bu
 }
 
 /*
- * Skip as many characters as possible -- either to the end of the string
- * or to the next dollar sign (variable expression).
+ * Skip as many characters as possible -- either to the end of the string,
+ * or to the next dollar sign, which may start an expression.
  */
 static void
 VarSubstPlain(const char **pp, Buffer *res)
@@ -4748,11 +4748,11 @@ VarSubstPlain(const char **pp, Buffer *r
 }
 
 /*
- * Expand all variable expressions like $V, ${VAR}, $(VAR:Modifiers) in the
+ * Expand all expressions like $V, ${VAR}, $(VAR:Modifiers) in the
  * given string.
  *
  * Input:
- *	str		The string in which the variable expressions are
+ *	str		The string in which the expressions are
  *			expanded.
  *	scope		The scope in which to start searching for
  *			variables.  The other scopes are searched as well.

Reply via email to