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: spell 'parentheses' properly in messa...



details:   https://anonhg.NetBSD.org/src/rev/1e2a8e14ce82
branches:  trunk
changeset: 990509:1e2a8e14ce82
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 29 16:54:51 2021 +0000

description:
indent: spell 'parentheses' properly in messages and comments

diffstat:

 tests/usr.bin/indent/t_errors.sh    |  12 ++++++------
 tests/usr.bin/indent/t_misc.sh      |   4 ++--
 tests/usr.bin/indent/token_lparen.c |   4 ++--
 usr.bin/indent/indent.c             |  18 +++++++++---------
 usr.bin/indent/indent.h             |  15 ++++++++-------
 usr.bin/indent/lexi.c               |   6 +++---
 6 files changed, 30 insertions(+), 29 deletions(-)

diffs (210 lines):

diff -r e0c133bec391 -r 1e2a8e14ce82 tests/usr.bin/indent/t_errors.sh
--- a/tests/usr.bin/indent/t_errors.sh  Fri Oct 29 16:49:46 2021 +0000
+++ b/tests/usr.bin/indent/t_errors.sh  Fri Oct 29 16:54:51 2021 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_errors.sh,v 1.10 2021/10/29 16:49:46 rillig Exp $
+# $NetBSD: t_errors.sh,v 1.11 2021/10/29 16:54:51 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -358,8 +358,8 @@
                ;
        EOF
        cat <<-\EOF > stderr.exp
-               error: code.c:3: Unbalanced parens
-               warning: code.c:4: Extra )
+               error: code.c:3: Unbalanced parentheses
+               warning: code.c:4: Extra ')'
        EOF
 
        atf_check -s 'exit:1' -e 'file:stderr.exp' \
@@ -380,8 +380,8 @@
                ;
        EOF
        cat <<-\EOF > stderr.exp
-               error: code.c:3: Unbalanced parens
-               warning: code.c:6: Extra )
+               error: code.c:3: Unbalanced parentheses
+               warning: code.c:6: Extra ')'
        EOF
 
        atf_check -s 'exit:1' -e 'file:stderr.exp' \
@@ -400,7 +400,7 @@
                ;
        EOF
        cat <<-\EOF > stderr.exp
-               error: code.c:4: Unbalanced parens
+               error: code.c:4: Unbalanced parentheses
                error: code.c:4: Statement nesting error
        EOF
 
diff -r e0c133bec391 -r 1e2a8e14ce82 tests/usr.bin/indent/t_misc.sh
--- a/tests/usr.bin/indent/t_misc.sh    Fri Oct 29 16:49:46 2021 +0000
+++ b/tests/usr.bin/indent/t_misc.sh    Fri Oct 29 16:54:51 2021 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_misc.sh,v 1.9 2021/10/28 21:02:05 rillig Exp $
+# $NetBSD: t_misc.sh,v 1.10 2021/10/29 16:54:51 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -316,7 +316,7 @@
        EOF
 
        cat <<-\EOF > code.err
-               warning: code.c:3: Extra )
+               warning: code.c:3: Extra ')'
        EOF
 
        atf_check -o 'ignore' -e 'file:code.err' \
diff -r e0c133bec391 -r 1e2a8e14ce82 tests/usr.bin/indent/token_lparen.c
--- a/tests/usr.bin/indent/token_lparen.c       Fri Oct 29 16:49:46 2021 +0000
+++ b/tests/usr.bin/indent/token_lparen.c       Fri Oct 29 16:54:51 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token_lparen.c,v 1.7 2021/10/25 20:16:16 rillig Exp $ */
+/* $NetBSD: token_lparen.c,v 1.8 2021/10/29 16:54:51 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -52,7 +52,7 @@
 
     /* GCC statement expression */
     /* expr = ({if(expr)debug();expr;}); */
-/* $ XXX: Generates wrong 'error: Standard Input:36: Unbalanced parens'. */
+/* $ XXX: Generates 'error: Standard Input:36: Unbalanced parentheses'. */
 }
 #indent end
 
diff -r e0c133bec391 -r 1e2a8e14ce82 usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c   Fri Oct 29 16:49:46 2021 +0000
+++ b/usr.bin/indent/indent.c   Fri Oct 29 16:54:51 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.c,v 1.167 2021/10/28 22:20:08 rillig Exp $      */
+/*     $NetBSD: indent.c,v 1.168 2021/10/29 16:54:51 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.167 2021/10/28 22:20:08 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.168 2021/10/29 16:54:51 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -722,7 +722,7 @@
 process_lparen_or_lbracket(int decl_ind, bool tabs_to_var, bool spaced_expr)
 {
     if (++ps.p_l_follow == array_length(ps.paren_indents)) {
-       diag(0, "Reached internal limit of %zu unclosed parens",
+       diag(0, "Reached internal limit of %zu unclosed parentheses",
            array_length(ps.paren_indents));
        ps.p_l_follow--;
     }
@@ -776,7 +776,7 @@
 
     if (--ps.p_l_follow < 0) {
        ps.p_l_follow = 0;
-       diag(0, "Extra %c", *token.s);
+       diag(0, "Extra '%c'", *token.s);
     }
 
     if (code.e == code.s)      /* if the paren starts the line */
@@ -903,10 +903,10 @@
     if ((!*spaced_expr || hd != hd_for) && ps.p_l_follow > 0) {
 
        /*
-        * There were unbalanced parens in the statement. It is a bit
+        * There were unbalanced parentheses in the statement. It is a bit
         * complicated, because the semicolon might be in a for statement.
         */
-       diag(1, "Unbalanced parens");
+       diag(1, "Unbalanced parentheses");
        ps.p_l_follow = 0;
        if (*spaced_expr) {     /* 'if', 'while', etc. */
            *spaced_expr = false;
@@ -956,8 +956,8 @@
     if (ps.in_parameter_declaration)
        blank_line_before = false;
 
-    if (ps.p_l_follow > 0) {   /* check for preceding unbalanced parens */
-       diag(1, "Unbalanced parens");
+    if (ps.p_l_follow > 0) {
+       diag(1, "Unbalanced parentheses");
        ps.p_l_follow = 0;
        if (*spaced_expr) {     /* check for unclosed 'if', 'for', etc. */
            *spaced_expr = false;
@@ -1003,7 +1003,7 @@
     }
 
     if (ps.p_l_follow != 0) {  /* check for unclosed if, for, else. */
-       diag(1, "Unbalanced parens");
+       diag(1, "Unbalanced parentheses");
        ps.p_l_follow = 0;
        *spaced_expr = false;
     }
diff -r e0c133bec391 -r 1e2a8e14ce82 usr.bin/indent/indent.h
--- a/usr.bin/indent/indent.h   Fri Oct 29 16:49:46 2021 +0000
+++ b/usr.bin/indent/indent.h   Fri Oct 29 16:54:51 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.h,v 1.55 2021/10/28 22:20:08 rillig Exp $       */
+/*     $NetBSD: indent.h,v 1.56 2021/10/29 16:54:51 rillig Exp $       */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -261,8 +261,8 @@
 extern int blank_lines_to_output;
 extern bool blank_line_before;
 extern bool blank_line_after;
-extern bool break_comma;       /* when true and not in parens, break after a
-                                * comma */
+extern bool break_comma;       /* when true and not in parentheses, break
+                                * after a comma */
 extern float case_ind;         /* indentation level to be used for a "case
                                 * n:" */
 extern bool had_eof;           /* whether input is exhausted */
@@ -286,10 +286,11 @@
                                 * before the start of a box comment so that
                                 * forthcoming lines of the comment are
                                 * indented properly */
-    int cast_mask;             /* indicates which close parens potentially
-                                * close off casts */
-    int not_cast_mask;         /* indicates which close parens definitely
-                                * close off something else than casts */
+    int cast_mask;             /* indicates which close parentheses
+                                * potentially close off casts */
+    int not_cast_mask;         /* indicates which close parentheses
+                                * definitely close off something else than
+                                * casts */
     bool block_init;           /* whether inside a block initialization */
     int block_init_level;      /* The level of brace nesting in an
                                 * initialization */
diff -r e0c133bec391 -r 1e2a8e14ce82 usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c     Fri Oct 29 16:49:46 2021 +0000
+++ b/usr.bin/indent/lexi.c     Fri Oct 29 16:54:51 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lexi.c,v 1.107 2021/10/28 22:06:23 rillig Exp $        */
+/*     $NetBSD: lexi.c,v 1.108 2021/10/29 16:54:51 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.107 2021/10/28 22:06:23 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.108 2021/10/29 16:54:51 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -488,7 +488,7 @@
        case kw_type:
     found_typename:
            if (ps.p_l_follow != 0) {
-               /* inside parens: cast, param list, offsetof or sizeof */
+               /* inside parentheses: cast, param list, offsetof or sizeof */
                ps.cast_mask |= (1 << ps.p_l_follow) & ~ps.not_cast_mask;
            }
            if (ps.last_token == lsym_period ||



Home | Main Index | Thread Index | Old Index