gbranden pushed a commit to branch master
in repository groff.

commit b560e97104b09be669c4639b9715962517cefda8
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Aug 20 08:59:22 2024 -0500

    [troff]: Adjust error diagnostic wording.
    
    * src/roff/troff/input.cpp: Adjust and parallelize diagnostic message
      language.
    
      (get_char_for_escape_parameter): Say "argument", not "parameter".
    
      (do_zero_width_output): Identify the invalid token.
    
      (do_zero_width_output, charinfo_to_node_list): Characterize invalid
      token more precisely as part of the escape sequence's _argument_.
---
 ChangeLog                | 11 +++++++++++
 src/roff/troff/input.cpp |  9 ++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2583439b9..260796d8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-08-20  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp: Adjust and parallelize diagnostic
+       message language.
+       (get_char_for_escape_parameter): Say "argument", not
+       "parameter".
+       (do_zero_width_output): Identify the invalid token.
+       (do_zero_width_output, charinfo_to_node_list): Characterize
+       invalid token more precisely as part of the escape sequence's
+       _argument_.
+
 2024-08-20  G. Branden Robinson <[email protected]>
 
        * NEWS: Add items for Deri's just-committed new features.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index ddc8c8e00..224286d43 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -945,7 +945,7 @@ static char get_char_for_escape_parameter(bool allow_space 
= false)
   case '\t':
   case '\001':
   case '\b':
-    copy_mode_error("%1 is not allowed in an escape sequence parameter",
+    copy_mode_error("%1 is not allowed in an escape sequence argument",
                    input_char_description(c));
     return '\0';
   }
@@ -1781,10 +1781,9 @@ static node *do_zero_width_output() // \Z
        && (want_att_compat || input_stack::get_level() == start_level))
       break;
     // XXX: does the initial dummy node leak if this fails?
-    // TODO: Say something better than "token" in the diagnostic.
     if (!tok.add_to_zero_width_node_list(&rev))
-      error("invalid token in argument to zero-width output escape"
-           " sequence");
+      error("%1 is not allowed in a zero-width output escape"
+           " sequence argument", tok.description());
   }
   while (rev != 0 /* nullptr */) {
     node *tem = rev;
@@ -8907,7 +8906,7 @@ node *charinfo_to_node_list(charinfo *ci, const 
environment *envp)
       break;
     if (tok.is_newline()) {
       error("a newline is not allowed in a composite character"
-           " escape sequence");
+           " escape sequence argument");
       while (!tok.is_eof())
        tok.next();
       break;

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to