gbranden pushed a commit to branch master
in repository groff.
commit 636fe4945b598b76fb112ceeae97abf8f138c5ef
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 2 09:36:50 2025 -0600
src/roff/troff/env.cpp: Annotate poor design.
Under no circumstances does the `nm` request, whose internals are
implemented by env.cpp:number_lines(), deal with delimited arguments.
We should refactor to say what we mean.
---
src/roff/troff/env.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 1f0533229..e65e2ba29 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1717,7 +1717,7 @@ void number_lines()
curenv->numbering_nodes = nd;
curenv->line_number_digit_width = env_digit_width(curenv);
int n;
- if (!tok.is_usable_as_delimiter()) {
+ if (!tok.is_usable_as_delimiter()) { // XXX abuse of function
if (get_integer(&n, next_line_number)) {
next_line_number = n;
if (next_line_number < 0) {
@@ -1730,7 +1730,7 @@ void number_lines()
while (!tok.is_space() && !tok.is_newline() && !tok.is_eof())
tok.next();
if (has_arg()) {
- if (!tok.is_usable_as_delimiter()) {
+ if (!tok.is_usable_as_delimiter()) { // XXX abuse of function
if (get_integer(&n)) {
if (n <= 0) {
warning(WARN_RANGE, "output line number multiple cannot"
@@ -1744,14 +1744,14 @@ void number_lines()
while (!tok.is_space() && !tok.is_newline() && !tok.is_eof())
tok.next();
if (has_arg()) {
- if (!tok.is_usable_as_delimiter()) {
+ if (!tok.is_usable_as_delimiter()) { // XXX abuse of function
if (get_integer(&n))
curenv->number_text_separation = n;
}
else
while (!tok.is_space() && !tok.is_newline() && !tok.is_eof())
tok.next();
- if (has_arg() && !tok.is_usable_as_delimiter()
+ if (has_arg() && !tok.is_usable_as_delimiter() // XXX abuse of function
&& get_integer(&n))
curenv->line_number_indent = n;
}
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit