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: clean up grammar for do-while stat...
details: https://anonhg.NetBSD.org/src/rev/a51b55158577
branches: trunk
changeset: 984494:a51b55158577
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Jul 10 09:48:41 2021 +0000
description:
lint: clean up grammar for do-while statements
No functional change.
diffstat:
usr.bin/xlint/lint1/cgram.y | 23 ++++++-----------------
1 files changed, 6 insertions(+), 17 deletions(-)
diffs (66 lines):
diff -r f58ed2476ddb -r a51b55158577 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Sat Jul 10 09:40:12 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Sat Jul 10 09:48:41 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.283 2021/07/10 09:40:12 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.284 2021/07/10 09:48:41 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.283 2021/07/10 09:40:12 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.284 2021/07/10 09:48:41 rillig Exp $");
#endif
#include <limits.h>
@@ -333,7 +333,6 @@
%type <y_op> point_or_arrow
%type <y_type> type_name
%type <y_sym> abstract_declaration
-%type <y_tnode> do_while_expr
%type <y_tnode> expr_opt
%type <y_string> string
%type <y_string> string2
@@ -1510,12 +1509,6 @@
}
;
-do_statement: /* C99 6.8.5 */
- do statement {
- clear_warning_flags();
- }
- ;
-
iteration_statement: /* C99 6.8.5 */
T_WHILE T_LPAREN expr T_RPAREN {
while1($3);
@@ -1524,8 +1517,10 @@
clear_warning_flags();
while2();
}
- | do_statement do_while_expr {
- do2($2);
+ | do statement {
+ clear_warning_flags();
+ } T_WHILE T_LPAREN expr T_RPAREN T_SEMI {
+ do2($6);
seen_fallthrough = false;
}
| do error {
@@ -1557,12 +1552,6 @@
}
;
-do_while_expr: /* see C99 6.8.5 */
- T_WHILE T_LPAREN expr T_RPAREN T_SEMI {
- $$ = $3;
- }
- ;
-
for_start: /* see C99 6.8.5 */
T_FOR T_LPAREN {
begin_declaration_level(AUTO);
Home |
Main Index |
Thread Index |
Old Index