groff-commit
[Top][All Lists]
Advanced

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

[groff] 73/78: [tbl]: Trivially refactor ("line" -> "rule").


From: G. Branden Robinson
Subject: [groff] 73/78: [tbl]: Trivially refactor ("line" -> "rule").
Date: Fri, 7 Apr 2023 12:18:00 -0400 (EDT)

gbranden pushed a commit to branch branden-2023-04-07
in repository groff.

commit b7de5a0d286af2047236edbba972332bbeb56527
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Feb 4 01:20:08 2023 -0600

    [tbl]: Trivially refactor ("line" -> "rule").
    
    [tbl]: Trivially refactor.  Rename variables and functions to
    use the term "rule" rather than "line".  The value of the term
    "rule" is that it is not confusable with "lines" of (text) input
    or output.
    
    * src/preproc/tbl/main.cpp
      (struct format) <vline>:
      (format::format) <vline>:
      (format::add_rows) <old_vline, vline>:
      (format::~format) <vline>:
      (struct input_entry_format) <vline, vline_count>:
      (input_entry_format::input_entry_format) <vline, vline_count>:
      (input_entry_format::debug_print) <vline, vline_count>:
      (process_format) <vline_count>:
      (process_data) ([anonymous] enum) <SINGLE_HLINE, DOUBLE_HLINE>:
    * src/preproc/tbl/table.cpp:
    * src/preproc/tbl/table.h
      (enum format_type) <FORMAT_HLINE, FORMAT_DOUBLE_HLINE>
      (class table) <vline, vline_spanned, ([anonymous] enum)
      <HAS_TOP_VLINE, HAS_TOP_HLINE>, add_single_hline,
      add_double_hline, add_vlines, print_single_hline, print_double_hline:
      Rename these...
    
    * src/preproc/tbl/main.cpp
      (struct format) <vrule>:
      (format::format) <vrule>:
      (format::add_rows) <old_vrule, vrule>:
      (format::~format) <vrule>:
      (struct input_entry_format) <vrule, vrule_count>:
      (input_entry_format::input_entry_format) <vrule, vrule_count>:
      (input_entry_format::debug_print) <vrule, vrule_count>:
      (process_format) <vrule_count>:
      (process_data) ([anonymous] enum) <SINGLE_HRULE, DOUBLE_HRULE>:
    * src/preproc/tbl/table.cpp:
    * src/preproc/tbl/table.h
      (enum format_type) <FORMAT_HRULE, FORMAT_DOUBLE_HRULE>
      (class table) <vrule, vrule_spanned, ([anonymous] enum)
      <HAS_TOP_VRULE, HAS_TOP_HRULE>, add_single_hrule,
      add_double_hrule, add_vrules, print_single_hrule,
      print_double_hrule: ...to these.
---
 ChangeLog                 |  41 +++++++++++++++++
 src/preproc/tbl/main.cpp  | 108 +++++++++++++++++++++----------------------
 src/preproc/tbl/table.cpp | 114 +++++++++++++++++++++++-----------------------
 src/preproc/tbl/table.h   |  22 ++++-----
 4 files changed, 163 insertions(+), 122 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 72596980f..12617c903 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2023-03-07  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [tbl]: Trivially refactor.  Rename variables and functions to
