gbranden pushed a commit to branch master
in repository groff.
commit 9cc5fd03aceb797fe1358c85aa78a0e3d6409cd5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Sep 11 12:41:45 2025 -0500
[troff]: Refactor (2/3).
Explicitly "asciify" non-interpreted `char` nodes as nothing. These
correspond to the `\a` and `\t` escape sequences.
* src/roff/troff/input.cpp (class non_interpreted_char_node): Declare
`asciify` member function, thus overriding base class.
(non_interpreted_char_node::asciify): Delete the `this` object and
return.
---
ChangeLog | 11 +++++++++++
src/roff/troff/input.cpp | 6 ++++++
2 files changed, 17 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 342f81a45..1458eca71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-09-11 G. Branden Robinson <[email protected]>
+
+ [troff]: Refactor. Explicitly "asciify" non-interpreted `char`
+ nodes as nothing. These correspond to the `\a` and `\t` escape
+ sequences.
+
+ * src/roff/troff/input.cpp (class non_interpreted_char_node):
+ Declare `asciify` member function, thus overriding base class.
+ (non_interpreted_char_node::asciify): Delete the `this` object
+ and return.
+
2025-09-11 G. Branden Robinson <[email protected]>
[troff]: Refactor. Explicitly "asciify" non-interpreted nodes
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index f08836782..568dac9c8 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1290,6 +1290,7 @@ class non_interpreted_char_node : public node {
unsigned char c;
public:
non_interpreted_char_node(unsigned char);
+ void asciify(macro *);
node *copy();
bool interpret(macro *);
bool is_same_as(node *);
@@ -1323,6 +1324,11 @@
non_interpreted_char_node::non_interpreted_char_node(unsigned char cc) : c(cc)
assert(cc != 0);
}
+void non_interpreted_char_node::asciify(macro *)
+{
+ delete this;
+}
+
node *non_interpreted_char_node::copy()
{
return new non_interpreted_char_node(c);
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit