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 make for introduce a new block level for...
details: https://anonhg.NetBSD.org/src/rev/d4a506fa7786
branches: trunk
changeset: 332511:d4a506fa7786
user: christos <christos%NetBSD.org@localhost>
date: Fri Sep 26 01:20:00 2014 +0000
description:
make for introduce a new block level for c99 decls.
diffstat:
usr.bin/xlint/lint1/cgram.y | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diffs (50 lines):
diff -r 6bf882a5260e -r d4a506fa7786 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Thu Sep 25 16:05:44 2014 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Fri Sep 26 01:20:00 2014 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.65 2014/04/21 21:52:24 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.66 2014/09/26 01:20:00 christos 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.65 2014/04/21 21:52:24 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.66 2014/09/26 01:20:00 christos Exp $");
#endif
#include <stdlib.h>
@@ -1552,16 +1552,26 @@
}
;
+for_start:
+ T_FOR T_LPARN {
+ pushdecl(AUTO);
+ blklev++;
+ }
+ ;
for_exprs:
- T_FOR T_LPARN declspecs deftyp notype_init_decls T_SEMI opt_expr
+ for_start declspecs deftyp notype_init_decls T_SEMI opt_expr
T_SEMI opt_expr T_RPARN {
c99ism(325);
- for1(NULL, $7, $9);
+ for1(NULL, $6, $8);
CLRWFLGS(__FILE__, __LINE__);
+ popdecl();
+ blklev--;
}
- | T_FOR T_LPARN opt_expr T_SEMI opt_expr T_SEMI opt_expr T_RPARN {
- for1($3, $5, $7);
+ | for_start opt_expr T_SEMI opt_expr T_SEMI opt_expr T_RPARN {
+ for1($2, $4, $6);
CLRWFLGS(__FILE__, __LINE__);
+ popdecl();
+ blklev--;
}
;
Home |
Main Index |
Thread Index |
Old Index