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: merge duplicate code in declmods a...



details:   https://anonhg.NetBSD.org/src/rev/49951d5a1522
branches:  trunk
changeset: 984481:49951d5a1522
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 10 04:47:25 2021 +0000

description:
lint: merge duplicate code in declmods and declmod

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y |  17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diffs (49 lines):

diff -r 7a794a7c0d22 -r 49951d5a1522 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sat Jul 10 04:25:47 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sat Jul 10 04:47:25 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.278 2021/07/10 04:25:47 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.279 2021/07/10 04:47:25 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.278 2021/07/10 04:25:47 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.279 2021/07/10 04:47:25 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -549,23 +549,22 @@
        ;
 
 declmods:
-         clrtyp T_QUAL {
-               add_qualifier($2);
-         }
-       | clrtyp T_SCLASS {
-               add_storage_class($2);
-         }
+         clrtyp qualifier_or_storage_class
        | declmods declmod
        ;
 
 declmod:
+         qualifier_or_storage_class
+       | type_attribute
+       ;
+
+qualifier_or_storage_class:
          T_QUAL {
                add_qualifier($1);
          }
        | T_SCLASS {
                add_storage_class($1);
          }
-       | type_attribute
        ;
 
 clrtyp_typespec:



Home | Main Index | Thread Index | Old Index