gbranden pushed a commit to branch master
in repository groff.

commit 4ac4a8e21a964dd33146956106346959bafc0def
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Dec 21 00:38:27 2025 -0600

    [troff]: Trivially refactor.
    
    * src/roff/troff/token.h (class token): Sort enumeration constants
      lexicographically by their symbol names.  It seems that they once were
      thus sorted (except for `TOKEN_EOF`), but my renaming activities have
      effaced that.  Restore that ordering, but stop treating `TOKEN_EOF`
      specially.  Its magnitude is never compared to anything (and shouldn't
      be).
---
 ChangeLog              |  9 +++++++++
 src/roff/troff/token.h | 12 ++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c8ab8598e..c283a0e3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-12-21  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/token.h (class token): Trivially refactor.
+       Sort enumeration constants lexicographically by their symbol
+       names.  It seems that they once were thus sorted (except for
+       `TOKEN_EOF`), but my renaming activities have effaced that.
+       Restore that ordering, but stop treating `TOKEN_EOF` specially.
+       Its magnitude is never compared to anything (and shouldn't be).
+
 2025-12-20  G. Branden Robinson <[email protected]>
 
        * src/roff/groff/tests/pdf-device-smoke-test.sh: New file.
diff --git a/src/roff/troff/token.h b/src/roff/troff/token.h
index 568d82fca..fcec8466a 100644
--- a/src/roff/troff/token.h
+++ b/src/roff/troff/token.h
@@ -47,8 +47,11 @@ class token {
     TOKEN_DUMMY,               // dummy character: \&
     TOKEN_EMPTY,               // this is the initial value
     TOKEN_END_TRAP,
+    TOKEN_EOF,                 // end of file
     TOKEN_ESCAPE,              // \e
+    TOKEN_HORIZONTAL_MOTION,   // horizontal motion: \|, \^, \0, \h
     TOKEN_HYPHEN_INDICATOR,    // \%
+    TOKEN_INDEXED_CHAR,                // \N
     TOKEN_INTERRUPT,           // \c
     TOKEN_ITALIC_CORRECTION,   // \/
     TOKEN_LEADER,              // ^A
@@ -56,21 +59,18 @@ class token {
     TOKEN_MARK_INPUT,          // \k
     TOKEN_NEWLINE,             // ^J
     TOKEN_NODE,
-    TOKEN_INDEXED_CHAR,                // \N
     TOKEN_PAGE_EJECTOR,
     TOKEN_REQUEST,
     TOKEN_RIGHT_BRACE,         // \}
     TOKEN_SPACE,               // ' ' -- ordinary space
-    TOKEN_SPECIAL_CHAR,        // \(, \[
+    TOKEN_SPECIAL_CHAR,                // \(, \[, \C
     TOKEN_SPREAD,              // \p -- break and spread output line
     TOKEN_STRETCHABLE_SPACE,   // \~
-    TOKEN_UNSTRETCHABLE_SPACE, // '\ '
-    TOKEN_HORIZONTAL_MOTION,   // horizontal motion: \|, \^, \0, \h
     TOKEN_TAB,                 // ^I
     TOKEN_TRANSPARENT,         // \!
     TOKEN_TRANSPARENT_DUMMY,   // \)
-    TOKEN_ZERO_WIDTH_BREAK,    // \:
-    TOKEN_EOF                  // end of file
+    TOKEN_UNSTRETCHABLE_SPACE, // '\ '
+    TOKEN_ZERO_WIDTH_BREAK     // \:
   } type;
 public:
   token();

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

Reply via email to