groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 39/46: [tbl]: Write comments to generated output.


From: G. Branden Robinson
Subject: [groff] 39/46: [tbl]: Write comments to generated output.
Date: Wed, 7 Dec 2022 04:32:37 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 5b41eb3f24fb9671c5428686261a78df4ed4599b
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Dec 6 23:25:46 2022 -0600

    [tbl]: Write comments to generated output.
    
    * src/preproc/tbl/table.cpp: Write comments to generated output; these
      correspond to functions in this file and to major operations of table
      construction.
    
      (init_output, compute_widths, define_bottom_macro, do_row, do_top)
      (do_bottom): Do it.
    
    This change "bloats" tbl(1) output by 103 bytes or 2.84% for the most
    trivial possible table, shown below.  The percentage will decline for
    tables with more entries and/or are boxed.
    
    .TS
    L.
    Z
    .TE
---
 ChangeLog                 | 8 ++++++++
 src/preproc/tbl/table.cpp | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 31540aefa..f857b9c26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-12-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/preproc/tbl/table.cpp: Write comments to generated output;
+       these correspond to functions in this file and to major
+       operations of table construction.
+       (init_output, compute_widths, define_bottom_macro, do_row)
+       (do_top, do_bottom): Do it.
+
 2022-12-05  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [troff]: Trivially refactor.  Rename class `constant_int_reg` to
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index edab0a5c3..e1c8dbd59 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -1765,6 +1765,7 @@ int table::count_expand_columns()
 
 void table::init_output()
 {
+  prints(".\\\" initialize output\n");
   prints(".nr " COMPATIBLE_REG " \\n(.C\n"
         ".cp 0\n");
   if (linesize > 0)
@@ -2320,6 +2321,7 @@ void table::make_columns_equal()
 
 void table::compute_widths()
 {
+  prints(".\\\" compute widths\n");
   build_span_list();
   int i;
   horizontal_span *p;
@@ -2689,6 +2691,7 @@ void table::build_vrule_list()
 
 void table::define_bottom_macro()
 {
+  prints(".\\\" define bottom macro\n");
   prints(".eo\n"
         // protect # in macro name against eqn
         ".ig\n"
@@ -2769,6 +2772,7 @@ int table::row_ends_section(int r)
 
 void table::do_row(int r)
 {
+  printfs(".\\\" do row %1\n", i_to_a(r));
   if (!(flags & NOKEEP) && row_begins_section(r))
     prints(".if \\n[" USE_KEEPS_REG "] ." KEEP_MACRO_NAME "\n");
   int had_line = 0;
@@ -2935,6 +2939,7 @@ void table::do_row(int r)
 
 void table::do_top()
 {
+  prints(".\\\" do top\n");
   prints(".ss \\n[" SAVED_INTER_WORD_SPACE_SIZE "]\n");
   prints(".fc \002\003\n");
   if (!(flags & NOKEEP) && (flags & (BOX | DOUBLEBOX | ALLBOX)))
@@ -2971,6 +2976,7 @@ void table::do_top()
 
 void table::do_bottom()
 {
+  prints(".\\\" do bottom\n");
   // print stuff after last row
   for (stuff *p = stuff_list; p; p = p->next)
     if (p->row > nrows - 1)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]