gbranden pushed a commit to branch master
in repository groff.

commit 7a91d64cc42f187e99c5f23769614ad9e76f3be4
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
AuthorDate: Thu Sep 11 12:47:41 2025 -0500

    [troff]: Refactor (3/3).
    
    Explicitly "asciify" hyphen inhibitor nodes as nothing.  These
    correspond to the `\%` escape sequence at the beginning of a word.
    
    * src/roff/troff/input.cpp (class hyphen_inhibitor_node): Declare
      `asciify` member function, thus overriding base class.
    
      (hyphen_inhibitor_node::asciify): Delete the `this` object and return.
---
 ChangeLog               | 11 +++++++++++
 src/roff/troff/node.cpp |  6 ++++++
 2 files changed, 17 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 1458eca71..96c429231 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-09-11  G. Branden Robinson <g.branden.robin...@gmail.com>
+
+       [troff]: Refactor.  Explicitly "asciify" hyphen inhibitor nodes
+       as nothing.  These correspond to the `\%` escape sequence at the
+       beginning of a word.
+
+       * src/roff/troff/input.cpp (class hyphen_inhibitor_node):
+       Declare `asciify` member function, thus overriding base class.
+       (hyphen_inhibitor_node::asciify): Delete the `this` object and
+       return.
+
 2025-09-11  G. Branden Robinson <g.branden.robin...@gmail.com>
 
        [troff]: Refactor.  Explicitly "asciify" non-interpreted `char`
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index d3ade0bf6..9a8ebb3bc 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -2591,6 +2591,7 @@ hyphen_list *kern_pair_node::get_hyphen_list(hyphen_list 
*tail,
 class hyphen_inhibitor_node : public node {
 public:
   hyphen_inhibitor_node(node * = 0 /* nullptr */);
+  void asciify(macro *);
   node *copy();
   bool causes_tprint();
   bool is_tag();
@@ -4049,6 +4050,11 @@ void vmotion_node::asciify(macro *)
   delete this;
 }
 
+void hyphen_inhibitor_node::asciify(macro *)
+{
+  delete this;
+}
+
 breakpoint *node::get_breakpoints(hunits /* width */, int /* nspaces */,
                                  breakpoint *rest, bool /* is_inner */)
 {

_______________________________________________
groff-commit mailing list
groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to