bug-groff
[Top][All Lists]
Advanced

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

[bug #63149] [troff] confusing diagnostic when delete character in input


From: G. Branden Robinson
Subject: [bug #63149] [troff] confusing diagnostic when delete character in input
Date: Mon, 3 Oct 2022 22:38:03 -0400 (EDT)

Follow-up Comment #1, bug #63149 (project groff):

A token type is not necessary, just a way to encode an input delete character,
much as was done recently for no-break spaces and soft hyphens in commit
f9fb11f662
<https://git.savannah.gnu.org/cgit/groff.git/commit/?id=f9fb11f6625fe859d3f22c5fc6cbd51e19b64ec6>.


ff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 4797a9a55..0005cdaad 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2405,11 +2405,15 @@ const char *token::description()
   case TOKEN_BACKSPACE:
     return "a backspace character";
   case TOKEN_CHAR:
-    buf[0] = '\'';
-    buf[1] = c;
-    buf[2] = '\'';
-    buf[3] = '\0';
-    return buf;
+    if (c == INPUT_DELETE)
+      return "a delete character";
+    else {
+      buf[0] = '\'';
+      buf[1] = c;
+      buf[2] = '\'';
+      buf[3] = '\0';
+      return buf;
+    }
   case TOKEN_DUMMY:
     return "an escaped '&'";
   case TOKEN_ESCAPE:
diff --git a/src/roff/troff/input.h b/src/roff/troff/input.h
index 5b1c88244..e78124f92 100644
--- a/src/roff/troff/input.h
+++ b/src/roff/troff/input.h
@@ -41,6 +41,8 @@ const int ESCAPE_e = 035;
 const int ESCAPE_PERCENT = 036;
 const int ESCAPE_SPACE = 037;
 
+const int INPUT_DELETE = 0177;
+
 const int TITLE_REQUEST = 0200;
 const int COPY_FILE_REQUEST = 0201;
 const int TRANSPARENT_FILE_REQUEST = 0202;
@@ -63,6 +65,8 @@ const int INPUT_SOFT_HYPHEN= 0255;
 
 #else /* IS_EBCDIC_HOST */
 
+const int INPUT_DELETE = 007;
+
 const int ESCAPE_QUESTION = 010;
 const int BEGIN_TRAP = 011;
 const int END_TRAP = 013;



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63149>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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