gbranden pushed a commit to branch master
in repository groff.
commit 63c05ebea922165cfe3cc355c9744ed4f8b1beb0
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Oct 21 11:14:06 2025 -0500
[troff]: Slightly refactor; boolify.
* src/roff/troff/input.cpp (process_input_stack): Rename `suppress_next`
local variable to `ignore_next_token`, and demote it from `int` to
`bool`. Assign to it with Boolean rather than integer literals.
---
ChangeLog | 7 +++++++
src/roff/troff/input.cpp | 10 +++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 412881ccd..e5a37c931 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-10-21 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (process_input_stack): Rename
+ `suppress_next` local variable to `ignore_next_token`, and
+ demote it from `int` to `bool`. Assign to it with Boolean
+ rather than integer literals.
+
2025-10-20 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp (environment::add_char): Throw syntax
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 5dd28aa6f..0f82c5a0b 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -3125,7 +3125,7 @@ void process_input_stack()
std::stack<int> trap_bol_stack;
bool reading_beginning_of_input_line = true;
for (;;) {
- int suppress_next = 0;
+ bool ignore_next_token = false;
switch (tok.type) {
case token::TOKEN_CHAR:
{
@@ -3166,7 +3166,7 @@ void process_input_stack()
}
#endif
}
- suppress_next = 1;
+ ignore_next_token = true;
}
else {
if (possibly_handle_first_page_transition())
@@ -3184,7 +3184,7 @@ void process_input_stack()
break;
ch = tok.c;
}
- suppress_next = 1;
+ ignore_next_token = true;
reading_beginning_of_input_line = false;
}
}
@@ -3248,7 +3248,7 @@ void process_input_stack()
assert(0 == "unhandled case of `request_code` (int)");
break;
}
- suppress_next = 1;
+ ignore_next_token = true;
break;
}
case token::TOKEN_SPACE:
@@ -3361,7 +3361,7 @@ void process_input_stack()
break;
}
}
- if (!suppress_next)
+ if (!ignore_next_token)
tok.next();
was_trap_sprung = false;
}
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit