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: remove support for pre-1978 variable ...



details:   https://anonhg.NetBSD.org/src/rev/7580be9ae75b
branches:  trunk
changeset: 990636:7580be9ae75b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Oct 31 19:13:41 2021 +0000

description:
indent: remove support for pre-1978 variable initialization

diffstat:

 tests/usr.bin/indent/fmt_decl.c  |  6 +++---
 tests/usr.bin/indent/lex_ident.c |  4 ++--
 usr.bin/indent/lexi.c            |  8 ++------
 3 files changed, 7 insertions(+), 11 deletions(-)

diffs (65 lines):

diff -r e39e34cae0dd -r 7580be9ae75b tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c   Sun Oct 31 19:08:39 2021 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c   Sun Oct 31 19:13:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmt_decl.c,v 1.10 2021/10/31 19:08:39 rillig Exp $     */
+/*     $NetBSD: fmt_decl.c,v 1.11 2021/10/31 19:13:41 rillig Exp $     */
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -446,8 +446,8 @@
 #indent end
 
 #indent run -di0
-int a -1;
+int a - 1;
 {
-       int a -1;
+       int a - 1;
 }
 #indent end
diff -r e39e34cae0dd -r 7580be9ae75b tests/usr.bin/indent/lex_ident.c
--- a/tests/usr.bin/indent/lex_ident.c  Sun Oct 31 19:08:39 2021 +0000
+++ b/tests/usr.bin/indent/lex_ident.c  Sun Oct 31 19:13:41 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_ident.c,v 1.1 2021/10/22 19:27:53 rillig Exp $ */
+/* $NetBSD: lex_ident.c,v 1.2 2021/10/31 19:13:41 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -62,5 +62,5 @@
 #indent end
 
 #indent run
-int            identifier \n;
+int            identifier \ n;
 #indent end
diff -r e39e34cae0dd -r 7580be9ae75b usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c     Sun Oct 31 19:08:39 2021 +0000
+++ b/usr.bin/indent/lexi.c     Sun Oct 31 19:13:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lexi.c,v 1.122 2021/10/31 17:22:47 rillig Exp $        */
+/*     $NetBSD: lexi.c,v 1.123 2021/10/31 19:13:41 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.122 2021/10/31 17:22:47 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.123 2021/10/31 19:13:41 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -576,10 +576,6 @@
        return lsym_type;
     }
 
-    if (ps.prev_token == lsym_type)    /* if this is a declared variable,
-                                        * then following sign is unary */
-       ps.next_unary = true;   /* will make "int a -1" work */
-
     return lsym_ident;         /* the ident is not in the list */
 }
 



Home | Main Index | Thread Index | Old Index