Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/indent indent: rename type_at_paren_level_0 to type_...



details:   https://anonhg.NetBSD.org/src/rev/d3f8dfde5700
branches:  trunk
changeset: 991077:d3f8dfde5700
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 07 07:44:59 2021 +0000

description:
indent: rename type_at_paren_level_0 to type_outside_parentheses

For symmetry with type_in_parentheses.

No functional change.

diffstat:

 tests/usr.bin/indent/fmt_decl.c      |  20 ++++++++++----------
 tests/usr.bin/indent/token_comment.c |   4 ++--
 usr.bin/indent/indent.c              |   6 +++---
 usr.bin/indent/indent.h              |   4 ++--
 usr.bin/indent/lexi.c                |  14 +++++++-------
 5 files changed, 24 insertions(+), 24 deletions(-)

diffs (175 lines):

diff -r 8d873f324758 -r d3f8dfde5700 tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c   Sun Nov 07 07:35:06 2021 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c   Sun Nov 07 07:44:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmt_decl.c,v 1.12 2021/10/31 19:20:53 rillig Exp $     */
+/*     $NetBSD: fmt_decl.c,v 1.13 2021/11/07 07:45:00 rillig Exp $     */
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -59,30 +59,30 @@
 
 
 /*
- * As of 2021-10-31, indent parses the following function definition as these
+ * As of 2021-11-07, indent parses the following function definition as these
  * tokens:
  *
- * line 1: type_at_paren_level_0 type "void"
+ * line 1: type_outside_parentheses "void"
  * line 1: newline "\n"
  * line 2: funcname "t1"
  * line 2: newline "\n"                repeated, see search_stmt
  * line 3: funcname "t1"       XXX: wrong line_no
  * line 3: lparen_or_lbracket "("
- * line 3: ident type "char"
+ * line 3: type_in_parentheses "char"
  * line 3: unary_op "*"
- * line 3: ident "a"
+ * line 3: word "a"
  * line 3: comma ","
- * line 3: ident type "int"
- * line 3: ident "b"
+ * line 3: type_in_parentheses "int"
+ * line 3: word "b"
  * line 3: comma ","
  * line 3: newline "\n"
- * line 4: ident type "void"
+ * line 4: type_in_parentheses "void"
  * line 4: lparen_or_lbracket "("
  * line 4: unary_op "*"
- * line 4: ident "fn"
+ * line 4: word "fn"
  * line 4: rparen_or_rbracket ")"
  * line 4: lparen_or_lbracket "("
- * line 4: ident type "void"
+ * line 4: type_in_parentheses "void"
  * line 4: rparen_or_rbracket ")"
  * line 4: rparen_or_rbracket ")"
  * line 4: newline "\n"
diff -r 8d873f324758 -r d3f8dfde5700 tests/usr.bin/indent/token_comment.c
--- a/tests/usr.bin/indent/token_comment.c      Sun Nov 07 07:35:06 2021 +0000
+++ b/tests/usr.bin/indent/token_comment.c      Sun Nov 07 07:44:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token_comment.c,v 1.18 2021/11/05 19:33:28 rillig Exp $ */
+/* $NetBSD: token_comment.c,v 1.19 2021/11/07 07:45:00 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -954,7 +954,7 @@
  * Test for an edge cases in comment handling, having a block comment inside
  * a line comment. Before NetBSD pr_comment.c 1.96 from 2021-11-04, indent
  * wrongly assumed that the comment would end at the '*' '/', tokenizing the
- * second word 'still' as a type_at_paren_level_0.
+ * second word 'still' as a type_outside_parentheses.
  */
 #indent input
 /* block comment */
diff -r 8d873f324758 -r d3f8dfde5700 usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c   Sun Nov 07 07:35:06 2021 +0000
+++ b/usr.bin/indent/indent.c   Sun Nov 07 07:44:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.c,v 1.211 2021/11/07 07:35:06 rillig Exp $      */
+/*     $NetBSD: indent.c,v 1.212 2021/11/07 07:44:59 rillig Exp $      */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.211 2021/11/07 07:35:06 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.212 2021/11/07 07:44:59 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -1507,7 +1507,7 @@
            if (ps.p_l_follow > 0)
                goto copy_token;
            /* FALLTHROUGH */
-       case lsym_type_at_paren_level_0:
+       case lsym_type_outside_parentheses:
            process_type(&decl_ind, &tabs_to_var);
            goto copy_token;
 
diff -r 8d873f324758 -r d3f8dfde5700 usr.bin/indent/indent.h
--- a/usr.bin/indent/indent.h   Sun Nov 07 07:35:06 2021 +0000
+++ b/usr.bin/indent/indent.h   Sun Nov 07 07:44:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.h,v 1.80 2021/11/07 07:35:06 rillig Exp $       */
+/*     $NetBSD: indent.h,v 1.81 2021/11/07 07:44:59 rillig Exp $       */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -91,7 +91,7 @@
     lsym_semicolon,
     lsym_typedef,
     lsym_storage_class,
-    lsym_type_at_paren_level_0,
+    lsym_type_outside_parentheses,
     lsym_type_in_parentheses,
     lsym_tag,                  /* 'struct', 'union' or 'enum' */
     lsym_case_label,           /* 'case' or 'default' */
diff -r 8d873f324758 -r d3f8dfde5700 usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c     Sun Nov 07 07:35:06 2021 +0000
+++ b/usr.bin/indent/lexi.c     Sun Nov 07 07:44:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lexi.c,v 1.134 2021/11/07 07:35:06 rillig Exp $        */
+/*     $NetBSD: lexi.c,v 1.135 2021/11/07 07:44:59 rillig Exp $        */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.134 2021/11/07 07:35:06 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.135 2021/11/07 07:44:59 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -58,7 +58,7 @@
  * While inside lexi_alnum, this constant just marks a type, independently of
  * the parentheses level.
  */
-#define lsym_type lsym_type_at_paren_level_0
+#define lsym_type lsym_type_outside_parentheses
 
 /* must be sorted alphabetically, is used in binary search */
 static const struct keyword {
@@ -238,7 +238,7 @@
        "semicolon",
        "typedef",
        "storage_class",
-       "type_at_paren_level_0",
+       "type_outside_parentheses",
        "type_in_parentheses",
        "tag",
        "case_label",
@@ -490,7 +490,7 @@
 
     if (ps.prev_token == lsym_tag && ps.p_l_follow == 0) {
        ps.next_unary = true;
-       return lsym_type_at_paren_level_0;
+       return lsym_type_outside_parentheses;
     }
 
     /* Operator after identifier is binary unless last token was 'struct'. */
@@ -521,7 +521,7 @@
            if (kw != NULL && kw->lsym == lsym_tag)
                return lsym_tag;
            if (ps.p_l_follow == 0)
-               return lsym_type_at_paren_level_0;
+               return lsym_type_outside_parentheses;
        }
     }
 
@@ -540,7 +540,7 @@
 
     } else if (probably_typename()) {
        ps.next_unary = true;
-       return lsym_type_at_paren_level_0;
+       return lsym_type_outside_parentheses;
     }
 
     return is_type ? lsym_type_in_parentheses : lsym_word;



Home | Main Index | Thread Index | Old Index