Module Name: src
Committed By: rillig
Date: Fri May 12 15:36:02 UTC 2023
Modified Files:
src/usr.bin/indent: indent.c
Log Message:
indent: remove code for parsing declarations without semicolon
The statement from the comment that declarations do not need semicolons
is wrong. A possible input that matched this rule is 'void f(void) { int
a }'.
To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/indent/indent.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.254 src/usr.bin/indent/indent.c:1.255
--- src/usr.bin/indent/indent.c:1.254 Fri May 12 10:53:33 2023
+++ src/usr.bin/indent/indent.c Fri May 12 15:36:02 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: indent.c,v 1.254 2023/05/12 10:53:33 rillig Exp $ */
+/* $NetBSD: indent.c,v 1.255 2023/05/12 15:36:02 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c 5.1
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.254 2023/05/12 10:53:33 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.255 2023/05/12 15:36:02 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
#endif
@@ -732,11 +732,6 @@ process_lbrace(void)
static void
process_rbrace(void)
{
- if (ps.s_sym[ps.tos] == psym_decl && !ps.block_init) {
- /* semicolons can be omitted in declarations */
- parse(psym_semicolon);
- }
-
if (ps.nparen > 0) { /* check for unclosed if, for, else. */
diag(1, "Unbalanced parentheses");
ps.nparen = 0;