Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 lint: merge duplicate code in grammar fo...
details: https://anonhg.NetBSD.org/src/rev/c325eda3d9d1
branches: trunk
changeset: 984495:c325eda3d9d1
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Jul 10 09:53:00 2021 +0000
description:
lint: merge duplicate code in grammar for 'for' loops
No functional change.
diffstat:
usr.bin/xlint/lint1/cgram.y | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diffs (52 lines):
diff -r a51b55158577 -r c325eda3d9d1 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Sat Jul 10 09:48:41 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Sat Jul 10 09:53:00 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.284 2021/07/10 09:48:41 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.285 2021/07/10 09:53:00 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.284 2021/07/10 09:48:41 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.285 2021/07/10 09:53:00 rillig Exp $");
#endif
#include <limits.h>
@@ -1513,7 +1513,7 @@
T_WHILE T_LPAREN expr T_RPAREN {
while1($3);
clear_warning_flags();
- } while_body {
+ } iteration_body {
clear_warning_flags();
while2();
}
@@ -1527,13 +1527,7 @@
clear_warning_flags();
do2(NULL);
}
- | for_exprs statement {
- clear_warning_flags();
- for2();
- end_declaration_level();
- block_level--;
- }
- | for_exprs error {
+ | for_exprs iteration_body {
clear_warning_flags();
for2();
end_declaration_level();
@@ -1541,7 +1535,7 @@
}
;
-while_body:
+iteration_body:
statement
| error
;
Home |
Main Index |
Thread Index |
Old Index