+       use the term "rule" rather than "line".  The value of the term
+       "rule" is that it is not confusable with "lines" of (text) input
+       or output.
+
+       * src/preproc/tbl/main.cpp (struct format) <vline>:
+       (format::format) <vline>:
+       (format::add_rows) <old_vline, vline>:
+       (format::~format) <vline>:
+       (struct input_entry_format) <vline, vline_count>:
+       (input_entry_format::input_entry_format) <vline, vline_count>:
+       (input_entry_format::debug_print) <vline, vline_count>:
+       (process_format) <vline_count>:
+       (process_data) ([anonymous] enum) <SINGLE_HLINE, DOUBLE_HLINE>:
+       * src/preproc/tbl/table.cpp:
+       * src/preproc/tbl/table.h (enum format_type) <FORMAT_HLINE,
+       FORMAT_DOUBLE_HLINE>
+       (class table) <vline, vline_spanned, ([anonymous] enum)
+       <HAS_TOP_VLINE, HAS_TOP_HLINE>, add_single_hline,
+       add_double_hline, add_vlines, print_single_hline,
+       print_double_hline: Rename these...
+
+       * src/preproc/tbl/main.cpp (struct format) <vrule>:
+       (format::format) <vrule>:
+       (format::add_rows) <old_vrule, vrule>:
+       (format::~format) <vrule>:
+       (struct input_entry_format) <vrule, vrule_count>:
+       (input_entry_format::input_entry_format) <vrule, vrule_count>:
+       (input_entry_format::debug_print) <vrule, vrule_count>:
+       (process_format) <vrule_count>:
+       (process_data) ([anonymous] enum) <SINGLE_HRULE, DOUBLE_HRULE>:
+       * src/preproc/tbl/table.cpp:
+       * src/preproc/tbl/table.h (enum format_type) <FORMAT_HRULE,
+       FORMAT_DOUBLE_HRULE>
+       (class table) <vrule, vrule_spanned, ([anonymous] enum)
+       <HAS_TOP_VRULE, HAS_TOP_HRULE>, add_single_hrule,
+       add_double_hrule, add_vrules, print_single_hrule,
+       print_double_hrule: ...to these.
+
 2023-02-25  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [tbl]: Fix Savannah #63838.
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index db105c217..61265538d 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -575,10 +575,10 @@ void entry_format::debug_print() const
   case FORMAT_VSPAN:
     putc('^', stderr);
     break;
-  case FORMAT_HLINE:
+  case FORMAT_HRULE:
     putc('_', stderr);
     break;
-  case FORMAT_DOUBLE_HLINE:
+  case FORMAT_DOUBLE_HRULE:
     putc('=', stderr);
     break;
   default:
@@ -635,7 +635,7 @@ struct format {
   char *equal;
   char *expand;
   entry_format **entry;
-  char **vline;
+  char **vrule;
 
   format(int nr, int nc);
   ~format();
@@ -658,26 +658,26 @@ format::format(int nr, int nc) : nrows(nr), ncolumns(nc)
   entry = new entry_format *[nrows];
   for (i = 0; i < nrows; i++)
     entry[i] = new entry_format[ncolumns];
-  vline = new char*[nrows];
+  vrule = new char*[nrows];
   for (i = 0; i < nrows; i++) {
-    vline[i] = new char[ncolumns+1];
+    vrule[i] = new char[ncolumns+1];
     for (int j = 0; j < ncolumns+1; j++)
-      vline[i][j] = 0;
+      vrule[i][j] = 0;
   }
 }
 
 void format::add_rows(int n)
 {
   int i;
-  char **old_vline = vline;
-  vline = new char*[nrows + n];
+  char **old_vrule = vrule;
+  vrule = new char*[nrows + n];
   for (i = 0; i < nrows; i++)
-    vline[i] = old_vline[i];
-  delete[] old_vline;
+    vrule[i] = old_vrule[i];
+  delete[] old_vrule;
   for (i = 0; i < n; i++) {
-    vline[nrows + i] = new char[ncolumns + 1];
+    vrule[nrows + i] = new char[ncolumns + 1];
     for (int j = 0; j < ncolumns + 1; j++)
-      vline[nrows + i][j] = 0;
+      vrule[nrows + i][j] = 0;
   }
   entry_format **old_entry = entry;
   entry = new entry_format *[nrows + n];
@@ -696,10 +696,10 @@ format::~format()
   delete[] equal;
   delete[] expand;
   for (int i = 0; i < nrows; i++) {
-    delete[] vline[i];
+    delete[] vrule[i];
     delete[] entry[i];
   }
-  delete[] vline;
+  delete[] vrule;
   delete[] entry;
 }
 
