gbranden pushed a commit to branch master
in repository groff.
commit 54814e635dbea335a24623b81e79ad6406a7427c
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Apr 3 05:08:28 2026 -0500
src/roff/troff/input.cpp: Trivially refactor.
* src/roff/troff/input.cpp: Rename global `while_depth` to
`while_loop_depth`.
(while_request, while_break_flag, while_continue_request): Update
dereference sites.
---
ChangeLog | 7 +++++++
src/roff/troff/input.cpp | 10 +++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3ea32089f..e29def092 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-04-03 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp: Trivially refactor. Rename global
+ `while_depth` to `while_loop_depth`.
+ (while_request, while_break_flag, while_continue_request):
+ Update dereference sites.
+
2026-04-03 G. Branden Robinson <[email protected]>
* src/roff/troff/node.cpp (make_glyph_node): Revise wording of
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 8a361c63d..9c4c319cf 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -7395,7 +7395,7 @@ static void else_request()
}
}
-static int while_depth = 0;
+static int while_loop_depth = 0;
static bool want_loop_break = false;
static void while_request()
@@ -7441,7 +7441,7 @@ static void while_request()
if (level != 0)
error("unbalanced brace escape sequences");
else {
- while_depth++;
+ while_loop_depth++;
input_stack::add_boundary();
for (;;) {
input_stack::push(new string_iterator(mac, "while loop"));
@@ -7458,14 +7458,14 @@ static void while_request()
}
}
input_stack::remove_boundary();
- while_depth--;
+ while_loop_depth--;
}
tok.next();
}
static void while_break_request()
{
- if (!while_depth) {
+ if (!while_loop_depth) {
error("cannot 'break' when not in a 'while' loop");
skip_line();
}
@@ -7479,7 +7479,7 @@ static void while_break_request()
static void while_continue_request()
{
- if (!while_depth) {
+ if (!while_loop_depth) {
error("cannot 'continue' when not in a 'while' loop");
skip_line();
}
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit