groff-commit
[Top][All Lists]
Advanced

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

[groff] 11/12: [troff]: Revise `\s` diagnostic message wording.


From: G. Branden Robinson
Subject: [groff] 11/12: [troff]: Revise `\s` diagnostic message wording.
Date: Sat, 20 Nov 2021 05:19:14 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit dc3fc8d401bbbe3c9e0a84e0acd74150be9184cd
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Nov 20 09:31:59 2021 +1100

    [troff]: Revise `\s` diagnostic message wording.
    
    * src/roff/troff/input.cpp (read_size): Update diagnostic messages to
      use more normative language: say "type size" instead of "point-size",
      and "escape sequence" instead of "escape".
    
    * src/roff/groff/tests/use_point_size_escape_with_single_digit_arg.sh:
      Update expected diagnostic wording in text.
---
 ChangeLog                                                |  9 +++++++++
 .../tests/use_point_size_escape_with_single_digit_arg.sh |  2 +-
 src/roff/troff/input.cpp                                 | 16 ++++++++--------
 3 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index edddf3c..e49cde3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2021-11-20  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * src/roff/troff/input.cpp (read_size): Update diagnostic
+       messages to use more normative language: say "type size" instead
+       of "point-size", and "escape sequence" instead of "escape".
+       * src/roff/groff/tests/\
+       use_point_size_escape_with_single_digit_arg.sh: Update expected
+       diagnostic wording in text.
+
+2021-11-20  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * src/roff/troff/input.cpp (read_size): Boolify.  Update
        prototype.  Demote return type from `int` to `bool`.  Use
        Boolean literals for return values.  Similarly demote local
diff --git 
a/src/roff/groff/tests/use_point_size_escape_with_single_digit_arg.sh 
b/src/roff/groff/tests/use_point_size_escape_with_single_digit_arg.sh
index b596388..74efaac 100755
--- a/src/roff/groff/tests/use_point_size_escape_with_single_digit_arg.sh
+++ b/src/roff/groff/tests/use_point_size_escape_with_single_digit_arg.sh
@@ -41,4 +41,4 @@ echo "$DOC" | "$groff" -Z | grep -qx 's3000'
 # Check that we get a diagnostic when relying on the ambiguous form.
 echo "testing for diagnostic on \s36 in compatiblity mode" >&2
 echo "$DOC" | "$groff" -C -Z 2>&1 >/dev/null \
-    | grep -q 'ambiguous point-size escape'
+    | grep -q 'ambiguous type size in escape sequence'
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index e8b726f..e0eb329 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5088,8 +5088,8 @@ static bool read_size(int *x)
        contains_invalid_digit = true;
       else {
        val = val*10 + (c - '0');
-       error("ambiguous point-size escape; rewrite to use '\\s(%1'"
-             " or similar", val);
+       error("ambiguous type size in escape sequence; rewrite to use"
+             " '\\s(%1' or similar", val);
       }
     }
     val *= sizescale;
@@ -5108,18 +5108,18 @@ static bool read_size(int *x)
       return false;
     if (!(start.ch() == '[' && tok.ch() == ']') && start != tok) {
       if (start.ch() == '[')
-       error("missing ']' in point-size escape");
+       error("missing ']' in type size escape sequence");
       else
-       error("missing closing delimiter in point-size escape");
+       error("missing closing delimiter in type size escape sequence");
       return false;
     }
   }
   if (contains_invalid_digit) {
     if (c)
-      error("bad digit in point-size escape: %1",
+      error("invalid digit in type size escape sequence: %1",
            input_char_description(c));
     else
-      error("bad digit in point-size escape");
+      error("invalid digit in type size escape sequence");
     return false;
   }
   else {
@@ -5143,8 +5143,8 @@ static bool read_size(int *x)
     }
     if (*x <= 0) {
       warning(WARN_RANGE,
-             "point-size escape results in non-positive size %1u;"
-             " set to 1u", *x);
+             "type size escape sequence results in non-positive size"
+             " %1u; setting it to 1u", *x);
       *x = 1;
     }
     return true;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]