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: improve comments about parsing and evalua...



details:   https://anonhg.NetBSD.org/src/rev/d1aa77e31972
branches:  trunk
changeset: 362592:d1aa77e31972
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Mar 03 19:46:31 2022 +0000

description:
make: improve comments about parsing and evaluating conditions

No binary change.

diffstat:

 usr.bin/make/cond.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 529ecc93ec04 -r d1aa77e31972 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Thu Mar 03 19:40:54 2022 +0000
+++ b/usr.bin/make/cond.c       Thu Mar 03 19:46:31 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.332 2022/03/03 19:40:54 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.333 2022/03/03 19:46:31 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.332 2022/03/03 19:40:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.333 2022/03/03 19:46:31 rillig Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -140,7 +140,9 @@
        /*
         * The plain '.if ${VAR}' evaluates to true if the value of the
         * expression has length > 0.  The other '.if' variants delegate
-        * to evalBare instead.
+        * to evalBare instead, for example '.ifdef ${VAR}' is equivalent to
+        * '.if defined(${VAR})', checking whether the variable named by the
+        * expression '${VAR}' is defined.
         */
        bool plain;
 
@@ -157,8 +159,8 @@
         * make cannot know anymore whether the left-hand side had originally
         * been a variable expression or a plain word.
         *
-        * In all other contexts, the left-hand side must either be a
-        * variable expression, a quoted string or a number.
+        * In conditional directives like '.if', the left-hand side must
+        * either be a variable expression, a quoted string or a number.
         */
        bool leftUnquotedOK;
 



Home | Main Index | Thread Index | Old Index