gbranden pushed a commit to branch master
in repository groff.

commit ebf943aa66c3e54ddbed8e7ec0eccc6fc425b72c
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Apr 20 21:34:05 2026 -0500

    [troff]: `\}` now terminates syntax items.
    
    * src/roff/troff/token.h (token::is_terminator): Add `TOKEN_RIGHT_BRACE`
      to the set of tokens that can terminate a sequence of nonterminal
      symbols (such as the character sequence producing a *roff identifier,
      transparent throughput argument, contents of a string definition, or
      other string-like request argument like file names or system
      commands).
    
    Fixes <https://savannah.gnu.org/bugs/?68257>.
---
 ChangeLog              | 11 +++++++++++
 src/roff/troff/token.h | 12 ++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8a3f646c5..476409174 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2026-04-20  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/token.h (token::is_terminator): Add
+       `TOKEN_RIGHT_BRACE` to the set of tokens that can terminate a
+       sequence of nonterminal symbols (such as the character sequence
+       producing a *roff identifier, transparent throughput argument,
+       contents of a string definition, or other string-like request
+       argument like file names or system commands).
+
+       Fixes <https://savannah.gnu.org/bugs/?68257>.
+
 2026-04-20  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 49f4f09fd..ad809e1a1 100644
--- a/src/roff/troff/token.h
+++ b/src/roff/troff/token.h
@@ -297,8 +297,16 @@ inline bool token::is_zero_width_break()
 // or numeric expression?
 inline bool token::is_terminator()
 {
-  // TODO: Add right brace?  Left brace?  Tab?
-  return ((TOKEN_NEWLINE == type) || (TOKEN_EOF == type));
+  // Why other token types don't qualify as terminators (expand this
+  // list as necessary):
+  //
+  // 1.  A left brace escape sequence doesn't terminate the contents of
+  //     a string assignment in Plan 9 or DWB troffs, but is discarded,
+  //     instead of populating the string.
+  // 2.  A tab can populate string contents.
+  return ((TOKEN_NEWLINE == type)
+         || (TOKEN_EOF == type)
+         || (TOKEN_RIGHT_BRACE == type));
 }
 
 // Local Variables:

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to