gbranden pushed a commit to branch master
in repository groff.
commit 848accaae6f2526148004c36b74030acdfdfdc65
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Nov 20 01:24:06 2025 -0600
src/roff/troff/input.cpp: Simplify logic (1/2).
* src/roff/troff/input.cpp (print_character_request, remove_character):
`token::description()` describes indexed characters adequately.
---
ChangeLog | 6 ++++++
src/roff/troff/input.cpp | 24 +++++-------------------
2 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1371973d5..464dddba8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-11-20 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (print_character_request)
+ (remove_character): Simplify logic. `token::description()`
+ describes indexed characters adequately.
+
2025-11-19 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp (add_hyphenation_exceptions): Fix code
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index d16616ddf..80571b455 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5025,19 +5025,10 @@ static void print_character_request()
" classes as arguments; got %1", tok.description());
break;
}
- if (0 /* nullptr */ == ci) {
- if (!tok.is_indexed_character())
- warning(WARN_CHAR, "%1 is not defined", tok.description());
- else
- warning(WARN_CHAR, "character with index %1 in the current font"
- " is not defined", tok.character_index());
- }
+ if (0 /* nullptr */ == ci)
+ warning(WARN_CHAR, "%1 is not defined", tok.description());
else {
- if (tok.is_indexed_character())
- errprint("character indexed %1 in current font\n",
- tok.character_index());
- else
- errprint("%1\n", tok.description());
+ errprint("%1\n", tok.description());
fflush(stderr);
ci->dump();
}
@@ -5059,13 +5050,8 @@ static void remove_character()
if (tok.is_character()) {
charinfo *ci = tok.get_charinfo(true /* required */,
true /* suppress creation */);
- if (0 /* nullptr */ == ci) {
- if (!tok.is_indexed_character())
- warning(WARN_CHAR, "%1 is not defined", tok.description());
- else
- warning(WARN_CHAR, "character with index %1 in the current"
- " font is not defined", tok.character_index());
- }
+ if (0 /* nullptr */ == ci)
+ warning(WARN_CHAR, "%1 is not defined", tok.description());
else {
macro *m = ci->set_macro(0 /* nullptr */);
if (m != 0 /* nullptr */)
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit