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: align rule names in grammar with C99



details:   https://anonhg.NetBSD.org/src/rev/653aeb5d06fc
branches:  trunk
changeset: 1019782:653aeb5d06fc
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Mar 20 10:32:43 2021 +0000

description:
lint: align rule names in grammar with C99

No functional change.

diffstat:

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

diffs (98 lines):

diff -r 28343141155a -r 653aeb5d06fc usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sat Mar 20 08:59:46 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sat Mar 20 10:32:43 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.178 2021/03/19 07:54:13 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.179 2021/03/20 10:32:43 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.178 2021/03/19 07:54:13 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.179 2021/03/20 10:32:43 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -1002,7 +1002,7 @@
          }
        | notype_decl opt_asm_or_symbolrename {
                cgram_declare($1, true, $2);
-         } T_ASSIGN initializer {
+         } T_ASSIGN outermost_initializer {
                check_size($1);
          }
        ;
@@ -1014,7 +1014,7 @@
          }
        | type_decl opt_asm_or_symbolrename {
                cgram_declare($1, true, $2);
-         } T_ASSIGN initializer {
+         } T_ASSIGN outermost_initializer {
                check_size($1);
          }
        ;
@@ -1317,16 +1317,16 @@
          }
        ;
 
-initializer:
+outermost_initializer:
          {
-               cgram_debug("begin initializer");
-         } init_assign_expr {
-               cgram_debug("end initializer");
+               cgram_debug("begin initialization");
+         } initializer {
+               cgram_debug("end initialization");
          }
        ;
 
-init_assign_expr:
-       | init_by_name init_base_expr   %prec T_COMMA
+initializer:                   /* C99 6.7.8 "Initialization" */
+       | designation init_base_expr    %prec T_COMMA
        | init_base_expr
 
 init_base_expr:
@@ -1336,14 +1336,14 @@
        | init_lbrace init_rbrace {
                /* XXX: Empty braces are not covered by C99 6.7.8. */
          }
-       | init_lbrace init_expr_list init_rbrace
-       | init_lbrace init_expr_list T_COMMA init_rbrace
+       | init_lbrace initializer_list init_rbrace
+       | init_lbrace initializer_list T_COMMA init_rbrace
        | error
        ;
 
-init_expr_list:
-         init_assign_expr              %prec T_COMMA
-       | init_expr_list T_COMMA init_assign_expr
+initializer_list:              /* C99 6.7.8 "Initialization" */
+         initializer           %prec T_COMMA
+       | initializer_list T_COMMA initializer
        ;
 
 range:
@@ -1379,7 +1379,7 @@
        | designator_list designator
        ;
 
-init_by_name:
+designation:                   /* C99 6.7.8 "Initialization" */
          designator_list T_ASSIGN
        | identifier T_COLON {
                /* GCC style struct or union member name in initializer */
@@ -1978,7 +1978,7 @@
        | T_LPAREN type_name T_RPAREN                   %prec T_UNARY {
                sym_t *tmp = mktempsym($2);
                cgram_declare(tmp, true, NULL);
-         } init_lbrace init_expr_list init_rbrace {
+         } init_lbrace initializer_list init_rbrace {
                if (!Sflag)
                         /* compound literals are a C9X/GCC extension */
                         gnuism(319);



Home | Main Index | Thread Index | Old Index