groff-commit
[Top][All Lists]
Advanced

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

[groff] 06/49: [troff]: Tweak diagnostic messages.


From: G. Branden Robinson
Subject: [groff] 06/49: [troff]: Tweak diagnostic messages.
Date: Sun, 25 Sep 2022 17:02:55 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 8c3bd563856da38363837c4af6b7cc5c118de4ff
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Sep 18 12:54:45 2022 -0500

    [troff]: Tweak diagnostic messages.
    
    * src/roff/troff/input.cpp (non_empty_name_warning): Say "identifier",
      not "name", in diagnostic message; it can be thrown for attempted
      assignments to invalid register identifiers, and some of our
      documentation refers to identifiers in the name space shared by
      requests, macros, strings, and diversions as "names".
    
    * src/roff/troff/env.cpp (hyphen_trie::read_patterns_file):
    * src/roff/troff/input.cpp (get_char_for_escape_parameter)
      (token::usable_as_delimiter, non_empty_name_warning, pipe_source)
      (psbb_locator::psbb_locator, open_request, opena_request)
      (define_class, pipe_output, system_request): Consistently say "_is_
      not allowed".  The zero copula poses too great a risk of
      incomprehension IMO.
---
 ChangeLog                | 19 +++++++++++++++++++
 doc/groff.texi           |  2 +-
 src/roff/troff/env.cpp   |  6 +++---
 src/roff/troff/input.cpp | 24 +++++++++++++-----------
 4 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1af112940..b72ec4100 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2022-09-18  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [troff]: Tweak diagnostic messages.
+
+       * src/roff/troff/input.cpp (non_empty_name_warning): Say
+       "identifier", not "name", in diagnostic message; it can be
+       thrown for attempted assignments to invalid register
+       identifiers, and some of our documentation refers to identifiers
+       in the name space shared by requests, macros, strings, and
+       diversions as "names".
+
+       * src/roff/troff/env.cpp (hyphen_trie::read_patterns_file):
+       * src/roff/troff/input.cpp (get_char_for_escape_parameter)
+       (token::usable_as_delimiter, non_empty_name_warning)
+       (pipe_source, psbb_locator::psbb_locator, open_request)
+       (opena_request, define_class, pipe_output, system_request):
+       Consistently say "_is_ not allowed".  The zero copula poses too
+       great a risk of incomprehension IMO.
+
 2022-09-15  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [mdoc]: Add internal string `doc-Lk-font` to manage the typeface
diff --git a/doc/groff.texi b/doc/groff.texi
index 1f37a56e2..94868728f 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -6271,7 +6271,7 @@ Some care is required with identifiers starting with 
@samp{(} or
 .nr (x 2
 .nr [y 3
 .nr sum1 (\n(x + \n[y])
-    @error{} space character not allowed in escape
+    @error{} a space character is not allowed in an escape
     @error{}   sequence parameter
 A:2+3=\n[sum1]
 .nr sum2 (\n((x + \n[[y])
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 3e49a36da..1b5f06d80 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3911,7 +3911,7 @@ void hyphen_trie::read_patterns_file(const char *name, 
int append,
          c = hpf_getc(fp);
        if (c == '{') {
          if (have_patterns || have_hyphenation)
-           error("\\patterns not allowed inside of %1 group",
+           error("\\patterns is not allowed inside of %1 group",
                  have_patterns ? "\\patterns" : "\\hyphenation");
          else {
            have_patterns = 1;
@@ -3926,7 +3926,7 @@ void hyphen_trie::read_patterns_file(const char *name, 
int append,
          c = hpf_getc(fp);
        if (c == '{') {
          if (have_patterns || have_hyphenation)
-           error("\\hyphenation not allowed inside of %1 group",
+           error("\\hyphenation is not allowed inside of %1 group",
                  have_patterns ? "\\patterns" : "\\hyphenation");
          else {
            have_hyphenation = 1;
@@ -3957,7 +3957,7 @@ void hyphen_trie::read_patterns_file(const char *name, 
int append,
       }
       else if (c == '{') {
        if (have_patterns || have_hyphenation)
-         error("'{' not allowed within %1 group",
+         error("'{' is not allowed within %1 group",
                have_patterns ? "\\patterns" : "\\hyphenation");
        c = hpf_getc(fp);               // skipped if not starting \patterns
                                        // or \hyphenation
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index a02ba568b..3c6c39e37 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -837,7 +837,7 @@ static char get_char_for_escape_parameter(bool allow_space 
= false)
   case '\t':
   case '\001':
   case '\b':
-    copy_mode_error("%1 not allowed in escape sequence parameter",
+    copy_mode_error("%1 is not allowed in an escape sequence parameter",
                    input_char_description(c));
     return '\0';
   }
@@ -2369,7 +2369,7 @@ bool token::usable_as_delimiter(bool report_error)
     case ')':
     case '.':
       if (report_error)
-        error("character '%1' not allowed as starting delimiter",
+        error("character '%1' is not allowed as a starting delimiter",
              char(c));
       return false;
     default:
@@ -2387,7 +2387,7 @@ bool token::usable_as_delimiter(bool report_error)
   case TOKEN_TAB:
   case TOKEN_NEWLINE:
     if (report_error)
-      error("%1 not allowed as starting delimiter", description());
+      error("%1 is not allowed as a starting delimiter", description());
     return false;
   default:
     return true;
@@ -2507,7 +2507,7 @@ static void non_empty_name_warning()
       && !tok.is_tab() && !tok.is_right_brace()
       // We don't want to give a warning for .el\{
       && !tok.is_left_brace())
-    error("%1 not allowed in a name", tok.description());
+    error("%1 is not allowed in an identifier", tok.description());
 }
 
 symbol get_name(bool required)
@@ -6047,7 +6047,7 @@ void source_quietly()
 void pipe_source()
 {
   if (!unsafe_flag) {
-    error("'pso' request not allowed in safer mode");
+    error("'pso' request is not allowed in safer mode");
     skip_line();
   }
   else {
@@ -6229,7 +6229,8 @@ filename(fname), llx(0), lly(0), urx(0), ury(0), 
lastc(EOF)
                  // ...we must ensure it is not a further attempt to defer
                  // assignment to a trailer, (which we are already parsing).
                  //
-                 error("'(atend)' not allowed in trailer of '%1'", filename);
+                 error("'(atend)' is not allowed in trailer of '%1'",
+                       filename);
              }
            }
            else
@@ -6800,7 +6801,7 @@ void do_open(int append)
 void open_request()
 {
   if (!unsafe_flag) {
-    error("'open' request not allowed in safer mode");
+    error("'open' request is not allowed in safer mode");
     skip_line();
   }
   else
@@ -6810,7 +6811,7 @@ void open_request()
 void opena_request()
 {
   if (!unsafe_flag) {
-    error("'opena' request not allowed in safer mode");
+    error("'opena' request is not allowed in safer mode");
     skip_line();
   }
   else
@@ -7147,7 +7148,8 @@ void define_class()
       }
       if (child1->is_class() || child2->is_class()) {
        warning(WARN_SYNTAX,
-               "nested character class is not allowed in range definition");
+               "a nested character class is not allowed in a range"
+               " definition");
        skip_line();
        return;
       }
@@ -7607,7 +7609,7 @@ char *read_string()
 void pipe_output()
 {
   if (!unsafe_flag) {
-    error("'pi' request not allowed in safer mode");
+    error("'pi' request is not allowed in safer mode");
     skip_line();
   }
   else {
@@ -7644,7 +7646,7 @@ static int system_status;
 void system_request()
 {
   if (!unsafe_flag) {
-    error("'sy' request not allowed in safer mode");
+    error("'sy' request is not allowed in safer mode");
     skip_line();
   }
   else {



reply via email to

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