Module Name:    src
Committed By:   rillig
Date:           Fri Apr 29 19:37:00 UTC 2022

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

Log Message:
lint: reorder grammar rule begin_type_typespec

This makes the rule structurally more similar to the other rules.  The
goal is that all rules whose name starts with 'begin_type_' actually
start with the rule 'begin_type'.  Currently, some rules parse their
type attributes before 'begin_type', which feels wrong, as type
attributes should be part of the type.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.405 -r1.406 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.405 src/usr.bin/xlint/lint1/cgram.y:1.406
--- src/usr.bin/xlint/lint1/cgram.y:1.405	Fri Apr 29 07:02:40 2022
+++ src/usr.bin/xlint/lint1/cgram.y	Fri Apr 29 19:37:00 2022
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.405 2022/04/29 07:02:40 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.406 2022/04/29 19:37: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.405 2022/04/29 07:02:40 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.406 2022/04/29 19:37:00 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -817,8 +817,8 @@ begin_type_typespec:
 	  begin_type notype_type_specifier {
 		$$ = $2;
 	  }
-	| T_TYPENAME begin_type {
-		$$ = getsym($1)->s_type;
+	| begin_type T_TYPENAME {
+		$$ = getsym($2)->s_type;
 	  }
 	;
 

Reply via email to