gbranden pushed a commit to branch master
in repository groff.
commit 7340085a3eca610440581390d7bac3ad90b65437
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Dec 25 19:46:47 2025 -0600
src/roff/troff/input.cpp: Improve diagnostic.
* src/roff/troff/input.cpp (do_define_macro): Communicate error to the
user by _describing what happened_, rather than just throwing a noun
phrase at them.
---
ChangeLog | 6 ++++++
src/roff/troff/input.cpp | 6 ++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index aeb3e38cf..7443d85ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-12-25 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (do_define_macro): Improve
+ diagnostic. Communicate error to the user by _describing what
+ happened_, rather than just throwing a noun phrase at them.
+
2025-12-25 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp (do_define_macro): Slightly refactor.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index f469f0cd9..50dcb5290 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5510,13 +5510,15 @@ void do_define_macro(define_mode mode, calling_mode
calling, comp_mode comp)
if ((mode == DEFINE_APPEND) || (mode == DEFINE_NORMAL)) {
if (have_start_location)
error_with_file_and_line(start_filename, start_lineno,
- "end of file while defining macro '%1'",
+ "encountered end of file"
+ " while defining macro '%1'",
nm.contents());
else
error("end of file while defining macro '%1'", nm.contents());
}
else {
- static const char msg[] = "end of file while ignoring input";
+ static const char msg[] = "encountered end of file while"
+ " ignoring input";
if (have_start_location)
error_with_file_and_line(start_filename, start_lineno, msg);
else
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit