gbranden pushed a commit to branch master in repository groff. commit 1b69deeeb17c0c82016a85c9c957c63a225a454d Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Fri Feb 21 02:22:32 2025 -0600
[troff]: Trivially refactor (1/2). Rename enumerator in `token` `enum` type from `TOKEN_NUMBERED_CHAR` to `TOKEN_INDEXED_CHAR`. * src/roff/troff/token.h (class token): Revise definition. * src/roff/troff/input.cpp (token::next, token::operator==) (token::description, token::get_char) (token::add_to_zero_width_node_list, token::process): Update sites of use. --- ChangeLog | 11 +++++++++++ src/roff/troff/input.cpp | 12 ++++++------ src/roff/troff/token.h | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3fbcd897..66920b408 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2025-02-21 G. Branden Robinson <g.branden.robin...@gmail.com> + + [troff]: Trivially refactor; rename enumerator in `token` `enum` + type from `TOKEN_NUMBERED_CHAR` to `TOKEN_INDEXED_CHAR`. + + * src/roff/troff/token.h (class token): Revise definition. + * src/roff/troff/input.cpp (token::next, token::operator==) + (token::description, token::get_char) + (token::add_to_zero_width_node_list, token::process): Update + sites of use. + 2025-02-21 G. Branden Robinson <g.branden.robin...@gmail.com> * src/roff/troff/input.cpp (remove_character, get_optional_char) diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index bdfe8c922..2c401bb3b 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -2422,7 +2422,7 @@ void token::next() val); break; } - type = TOKEN_NUMBERED_CHAR; + type = TOKEN_INDEXED_CHAR; return; case 'o': nd = do_overstrike(); @@ -2608,7 +2608,7 @@ bool token::operator==(const token &t) return c == t.c; case TOKEN_SPECIAL_CHAR: return nm == t.nm; - case TOKEN_NUMBERED_CHAR: + case TOKEN_INDEXED_CHAR: return val == t.val; default: return true; @@ -2732,7 +2732,7 @@ const char *token::description() return "a newline"; case TOKEN_NODE: return "a node"; - case TOKEN_NUMBERED_CHAR: + case TOKEN_INDEXED_CHAR: return "an escaped 'N'"; case TOKEN_RIGHT_BRACE: return "an escaped '}'"; @@ -8154,7 +8154,7 @@ charinfo *token::get_char(bool required) return charset_table[c]; if (type == TOKEN_SPECIAL_CHAR) return get_charinfo(nm); - if (type == TOKEN_NUMBERED_CHAR) + if (type == TOKEN_INDEXED_CHAR) return get_charinfo_by_number(val); if (type == TOKEN_ESCAPE) { if (escape_char != 0) @@ -8232,7 +8232,7 @@ bool token::add_to_zero_width_node_list(node **pp) n = nd; nd = 0 /* nullptr */; break; - case TOKEN_NUMBERED_CHAR: + case TOKEN_INDEXED_CHAR: *pp = (*pp)->add_char(get_charinfo_by_number(val), curenv, &w, &s); break; case TOKEN_RIGHT_BRACE: @@ -8325,7 +8325,7 @@ void token::process() curenv->add_node(nd); nd = 0; break; - case TOKEN_NUMBERED_CHAR: + case TOKEN_INDEXED_CHAR: curenv->add_char(get_charinfo_by_number(val)); break; case TOKEN_REQUEST: diff --git a/src/roff/troff/token.h b/src/roff/troff/token.h index cb71ea981..f6709e7e4 100644 --- a/src/roff/troff/token.h +++ b/src/roff/troff/token.h @@ -43,7 +43,7 @@ class token { TOKEN_MARK_INPUT, // \k TOKEN_NEWLINE, // ^J TOKEN_NODE, - TOKEN_NUMBERED_CHAR, // \N + TOKEN_INDEXED_CHAR, // \N TOKEN_PAGE_EJECTOR, TOKEN_REQUEST, TOKEN_RIGHT_BRACE, // \} _______________________________________________ groff-commit mailing list groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit