gbranden pushed a commit to branch master
in repository groff.

commit d2e5975d27ea2f1c39bddcd5cf2952ffd4ba2039
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
AuthorDate: Sun Mar 2 22:57:37 2025 -0600

    [troff]: Implement recursive node dumping (5b/9).
    
    * src/roff/troff/node.h (class diverted_space_node): Specialize
      (override) `dump_properties()` for this class.
    
    * src/roff/troff/node.cpp (diverted_space_node::dump_properties): New
      member function reports value of `vunits` property.
    
    At present I don't know of a way to get a diverted space node to report
    itself in debugging output; the `pline` request works only on nodes that
    are in a pending output line, and a diverted space node, being a form of
    vertical space (and not "local" vertical motion), exists only between
    output lines.  Nevertheless this plants a tree today whose shade we
    might enjoy later.
---
 ChangeLog               | 8 ++++++++
 src/roff/troff/node.cpp | 7 +++++++
 src/roff/troff/node.h   | 1 +
 3 files changed, 16 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 43b70b7af..e3c46daba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-03-02  G. Branden Robinson <g.branden.robin...@gmail.com>
+
+       * src/roff/troff/node.h (class diverted_space_node): Specialize
+       {override} `dump_properties()` for this class.
+       * src/roff/troff/node.cpp
+       (diverted_space_node::dump_properties): New member function
+       reports value of `vunits` property.
+
 2025-03-02  G. Branden Robinson <g.branden.robin...@gmail.com>
 
        * src/roff/troff/node.h (class space_node): Specialize
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 76ad72331..b50a7095d 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -3393,6 +3393,13 @@ diverted_space_node::diverted_space_node(vunits d, node 
*p)
 {
 }
 
+void diverted_space_node::dump_properties()
+{
+  node::dump_properties();
+  fprintf(stderr, ", \"vunits\": %d", n.to_units());
+  fflush(stderr);
+}
+
 node *diverted_space_node::copy()
 {
   return new diverted_space_node(n, state, div_nest_level);
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index 1cad968cf..7045b4acc 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -292,6 +292,7 @@ public:
   const char *type();
   bool causes_tprint();
   bool is_tag();
+  void dump_properties();
 };
 
 class diverted_copy_file_node : public node {

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

Reply via email to