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(1): improve documentation in For_Eval



details:   https://anonhg.NetBSD.org/src/rev/97d45429aa60
branches:  trunk
changeset: 943582:97d45429aa60
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Sep 06 19:19:49 2020 +0000

description:
make(1): improve documentation in For_Eval

diffstat:

 usr.bin/make/for.c |  27 +++++++++------------------
 1 files changed, 9 insertions(+), 18 deletions(-)

diffs (70 lines):

diff -r fc7f19182577 -r 97d45429aa60 usr.bin/make/for.c
--- a/usr.bin/make/for.c        Sun Sep 06 19:18:16 2020 +0000
+++ b/usr.bin/make/for.c        Sun Sep 06 19:19:49 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.69 2020/09/06 19:18:16 rillig Exp $  */
+/*     $NetBSD: for.c,v 1.70 2020/09/06 19:19:49 rillig Exp $  */
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -30,14 +30,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: for.c,v 1.69 2020/09/06 19:18:16 rillig Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.70 2020/09/06 19:19:49 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)for.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: for.c,v 1.69 2020/09/06 19:18:16 rillig Exp $");
+__RCSID("$NetBSD: for.c,v 1.70 2020/09/06 19:19:49 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -108,12 +108,8 @@
     free(arg);
 }
 
-/*-
- *-----------------------------------------------------------------------
- * For_Eval --
- *     Evaluate the for loop in the passed line. The line
- *     looks like this:
- *         .for <variable> in <varlist>
+/* Evaluate the for loop in the passed line. The line looks like this:
+ *     .for <varname...> in <value...>
  *
  * Input:
  *     line            Line to parse
@@ -122,11 +118,6 @@
  *      0: Not a .for statement, parse the line
  *     1: We found a for loop
  *     -1: A .for statement with a bad syntax error, discard.
- *
- * Side Effects:
- *     None.
- *
- *-----------------------------------------------------------------------
  */
 int
 For_Eval(char *line)
@@ -194,12 +185,12 @@
        ptr++;
 
     /*
-     * Make a list with the remaining words
-     * The values are substituted as ${:U<value>...} so we must \ escape
-     * characters that break that syntax.
+     * Make a list with the remaining words.
+     * The values are later substituted as ${:U<value>...} so we must
+     * backslash-escape characters that break that syntax.
      * Variables are fully expanded - so it is safe for escape $.
      * We can't do the escapes here - because we don't know whether
-     * we are substuting into ${...} or $(...).
+     * we will be substituting into ${...} or $(...).
      */
     sub = Var_Subst(ptr, VAR_GLOBAL, VARE_WANTRES);
 



Home | Main Index | Thread Index | Old Index