Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/indent indent: move ps.p_l_follow closer to lsym_typ...



details:   https://anonhg.NetBSD.org/src/rev/463d0a1769cb
branches:  trunk
changeset: 991102:463d0a1769cb
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 07 14:04:34 2021 +0000

description:
indent: move ps.p_l_follow closer to lsym_type_outside_parentheses

This makes it easier to see the relation between these two.

No functional change.

diffstat:

 usr.bin/indent/lexi.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r d33399fecad5 -r 463d0a1769cb usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c     Sun Nov 07 14:00:35 2021 +0000
+++ b/usr.bin/indent/lexi.c     Sun Nov 07 14:04:34 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lexi.c,v 1.135 2021/11/07 07:44:59 rillig Exp $        */
+/*     $NetBSD: lexi.c,v 1.136 2021/11/07 14:04:34 rillig Exp $        */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.135 2021/11/07 07:44:59 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.136 2021/11/07 14:04:34 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -415,8 +415,6 @@
 static bool
 probably_typename(void)
 {
-    if (ps.p_l_follow > 0)
-       return false;
     if (ps.block_init || ps.in_stmt)
        return false;
     if (inp.s[0] == '*' && inp.s[1] != '=')
@@ -538,7 +536,7 @@
        return lsym_funcname;
 no_function_definition:;
 
-    } else if (probably_typename()) {
+    } else if (ps.p_l_follow == 0 && probably_typename()) {
        ps.next_unary = true;
        return lsym_type_outside_parentheses;
     }



Home | Main Index | Thread Index | Old Index