@@ -707,8 +707,8 @@ struct input_entry_format : public entry_format {
   input_entry_format *next;
   string width;
   int separation;
-  int vline;
-  int vline_count;
+  int vrule;
+  int vrule_count;
   bool is_last_column;
   bool is_equal_width;
   int expand;
@@ -722,8 +722,8 @@ input_entry_format::input_entry_format(format_type t, 
input_entry_format *p)
 {
   separation = -1;
   is_last_column = false;
-  vline = 0;
-  vline_count = 0;
+  vrule = 0;
+  vrule_count = 0;
   is_equal_width = false;
   expand = 0;
 }
@@ -744,7 +744,7 @@ void free_input_entry_format_list(input_entry_format *list)
 void input_entry_format::debug_print()
 {
   int i;
-  for (i = 0; i < vline_count; i++)
+  for (i = 0; i < vrule_count; i++)
     putc('|', stderr);
   entry_format::debug_print();
   if (!width.empty()) {
@@ -759,7 +759,7 @@ void input_entry_format::debug_print()
     putc('x', stderr);
   if (separation >= 0)
     fprintf(stderr, "%d", separation); 
-  for (i = 0; i < vline; i++)
+  for (i = 0; i < vrule; i++)
     putc('|', stderr);
   if (is_last_column)
     putc(',', stderr);
@@ -777,7 +777,7 @@ format *process_format(table_input &in, options *opt,
   bool is_first_row = true;
   int c = in.get();
   for (;;) {
-    int vline_count = 0;
+    int vrule_count = 0;
     bool got_format = false;
     bool got_period = false;
     format_type t = FORMAT_LEFT;
@@ -827,22 +827,22 @@ format *process_format(table_input &in, options *opt,
       case '_':
       case '-':                        // tbl also accepts this
        got_format = true;
-       t = FORMAT_HLINE;
+       t = FORMAT_HRULE;
        if (is_first_row)
-         opt->flags |= table::HAS_TOP_HLINE;
+         opt->flags |= table::HAS_TOP_HRULE;
        break;
       case '=':
        got_format = true;
-       t = FORMAT_DOUBLE_HLINE;
+       t = FORMAT_DOUBLE_HRULE;
        break;
       case '.':
        got_period = true;
        break;
       case '|':
        // leading vertical line in row
-       opt->flags |= table::HAS_TOP_VLINE;
-       vline_count++;
-       // list->vline_count is updated later
+       opt->flags |= table::HAS_TOP_VRULE;
+       vrule_count++;
+       // list->vrule_count is updated later
        break;
       case ' ':
       case '\t':
@@ -865,13 +865,13 @@ format *process_format(table_input &in, options *opt,
     if (got_period)
       break;
     list = new input_entry_format(t, list);
-    if (vline_count > 2) {
-      vline_count = 2;
+    if (vrule_count > 2) {
+      vrule_count = 2;
       error("more than 2 vertical lines at beginning of row description");
     }
-    list->vline_count = vline_count;
+    list->vrule_count = vrule_count;
     // Now handle modifiers.
-    vline_count = 0;
+    vrule_count = 0;
     bool is_valid_modifier_sequence = true;
     do {
       switch (c) {
@@ -1115,9 +1115,9 @@ format *process_format(table_input &in, options *opt,
        break;
       case '|':
        if (is_first_row)
-         opt->flags |= table::HAS_TOP_VLINE;
+         opt->flags |= table::HAS_TOP_VRULE;
        c = in.get();
-       vline_count++;
+       vrule_count++;
        break;
       case ' ':
       case '\t':
@@ -1131,13 +1131,13 @@ format *process_format(table_input &in, options *opt,
        break;
       }
     } while (is_valid_modifier_sequence);
-    if (vline_count > 2) {
-      vline_count = 2;
+    if (vrule_count > 2) {
+      vrule_count = 2;
       error("more than 2 vertical lines after column descriptor");
     }
-    list->vline += vline_count;
+    list->vrule += vrule_count;
     if (c == '\n' || c == ',') {
-      vline_count = 0;
+      vrule_count = 0;
       is_first_row = false;
       c = in.get();
       list->is_last_column = true;
@@ -1242,9 +1242,9 @@ format *process_format(table_input &in, options *opt,
        error("multiple widths for column %1", col + 1);
       f->width[col] = tem->width;
     }
-    if (tem->vline_count)
-      f->vline[row][col] = tem->vline_count;
-    f->vline[row][col + 1] = tem->vline;
+    if (tem->vrule_count)
+      f->vrule[row][col] = tem->vrule_count;
+    f->vrule[row][col + 1] = tem->vrule;
     if (tem->is_last_column) {
       row++;
       col = 0;
@@ -1256,8 +1256,8 @@ format *process_format(table_input &in, options *opt,
   list = 0 /* nullptr */;
   for (col = 0; col < ncolumns; col++) {
     entry_format *e = f->entry[f->nrows - 1] + col;
-    if (e->type != FORMAT_HLINE
-       && e->type != FORMAT_DOUBLE_HLINE
+    if (e->type != FORMAT_HRULE
+       && e->type != FORMAT_DOUBLE_HRULE
        && e->type != FORMAT_SPAN)
       break;
   }
@@ -1281,7 +1281,7 @@ table *process_data(table_input &in, format *f, options 
*opt)
   int current_row = 0;
   int format_index = 0;
   bool give_up = false;
-  enum { DATA_INPUT_LINE, TROFF_INPUT_LINE, SINGLE_HLINE, DOUBLE_HLINE } type;
+  enum { DATA_INPUT_LINE, TROFF_INPUT_LINE, SINGLE_HRULE, DOUBLE_HRULE } type;
   table *tbl = new table(ncolumns, opt->flags, opt->linesize,
                         opt->decimal_point_char);
   if (opt->delim[0] != '\0')
@@ -1306,11 +1306,11 @@ table *process_data(table_input &in, format *f, options 
*opt)
       int d = in.get();
       if (d == '\n') {
        if (c == '_')
-         type = SINGLE_HLINE;
+         type = SINGLE_HRULE;
        else
-         type = DOUBLE_HLINE;
+         type = DOUBLE_HRULE;
        if (0 == current_row)
-         tbl->flags |= table::HAS_TOP_HLINE;
+         tbl->flags |= table::HAS_TOP_HRULE;
       }
       else {
        in.unget(d);
@@ -1331,8 +1331,8 @@ table *process_data(table_input &in, format *f, options 
*opt)
          int cnt;
          for (cnt = 0; cnt < ncolumns; cnt++) {
            entry_format *e = f->entry[format_index] + cnt;
-           if (e->type != FORMAT_HLINE
-               && e->type != FORMAT_DOUBLE_HLINE
+           if (e->type != FORMAT_HRULE
+               && e->type != FORMAT_DOUBLE_HRULE
                // Unfortunately tbl treats a span as needing data.
                // && e->type != FORMAT_SPAN
                )
@@ -1344,7 +1344,7 @@ table *process_data(table_input &in, format *f, options 
*opt)
            tbl->add_entry(current_row, cnt, input_entry,
                           f->entry[format_index] + cnt, current_filename,
                           current_lineno);
-         tbl->add_vlines(current_row, f->vline[format_index]);
+         tbl->add_vrules(current_row, f->vrule[format_index]);
          format_index++;
          current_row++;
        }
@@ -1507,7 +1507,7 @@ table *process_data(table_input &in, format *f, options 
*opt)
        for (; col < ncolumns; col++)
          tbl->add_entry(current_row, col, input_entry, &line_format[col],
                         current_filename, current_lineno - 1);
-       tbl->add_vlines(current_row, f->vline[format_index]);
+       tbl->add_vrules(current_row, f->vrule[format_index]);
        current_row++;
        format_index++;
       }
@@ -1541,11 +1541,11 @@ table *process_data(table_input &in, format *f, options 
*opt)
        }
       }
       break;
-    case SINGLE_HLINE:
-      tbl->add_single_hline(current_row);
+    case SINGLE_HRULE:
+      tbl->add_single_hrule(current_row);
       break;
-    case DOUBLE_HLINE:
-      tbl->add_double_hline(current_row);
+    case DOUBLE_HRULE:
+      tbl->add_double_hrule(current_row);
       break;
     default:
       assert(0 == "invalid `type` in switch");
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index a12874d2b..0dae4a4eb 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -1095,44 +1095,44 @@ void text_stuff::print(table *)
   location_force_filename = 1; // it might have been a .lf command
 }
 
-struct single_hline_stuff : public stuff {
-  single_hline_stuff(int);
+struct single_hrule_stuff : public stuff {
+  single_hrule_stuff(int);
   void print(table *);
   int is_single_line();
 };
 
-single_hline_stuff::single_hline_stuff(int r) : stuff(r)
+single_hrule_stuff::single_hrule_stuff(int r) : stuff(r)
 {
 }
 
-void single_hline_stuff::print(table *tbl)
+void single_hrule_stuff::print(table *tbl)
 {
   printed = 1;
-  tbl->print_single_hline(row);
+  tbl->print_single_hrule(row);
 }
 
-int single_hline_stuff::is_single_line()
+int single_hrule_stuff::is_single_line()
 {
   return 1;
 }
 
-struct double_hline_stuff : stuff {
-  double_hline_stuff(int);
+struct double_hrule_stuff : stuff {
+  double_hrule_stuff(int);
   void print(table *);
   int is_double_line();
 };
 
-double_hline_stuff::double_hline_stuff(int r) : stuff(r)
+double_hrule_stuff::double_hrule_stuff(int r) : stuff(r)
 {
 }
 
-void double_hline_stuff::print(table *tbl)
+void double_hrule_stuff::print(table *tbl)
 {
   printed = 1;
-  tbl->print_double_hline(row);
+  tbl->print_double_hrule(row);
 }
 
-int double_hline_stuff::is_double_line()
+int double_hrule_stuff::is_double_line()
 {
   return 1;
 }
@@ -1251,7 +1251,7 @@ table::table(int nc, unsigned f, int ls, char dpc)
 : nrows(0), ncolumns(nc), linesize(ls), decimal_point_char(dpc),
   vrule_list(0), stuff_list(0), span_list(0),
   entry_list(0), entry_list_tailp(&entry_list), entry(0),
-  vline(0), row_is_all_lines(0), left_separation(0),
+  vrule(0), row_is_all_lines(0), left_separation(0),
   right_separation(0), total_separation(0), allocated_rows(0), flags(f)
 {
   minimum_width = new string[ncolumns];
@@ -1272,10 +1272,10 @@ table::~table()
 {
   for (int i = 0; i < nrows; i++) {
     delete[] entry[i];
-    delete[] vline[i];
+    delete[] vrule[i];
   }
   delete[] entry;
-  delete[] vline;
+  delete[] vrule;
   while (entry_list) {
     table_entry *tem = entry_list;
     entry_list = entry_list->next;
@@ -1347,14 +1347,14 @@ void table::add_text_line(int r, const string &s, const 
char *filename,
   add_stuff(new text_stuff(s, r, filename, lineno));
 }
 
-void table::add_single_hline(int r)
+void table::add_single_hrule(int r)
 {
-  add_stuff(new single_hline_stuff(r));
+  add_stuff(new single_hrule_stuff(r));
 }
 
-void table::add_double_hline(int r)
+void table::add_double_hrule(int r)
 {
-  add_stuff(new double_hline_stuff(r));
+  add_stuff(new double_hrule_stuff(r));
 }
 
 void table::allocate(int r)
@@ -1367,7 +1367,7 @@ void table::allocate(int r)
        if (allocated_rows <= r)
          allocated_rows = r + 1;
        entry = new PPtable_entry[allocated_rows];
-       vline = new char*[allocated_rows];
+       vrule = new char*[allocated_rows];
       }
       else {
        table_entry ***old_entry = entry;
@@ -1378,10 +1378,10 @@ void table::allocate(int r)
        entry = new PPtable_entry[allocated_rows];
        memcpy(entry, old_entry, sizeof(table_entry**)*old_allocated_rows);
        delete[] old_entry;
-       char **old_vline = vline;
-       vline = new char*[allocated_rows];
-       memcpy(vline, old_vline, sizeof(char*)*old_allocated_rows);
-       delete[] old_vline;
+       char **old_vrule = vrule;
+       vrule = new char*[allocated_rows];
+       memcpy(vrule, old_vrule, sizeof(char*)*old_allocated_rows);
+       delete[] old_vrule;
       }
     }
     assert(allocated_rows > r);
@@ -1390,9 +1390,9 @@ void table::allocate(int r)
       int i;
       for (i = 0; i < ncolumns; i++)
        entry[nrows][i] = 0;
-      vline[nrows] = new char[ncolumns+1];
+      vrule[nrows] = new char[ncolumns+1];
       for (i = 0; i < ncolumns+1; i++)
-       vline[nrows][i] = 0;
+       vrule[nrows][i] = 0;
       nrows++;
     }
   }
@@ -1638,14 +1638,14 @@ void table::add_entry(int r, int c, const string &str,
     case FORMAT_VSPAN:
       do_vspan(r, c);
       break;
-    case FORMAT_HLINE:
+    case FORMAT_HRULE:
       if ((str.length() != 0) && (str != "\\&"))
        error_with_file_and_line(fn, ln,
                                 "ignoring non-empty data entry using"
                                 " '_' column classifier");
       e = new single_line_entry(this, f);
       break;
-    case FORMAT_DOUBLE_HLINE:
+    case FORMAT_DOUBLE_HRULE:
       if ((str.length() != 0) && (str != "\\&"))
        error_with_file_and_line(fn, ln,
                                 "ignoring non-empty data entry using"
@@ -1654,7 +1654,7 @@ void table::add_entry(int r, int c, const string &str,
       break;
     default:
       assert(0 == "table column format not in FORMAT_{SPAN,LEFT,CENTER,"
-                 "RIGHT,NUMERIC,ALPHABETIC,VSPAN,HLINE,DOUBLE_HLINE}");
+                 "RIGHT,NUMERIC,ALPHABETIC,VSPAN,HRULE,DOUBLE_HRULE}");
     }
   }
   if (e) {
@@ -1681,7 +1681,7 @@ void table::add_entry(int r, int c, const string &str,
 
 // add vertical lines for row r
 
-void table::add_vlines(int r, const char *v)
+void table::add_vrules(int r, const char *v)
 {
   allocate(r);
   bool lwarned = false;
@@ -1699,7 +1699,7 @@ void table::add_vlines(int r, const char *v)
       twarned = true;
     }
     else
-      vline[r][i] = v[i];
+      vrule[r][i] = v[i];
   }
 }
 
@@ -2261,9 +2261,9 @@ void table::compute_total_separation()
     left_separation = right_separation = 1;
   else {
     for (int r = 0; r < nrows; r++) {
-      if (vline[r][0] > 0)
+      if (vrule[r][0] > 0)
        left_separation = 1;
-      if (vline[r][ncolumns] > 0)
+      if (vrule[r][ncolumns] > 0)
        right_separation = 1;
     }
   }
@@ -2461,7 +2461,7 @@ void table::compute_widths()
   compute_column_positions();
 }
 
-void table::print_single_hline(int r)
+void table::print_single_hrule(int r)
 {
   prints(".vs " LINE_SEP ">?\\n[.V]u\n"
         ".ls 1\n"
@@ -2487,14 +2487,14 @@ void table::print_single_hline(int r)
        break;
       printfs("\\h'|\\n[%1]u",
              column_divide_reg(start_col));
-      if ((r > 0 && vline[r-1][start_col] == 2)
-         || (r < nrows && vline[r][start_col] == 2))
+      if ((r > 0 && vrule[r-1][start_col] == 2)
+         || (r < nrows && vrule[r][start_col] == 2))
        prints("-" HALF_DOUBLE_LINE_SEP);
       prints("'");
       printfs("\\D'l |\\n[%1]u",
              column_divide_reg(end_col));
-      if ((r > 0 && vline[r-1][end_col] == 2)
-         || (r < nrows && vline[r][end_col] == 2))
+      if ((r > 0 && vrule[r-1][end_col] == 2)
+         || (r < nrows && vrule[r][end_col] == 2))
        prints("+" HALF_DOUBLE_LINE_SEP);
       prints(" 0'");
       start_col = end_col;
@@ -2505,7 +2505,7 @@ void table::print_single_hline(int r)
         ".vs\n");
 }
 
-void table::print_double_hline(int r)
+void table::print_double_hrule(int r)
 {
   prints(".vs " LINE_SEP "+" DOUBLE_LINE_SEP
         ">?\\n[.V]u\n"
@@ -2535,12 +2535,12 @@ void table::print_double_hline(int r)
       if (end_col <= start_col)
        break;
       const char *left_adjust = 0;
-      if ((r > 0 && vline[r-1][start_col] == 2)
-         || (r < nrows && vline[r][start_col] == 2))
+      if ((r > 0 && vrule[r-1][start_col] == 2)
+         || (r < nrows && vrule[r][start_col] == 2))
        left_adjust = "-" HALF_DOUBLE_LINE_SEP;
       const char *right_adjust = 0;
-      if ((r > 0 && vline[r-1][end_col] == 2)
-         || (r < nrows && vline[r][end_col] == 2))
+      if ((r > 0 && vrule[r-1][end_col] == 2)
+         || (r < nrows && vrule[r][end_col] == 2))
        right_adjust = "+" HALF_DOUBLE_LINE_SEP;
       printfs("\\v'-" DOUBLE_LINE_SEP "'"
              "\\h'|\\n[%1]u",
@@ -2706,12 +2706,12 @@ void table::build_vrule_list()
     for (col = 1; col < ncolumns; col++) {
       int start_row = 0;
       for (;;) {
-       while (start_row < nrows && vline_spanned(start_row, col))
+       while (start_row < nrows && vrule_spanned(start_row, col))
          start_row++;
        if (start_row >= nrows)
          break;
        int end_row = start_row;
-       while (end_row < nrows && !vline_spanned(end_row, col))
+       while (end_row < nrows && !vrule_spanned(end_row, col))
          end_row++;
        end_row--;
        add_vertical_rule(start_row, end_row, col, 0);
@@ -2725,20 +2725,20 @@ void table::build_vrule_list()
   }
   for (int end_row = 0; end_row < nrows; end_row++)
     for (col = 0; col < ncolumns+1; col++)
-      if (vline[end_row][col] > 0
-         && !vline_spanned(end_row, col)
+      if (vrule[end_row][col] > 0
+         && !vrule_spanned(end_row, col)
          && (end_row == nrows - 1
-             || vline[end_row+1][col] != vline[end_row][col]
-             || vline_spanned(end_row+1, col))) {
+             || vrule[end_row+1][col] != vrule[end_row][col]
+             || vrule_spanned(end_row+1, col))) {
        int start_row;
        for (start_row = end_row - 1;
             start_row >= 0
-            && vline[start_row][col] == vline[end_row][col]
-            && !vline_spanned(start_row, col);
+            && vrule[start_row][col] == vrule[end_row][col]
+            && !vrule_spanned(start_row, col);
             start_row--)
          ;
        start_row++;
-       add_vertical_rule(start_row, end_row, col, vline[end_row][col] > 1);
+       add_vertical_rule(start_row, end_row, col, vrule[end_row][col] > 1);
       }
   for (vertical_rule *p = vrule_list; p; p = p->next)
     if (p->is_double)
@@ -2772,7 +2772,7 @@ void table::define_bottom_macro()
         ".    mk " SAVED_VERTICAL_POS_REG "\n");
   if (flags & (BOX | ALLBOX | DOUBLEBOX)) {
     prints(".    if \\n[T.]&\\n[" NEED_BOTTOM_RULE_REG "] \\{\\\n");
-    print_single_hline(0);
+    print_single_hrule(0);
     prints(".    \\}\n");
   }
   prints(".    ls 1\n");
@@ -2815,7 +2815,7 @@ void table::define_bottom_macro()
 
 // is the vertical line before column c in row r horizontally spanned?
 
-int table::vline_spanned(int r, int c)
+int table::vrule_spanned(int r, int c)
 {
   assert(r >= 0 && r < nrows && c >= 0 && c < ncolumns + 1);
   return (c != 0 && c != ncolumns && entry[r][c] != 0
@@ -2984,7 +2984,7 @@ void table::do_row(int r)
         ".sp |\\n[" BOTTOM_REG "]u\n"
         "\\*[" TRANSPARENT_STRING_NAME "].nr " NEED_BOTTOM_RULE_REG " 1\n");
   if (r != nrows - 1 && (flags & ALLBOX)) {
-    print_single_hline(r + 1);
+    print_single_hrule(r + 1);
     prints("\\*[" TRANSPARENT_STRING_NAME "].nr " NEED_BOTTOM_RULE_REG " 0\n");
   }
   if (r != nrows - 1) {
@@ -3040,13 +3040,13 @@ void table::do_top()
           ".vs\n");
   }
   else if (flags & (ALLBOX | BOX))
-    print_single_hline(0);
+    print_single_hrule(0);
   // On terminal devices, a vertical rule on the first row of the table
   // will stick out 1v above it if it the table is unboxed or lacks a
   // horizontal rule on the first row.  This is necessary for grotty's
   // rule intersection detection.  We must make room for it so that the
   // vertical rule is not drawn above the top of the page.
-  else if ((flags & HAS_TOP_VLINE) && !(flags & HAS_TOP_HLINE))
+  else if ((flags & HAS_TOP_VRULE) && !(flags & HAS_TOP_HRULE))
     prints(".if n .sp\n");
   prints(".nr " STARTING_PAGE_REG " \\n%\n");
   //printfs(".mk %1\n", row_top_reg(0));
diff --git a/src/preproc/tbl/table.h b/src/preproc/tbl/table.h
index 62346fa4e..cacdcfe22 100644
--- a/src/preproc/tbl/table.h
+++ b/src/preproc/tbl/table.h
@@ -63,8 +63,8 @@ enum format_type {
   FORMAT_ALPHABETIC,
   FORMAT_SPAN, 
   FORMAT_VSPAN,
-  FORMAT_HLINE,
-  FORMAT_DOUBLE_HLINE
+  FORMAT_HRULE,
+  FORMAT_DOUBLE_HRULE
 };
 
 struct entry_format : public entry_modifier {
@@ -92,7 +92,7 @@ class table {
   table_entry *entry_list;
   table_entry **entry_list_tailp;
   table_entry ***entry;
-  char **vline;
+  char **vrule;
   char *row_is_all_lines;
   string *minimum_width;
   int *column_separation;
@@ -121,7 +121,7 @@ class table {
   void build_vrule_list();
   void add_vertical_rule(int, int, int, int);
   void define_bottom_macro();
-  int vline_spanned(int r, int c);
+  int vrule_spanned(int r, int c);
   int row_begins_section(int);
   int row_ends_section(int);
   void make_columns_equal();
@@ -141,8 +141,8 @@ public:
     NOSPACES      = 0x00000040,
     NOWARN        = 0x00000080,
     // The next few properties help manage nroff mode output.
-    HAS_TOP_VLINE = 0x00000100,
-    HAS_TOP_HLINE = 0x00000200,
+    HAS_TOP_VRULE = 0x00000100,
+    HAS_TOP_HRULE = 0x00000200,
     GAP_EXPAND    = 0x00000400,
     EXPERIMENTAL  = 0x80000000 // undocumented
     };
@@ -151,11 +151,11 @@ public:
   ~table();
 
   void add_text_line(int r, const string &, const char *, int);
-  void add_single_hline(int r);
-  void add_double_hline(int r);
+  void add_single_hrule(int r);
+  void add_double_hrule(int r);
   void add_entry(int r, int c, const string &, const entry_format *,
                 const char *, int lineno);
-  void add_vlines(int r, const char *);
+  void add_vrules(int r, const char *);
   void check();
   void print();
   void set_minimum_width(int c, const string &w);
@@ -163,8 +163,8 @@ public:
   void set_equal_column(int c);
   void set_expand_column(int c);
   void set_delim(char c1, char c2);
-  void print_single_hline(int r);
-  void print_double_hline(int r);
+  void print_single_hrule(int r);
+  void print_double_hrule(int r);
   int get_nrows();
 };
 



reply via email to

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