gbranden pushed a commit to branch master
in repository groff.
commit 73b798f4a955e3de2620bfa134aa59eceb25a57d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Nov 28 16:02:23 2025 -0600
[troff]: Add `token::is_node()` member function.
* src/roff/troff/token.h: Add new inline member function `is_node()` to
aid input parser diagnostics.
---
ChangeLog | 5 +++++
src/roff/troff/token.h | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index bd36ac1cf..383f3263b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-11-28 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/token.h: Add new inline member function
+ `is_node()` to aid input parser diagnostics.
+
2025-11-28 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp: Trivially refactor. Rename
diff --git a/src/roff/troff/token.h b/src/roff/troff/token.h
index 1a5f8b4d4..f541c1b59 100644
--- a/src/roff/troff/token.h
+++ b/src/roff/troff/token.h
@@ -83,6 +83,7 @@ public:
void skip_spaces();
void diagnose_non_character();
int nspaces(); // is_space() as integer
+ bool is_node();
bool is_eof();
bool is_space();
bool is_stretchable_space();
@@ -229,6 +230,11 @@ inline int token::character_index()
return val;
}
+inline bool token::is_node()
+{
+ return type == TOKEN_NODE;
+}
+
inline bool token::is_eof()
{
return type == TOKEN_EOF;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit