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: move parsing of function calls out of Con...



details:   https://anonhg.NetBSD.org/src/rev/e341ca8d298c
branches:  trunk
changeset: 379598:e341ca8d298c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jun 11 13:09:10 2021 +0000

description:
make: move parsing of function calls out of CondParser_LeafToken

The grammar above the parsing code says that a Leaf has nothing to do
with function calls, so don't mix these in the actual code.

No functional change.

diffstat:

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

diffs (37 lines):

diff -r 1dac92c9b646 -r e341ca8d298c usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Fri Jun 11 13:01:28 2021 +0000
+++ b/usr.bin/make/cond.c       Fri Jun 11 13:09:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.263 2021/06/11 12:23:00 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.264 2021/06/11 13:09:10 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.263 2021/06/11 12:23:00 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.264 2021/06/11 13:09:10 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -836,9 +836,6 @@ CondParser_LeafToken(CondParser *par, bo
        const char *cp;
        const char *cp1;
 
-       if (CondParser_FuncCall(par, doEval, &t))
-               return t;
-
        /* Push anything numeric through the compare expression */
        cp = par->p;
        if (ch_isdigit(cp[0]) || cp[0] == '-' || cp[0] == '+')
@@ -931,6 +928,8 @@ CondParser_Token(CondParser *par, bool d
                return CondParser_Comparison(par, doEval);
 
        default:
+               if (CondParser_FuncCall(par, doEval, &t))
+                       return t;
                return CondParser_LeafToken(par, doEval);
        }
 }



Home | Main Index | Thread Index | Old Index