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: swap order in grammar rule clrtyp_...



details:   https://anonhg.NetBSD.org/src/rev/323c214d933c
branches:  trunk
changeset: 1022239:323c214d933c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 10 15:04:07 2021 +0000

description:
lint: swap order in grammar rule clrtyp_typespec

It should not make a difference whether the rule says 'T_TYPENAME
clrtyp' or 'clrtyp T_TYPENAME'.  The latter order is more consistent
with the name of the rule, though.

According to the code, these two tokens take completely distinct
actions.  The code coverage outside of cgram.y and cgram.c stays exactly
the same, at least for lint's test suite.

No functional change intended.

diffstat:

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

diffs (30 lines):

diff -r 21e8032773cb -r 323c214d933c usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sat Jul 10 14:45:15 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sat Jul 10 15:04:07 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.289 2021/07/10 14:45:15 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.290 2021/07/10 15:04:07 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.289 2021/07/10 14:45:15 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.290 2021/07/10 15:04:07 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -571,8 +571,8 @@
          clrtyp notype_typespec {
                $$ = $2;
          }
-       | T_TYPENAME clrtyp {
-               $$ = getsym($1)->s_type;
+       | clrtyp T_TYPENAME {
+               $$ = getsym($2)->s_type;
          }
        ;
 



Home | Main Index | Thread Index | Old Index