gbranden pushed a commit to branch master
in repository groff.

commit ea22ee7f59ebbf74ac11ba13857172445cc6a8ad
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Dec 19 13:10:45 2025 -0600

    [troff]: Trivially refactor.
    
    * src/roff/troff/token.h (class token): Rename member function
      {declared} from `is_white_space()` to `is_horizontal_whitespace()`.
      Whitespace isn't "white" in the chromatic sense (cf. "red" or "black")
      but in an abstract one; further, this member function does not test
      for form feeds or any other conceivable "vertical whitespace".
    
      (token::is_white_space): Rename {definition} from this...
      (token::is_horizontal_whitespace): ...to this.
    
    * src/roff/troff/input.cpp (process_input_stack): Update lone call site.
      (So why have `is_horizontal_whitespace()` in the `token` class at
      all?)
---
 ChangeLog                | 14 ++++++++++++++
 src/roff/troff/input.cpp |  4 ++--
 src/roff/troff/token.h   |  4 ++--
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 755c511ec..945bdd414 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2025-12-19  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/token.h (class token): Rename member function
+       {declared} from `is_white_space()` to
+       `is_horizontal_whitespace()`.  Whitespace isn't "white" in the
+       chromatic sense (cf. "red" or "black") but in an abstract one;
+       further, this member function does not test for form feeds or
+       any other conceivable "vertical whitespace".
+       (token::is_white_space): Rename {definition} from this...
+       (token::is_horizontal_whitespace): ...to this.
+       * src/roff/troff/input.cpp (process_input_stack): Update lone
+       call site.  (So why have `is_horizontal_whitespace()` in the
+       `token` class at all?)
+
 2025-12-19  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/node.h: Drop duplicate incomplete type
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index bfd6c7e91..dc6aa8fca 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2067,7 +2067,7 @@ void token::diagnose_non_character()
   //   is_stretchable_space()
   //   is_unstrechable_space()
   //   is_horizontal_space()
-  //   is_white_space()
+  //   is_horizontal_whitespace()
   //   is_leader()
   //   is_backspace()
   //   is_dummy()
@@ -3472,7 +3472,7 @@ void process_input_stack()
          // skip tabs as well as spaces here
          do {
            tok.next();
-         } while (tok.is_white_space());
+         } while (tok.is_horizontal_whitespace());
          symbol nm = read_identifier();
 #if defined(DEBUGGING)
          if (want_html_debugging) {
diff --git a/src/roff/troff/token.h b/src/roff/troff/token.h
index 8640bc06e..3c636f916 100644
--- a/src/roff/troff/token.h
+++ b/src/roff/troff/token.h
@@ -88,7 +88,7 @@ public:
   bool is_stretchable_space();
   bool is_unstretchable_space();
   bool is_horizontal_space();
-  bool is_white_space();
+  bool is_horizontal_whitespace();
   bool is_any_character();
   // XXX: Do we need a `is_ordinary_character()`?
   bool is_special_character();
@@ -193,7 +193,7 @@ inline int token::nspaces()
   return int(TOKEN_SPACE == type);
 }
 
-inline bool token::is_white_space()
+inline bool token::is_horizontal_whitespace()
 {
   return (TOKEN_SPACE == type || TOKEN_TAB == type);
 }

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to