Module Name:    src
Committed By:   rillig
Date:           Thu Jul  8 03:22:47 UTC 2021

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

Log Message:
lint: move optional grammar rules above their corresponding rules

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 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.267 src/usr.bin/xlint/lint1/cgram.y:1.268
--- src/usr.bin/xlint/lint1/cgram.y:1.267	Thu Jul  8 03:19:17 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Thu Jul  8 03:22:47 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.267 2021/07/08 03:19:17 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.268 2021/07/08 03:22:47 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.267 2021/07/08 03:19:17 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.268 2021/07/08 03:22:47 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -690,11 +690,6 @@ member_declaration_list_with_rbrace:
 	  }
 	;
 
-type_attribute_opt:
-	  /* empty */
-	| type_attribute
-	;
-
 member_declaration_list:
 	  member_declaration
 	| member_declaration_list T_SEMI member_declaration {
@@ -1627,13 +1622,6 @@ for_exprs:
 	  }
 	;
 
-expr_opt:
-	  /* empty */ {
-		$$ = NULL;
-	  }
-	| expr
-	;
-
 jump_statement:			/* C99 6.8.6 */
 	  goto identifier T_SEMI {
 		do_goto(getsym($2));
@@ -1691,6 +1679,13 @@ constant_expr:			/* C99 6.6 */
 	  expr %prec T_ASSIGN
 	;
 
+expr_opt:
+	  /* empty */ {
+		$$ = NULL;
+	  }
+	| expr
+	;
+
 expr:
 	  expr T_ASTERISK expr {
 		$$ = build(MULT, $1, $3);
@@ -1995,6 +1990,11 @@ type_attribute_list:
 	| type_attribute_list type_attribute
 	;
 
+type_attribute_opt:
+	  /* empty */
+	| type_attribute
+	;
+
 type_attribute:
 	  gcc_attribute
 	| T_ALIGNAS T_LPAREN align_as T_RPAREN

Reply via email to