Update of bug #67408 (group groff):
Severity: 5 - Blocker => 3 - Normal
Status: In Progress => Fixed
Open/Closed: Open => Closed
Planned Release: None => 1.24.0
_______________________________________________________
Follow-up Comment #7:
Further development and reorganization produced the following series of
commits from the material previewed in comment #6.
commit 636fe4945b598b76fb112ceeae97abf8f138c5ef
Author: G. Branden Robinson <[email protected]>
Date: 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.
commit dd23b603f3492962eedec77ffecf1fcd6ae240b6
Author: G. Branden Robinson <[email protected]>
Date: Sun Nov 2 09:42:18 2025 -0600
src/roff/troff/input.cpp: Refactor.
* src/roff/troff/input.cpp (are_comparands_equal): Pull performance of
output comparison operation into its own function...
(is_conditional_expression_true): ...from here.
commit 79cc64b371dafb43786c62f0d56aaa27a61dea0b
Author: G. Branden Robinson <[email protected]>
Date: Sun Nov 2 09:46:15 2025 -0600
src/roff/troff/input.cpp: Slightly refactor.
* src/roff/troff/input.cpp (is_conditional_expression_true):
Parenthesize formally complex expressions.
commit 5645673e534ac879581df0f8e1de17cdbb08f17a
Author: G. Branden Robinson <[email protected]>
Date: Sun Nov 2 08:17:12 2025 -0600
[groff]: Unit-test logical predicates.
* src/roff/groff/tests/logical-predicates-work.sh: Test behavior of
logical predicates (the first argument to `if`, `ie`, and `while`
requests).
* src/roff/groff/groff.am (groff_TESTS): Run test.
Test fails at this commit, exposing a regression I introduced in commit
fb6fdbd9d1, 2024-11-06.
commit d30144894f60bcb3f1c88d499e186d17c3a13c58
Author: G. Branden Robinson <[email protected]>
Date: Fri Oct 31 22:27:29 2025 -0500
Revert "[troff]: Allow more delimiters in compat mode."
This reverts commit fb6fdbd9d174262ab57572bf095100459b589a66.
This change begins resolving Savannah #67408.
Tests fail at this commit:
src/roff/groff/tests/check-delimiter-validity.sh
src/roff/groff/tests/logical-predicates-work.sh
commit 9c2fa7853d82eb5e1f4c524218cc08448e22bf44
Author: G. Branden Robinson <[email protected]>
Date: Fri Oct 31 22:38:11 2025 -0500
[groff]: Expand delimiter tests in compat mode.
* src/roff/groff/tests/check-delimiter-validity.sh: Expand test coverage
of delimiter usage in compatibility mode to account for the three
different contexts in which delimiters can occur (and consequently the
three different subsets of Unicode Basic Latin that are valid as
delimiters in AT&T troff).
Continues fixing Savannah #67408.
Tests fail at this commit:
src/roff/groff/tests/check-delimiter-validity.sh
src/roff/groff/tests/logical-predicates-work.sh
commit 8b83fd3dd84e02a134d3c35619fd8d14a225039a
Author: G. Branden Robinson <[email protected]>
Date: Sun Nov 2 09:47:42 2025 -0600
[troff]: Fix Savannah #67408.
As I've observed before in the groff 1.24 development cycle, the
delimiter situation is a mess. AT&T troff actually has three different,
context-dependent sets of delimiters; getting too adventurous, though,
leads to core dumps, as with `\D0l 1 20' or `.if %0%0% .tm true`. Last
November, I attempted to streamline groff's delimiter handling, but
inadvertently broke use of compatibility mode. I still think it's
valuable for GNU troff users to be able to rely upon a single set of
delimiters when not exercising AT&T compatibility mode, so change the
formatter to handle four cases of delimiter context: "groff" (not in
compatibility mode), AT&T string expressions (as used in `\o` or `\b` or
the `tl` request), AT&T numeric expressions (`\s`, the first argument to
`\l` or `\L`), and output comparison operators.
* src/roff/troff/token.h: Introduce new `delimiter_context` enumerated
type.
(class token): Add parameter to `is_usable_as_delimiter()` member
function, defaulting its value to `DELIMITER_GROFF_EXPRESSION` since
we expect that to be the most common case.
* src/roff/troff/input.cpp (is_usable_as_delimiter): Implement the three
special cases for AT&T troff compatibility.
(do_overstrike)
(do_bracket)
(do_name_test)
(do_expr_test)
(do_zero_width_output)
(get_line_arg)
(read_size)
(do_register)
(do_width)
(do_device_extension)
(read_drawing_command)
(read_delimited_number): Distinguish compatibility mode. If in it and
given invalid delimiter, throw warning in category "delim" and unwind
the operation, behaving more like AT&T troff. (Outside of
compatibility mode, GNU troff uses the delimiter anyway, but warns of
its ambiguity.)
(is_conditional_expression_true): Refactor, introducing new Boolean
local variable `perform_output_comparison`. Throw syntax warning if
`v` conditional operator used in compatibility mode, as no variant of
AT&T troff available to me recognizes it. Distinguish compatibility
mode once the letteral conditional expression operators are ruled out.
Fixes <https://savannah.gnu.org/bugs/?67408>.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67408>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
