gbranden pushed a commit to branch master
in repository groff.

commit eb4f8994b0bc2d9659e71f989c180f99d5fca540
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Mar 20 17:20:14 2026 -0500

    src/roff/troff/input.cpp: Drop error diagnostic.
    
    ...that was "impossible".
    
    * src/roff/troff/input.cpp (chop_macro): Drop error diagnostic that was
      thrown only in the event of an internal logic error.  An assert(3)ion
      now handles that, and in an `NDEBUG` build the formatter can safely
      proceed.
---
 ChangeLog                |  7 +++++++
 src/roff/troff/input.cpp | 12 ++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c0f52d2a7..796b2720f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-03-20  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (chop_macro): Drop error diagnostic
+       that was thrown only in the event of an internal logic error.
+       An assert(3)ion now handles that, and in an `NDEBUG` build the
+       formatter can safely proceed.
+
 2026-03-20  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (chop_macro): Add assert(3)ion to
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 7c440a839..691f52736 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5721,14 +5721,10 @@ void chop_macro()
       }
       assert(m->len != 0);
       // TODO: If it's empty, do nothing, quietly?
-      if (m->len == 0)
-       error("cannot chop empty object '%1'", s.contents());
-      else {
-       if (contains_mode_tokens)
-         m->set(POP_GROFFCOMP_MODE, m->len - 1);
-       else
-         m->len -= 1;
-      }
+      if (contains_mode_tokens)
+       m->set(POP_GROFFCOMP_MODE, m->len - 1);
+      else
+       m->len -= 1;
     }
   }
   skip_line();

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

Reply via email to