groff-commit
[Top][All Lists]
Advanced

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

[groff] 13/38: [troff]: Make ambiguous \s error more helpful.


From: G. Branden Robinson
Subject: [groff] 13/38: [troff]: Make ambiguous \s error more helpful.
Date: Mon, 3 Oct 2022 01:42:56 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 316cfdd2ad3ff37b1c0c7d6af8877467fd0d2b8e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Sep 28 17:19:56 2022 -0500

    [troff]: Make ambiguous \s error more helpful.
    
    * src/roff/troff/input.cpp (read_size): Be more helpful to ambiguous
      type size escape sequence users; offer advice in terms of the current
      escape character.
    
    This only goes so far; if they choose ' as their escape character, they
    might need to do some thinking.
---
 ChangeLog                | 6 ++++++
 src/roff/troff/input.cpp | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 75702ae39..fa561bb46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-28  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (read_size): Be more helpful to
+       ambiguous type size escape sequence users; offer advice in
+       terms of the current escape character.
+
 2022-09-28  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/groff/groff.cpp (main): Fix SEGV when exiting
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 7f0b17095..0597f7ade 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5106,7 +5106,8 @@ static bool read_size(int *x)
       else {
        val = val*10 + (c - '0');
        error("ambiguous type size in escape sequence; rewrite to use"
-             " '\\s(%1' or similar", val);
+             " '%1s(%2' or similar", static_cast<char>(escape_char),
+             val);
       }
     }
     val *= sizescale;



reply via email to

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