gbranden pushed a commit to branch master
in repository groff.
commit 658a1ed7136dd9b4d6480756dfe812e16d3d71b9
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Jan 18 00:36:02 2025 -0600
[troff]: Rename enumeration constants for clarity.
* src/roff/troff/token.h: Rename enumeration constants used for
character definitions.
`CHAR_FONT_SPECIAL` -> `CHAR_FONT_SPECIFIC_FALLBACK`
`CHAR_SPECIAL` -> `CHAR_SPECIAL_FALLBACK`
The `char_mode` enumeration type involves the resolution order
for a character, not its syntax ("ordinary" vs. "special").
* src/roff/troff/charinfo.h (charinfo::is_special):
* src/roff/troff/input.cpp (define_character)
(define_fallback_character_request):
* src/roff/troff/node.cpp (define_font_specific_character): Update usage
sites.
---
ChangeLog | 16 ++++++++++++++++
src/roff/troff/charinfo.h | 2 +-
src/roff/troff/input.cpp | 6 +++---
src/roff/troff/node.cpp | 2 +-
src/roff/troff/token.h | 4 ++--
5 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 10b48acf6..4b8ebeae8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2025-01-17 G. Branden Robinson <[email protected]>
+
+ [troff]: Rename enumeration constants for clarity.
+
+ * src/roff/troff/token.h: Rename enumeration constants used for
+ character definitions.
+ `CHAR_FONT_SPECIAL` -> `CHAR_FONT_SPECIFIC_FALLBACK`
+ `CHAR_SPECIAL` -> `CHAR_SPECIAL_FALLBACK`
+ The `char_mode` enumeration type involves the resolution order
+ for a character, not its syntax ("ordinary" vs. "special").
+ * src/roff/troff/charinfo.h (charinfo::is_special):
+ * src/roff/troff/input.cpp (define_character)
+ (define_fallback_character_request):
+ * src/roff/troff/node.cpp (define_font_specific_character):
+ Update usage sites.
+
2025-01-17 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp (define_character): Improve
diff --git a/src/roff/troff/charinfo.h b/src/roff/troff/charinfo.h
index 531c35638..b5f0c17f1 100644
--- a/src/roff/troff/charinfo.h
+++ b/src/roff/troff/charinfo.h
@@ -204,7 +204,7 @@ inline bool charinfo::is_fallback()
inline bool charinfo::is_special()
{
- return (mode == CHAR_SPECIAL);
+ return (mode == CHAR_SPECIAL_FALLBACK);
}
inline charinfo *charinfo::get_translation(bool for_transparent_throughput)
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 81f81e272..0947ce725 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -4569,10 +4569,10 @@ void define_character(char_mode mode, const char
*font_name)
case CHAR_FALLBACK:
modestr = " fallback";
break;
- case CHAR_SPECIAL:
+ case CHAR_SPECIAL_FALLBACK:
modestr = " special fallback";
break;
- case CHAR_FONT_SPECIAL:
+ case CHAR_FONT_SPECIFIC_FALLBACK:
modestr = " font-specific fallback";
break;
default:
@@ -4617,7 +4617,7 @@ static void define_fallback_character_request()
static void define_special_character_request()
{
- define_character(CHAR_SPECIAL);
+ define_character(CHAR_SPECIAL_FALLBACK);
}
static void remove_character()
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 05c4f75d1..25e99f370 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6417,7 +6417,7 @@ static void define_font_specific_character()
}
else {
symbol f = font_table[finfo.position]->get_name();
- define_character(CHAR_FONT_SPECIAL, f.contents());
+ define_character(CHAR_FONT_SPECIFIC_FALLBACK, f.contents());
}
}
diff --git a/src/roff/troff/token.h b/src/roff/troff/token.h
index 03f428247..cb71ea981 100644
--- a/src/roff/troff/token.h
+++ b/src/roff/troff/token.h
@@ -114,8 +114,8 @@ extern void handle_initial_title();
enum char_mode {
CHAR_NORMAL,
CHAR_FALLBACK,
- CHAR_FONT_SPECIAL,
- CHAR_SPECIAL
+ CHAR_FONT_SPECIFIC_FALLBACK,
+ CHAR_SPECIAL_FALLBACK
};
extern void define_character(char_mode,
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit