gbranden pushed a commit to branch master
in repository groff.

commit 4d7ff76843e8deafb40eac5d13944e2805253d92
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
AuthorDate: Mon Mar 3 02:00:47 2025 -0600

    [troff]: Implement recursive node dumping (5e/9).
    
    * src/roff/troff/node.h (class vertical_size_node): Specialize
      (override) `dump_properties()` for this class.
    
    * src/roff/troff/node.cpp (vertical_size_node::dump_properties): New
      member function reports value of `vunits` property.
    
    At present I don't know of a way to get a vertical size node to report
    itself in debugging output; the `pline` request works only on nodes that
    are in a pending output line, and nodes of this type are added only to a
    `macro_diversion` object, not an output line node list.  Nevertheless
    this plants a tree today whose shade we might enjoy later.
---
 ChangeLog               | 7 +++++++
 src/roff/troff/node.cpp | 7 +++++++
 src/roff/troff/node.h   | 1 +
 3 files changed, 15 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 6c38da087..708c2572a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-03-03  G. Branden Robinson <g.branden.robin...@gmail.com>
+
+       * src/roff/troff/node.h (class vertical_size_node): Specialize
+       {override} `dump_properties()` for this class.
+       * src/roff/troff/node.cpp (vertical_size_node::dump_properties):
+       New member function reports value of `vunits` property.
+
 2025-03-03  G. Branden Robinson <g.branden.robin...@gmail.com>
 
        * src/roff/troff/node.h (class extra_size_node): Specialize
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 635195011..4a3e77b84 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -3037,6 +3037,13 @@ vertical_size_node::vertical_size_node(vunits i)
 {
 }
 
+void vertical_size_node::dump_properties()
+{
+  node::dump_properties();
+  fprintf(stderr, ", \"vunits\": %d", n.to_units());
+  fflush(stderr);
+}
+
 node *hmotion_node::copy()
 {
   return new hmotion_node(n, was_tab, unformat, col, state, div_nest_level);
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index aa0293145..0a0a35f00 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -338,6 +338,7 @@ public:
   const char *type();
   bool causes_tprint();
   bool is_tag();
+  void dump_properties();
 };
 
 class hmotion_node : public node {

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

Reply via email to