gbranden pushed a commit to branch master in repository groff. commit 39e5cf5a5d0195f9fba6f0ddc8326f5b37181235 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Thu Sep 11 12:16:15 2025 -0500
[troff]: Refactor (1/3). Explicitly "asciify" non-interpreted nodes as nothing. These correspond to what is bracketed by `\?` escape sequences. * src/roff/troff/input.cpp (class non_interpreted_node): Declare `asciify` member function, thus overriding base class. (non_interpreted_node::asciify): Delete the `this` object and return. This prepares to make the `node` class's `asciify()` member function pure virtual. --- ChangeLog | 11 +++++++++++ src/roff/troff/input.cpp | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index b609f8eb9..342f81a45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2025-09-11 G. Branden Robinson <g.branden.robin...@gmail.com> + + [troff]: Refactor. Explicitly "asciify" non-interpreted nodes + as nothing. These correspond to what is bracketed by `\?` + escape sequences. + + * src/roff/troff/input.cpp (class non_interpreted_node): Declare + `asciify` member function, thus overriding base class. + (non_interpreted_node::asciify): Delete the `this` object and + return. + 2025-09-11 G. Branden Robinson <g.branden.robin...@gmail.com> * src/roff/groff/tests/asciify-request-works.sh: Add test case diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index ce67bc7e1..f08836782 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -6013,6 +6013,7 @@ class non_interpreted_node : public node { public: non_interpreted_node(const macro &); bool interpret(macro *); + void asciify(macro *); node *copy(); int ends_sentence(); bool is_same_as(node *); @@ -6050,6 +6051,11 @@ bool non_interpreted_node::is_tag() return false; } +void non_interpreted_node::asciify(macro *) +{ + delete this; +} + node *non_interpreted_node::copy() { return new non_interpreted_node(mac); _______________________________________________ groff-commit mailing list groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit