Module Name:    src
Committed By:   christos
Date:           Fri Sep 26 01:20:00 UTC 2014

Modified Files:
        src/usr.bin/xlint/lint1: cgram.y

Log Message:
make for introduce a new block level for c99 decls.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/xlint/lint1/cgram.y

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/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.65 src/usr.bin/xlint/lint1/cgram.y:1.66
--- src/usr.bin/xlint/lint1/cgram.y:1.65	Mon Apr 21 17:52:24 2014
+++ src/usr.bin/xlint/lint1/cgram.y	Thu Sep 25 21:20:00 2014
@@ -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 @@ do_while_expr:
 	  }
 	;
 
+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--;
 	  }
 	;
 

Reply via email to