gbranden pushed a commit to branch master
in repository groff.

commit e1a730764be02d32b13a61dd32403cd041bada32
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Dec 19 11:09:29 2025 -0600

    [troff]: Fix Savannah #67770.
    
    Further conceal broken nested class feature.
    
    * src/roff/troff/charinfo.h (class charinfo): Annotate nonfunctional
      member variable.
    
    * src/roff/troff/input.cpp (define_class_request, charinfo::get_number)
      (charinfo::contains): Drop word "cyclic" from warning diagnostics in
      category "syntax"; we don't implemented nested classes _at all_; lack
      of support is not limited to non-cyclic ones.
    
      (charinfo::contains): `#if 0`-disable code that searches
      `nested_classes` member variable for matching `charinfo` objects.
    
    Fixes <https://savannah.gnu.org/bugs/?67770>.  Continues commit
    d330127900, 6 December.
---
 ChangeLog                 | 18 ++++++++++++++++++
 src/roff/troff/charinfo.h |  2 +-
 src/roff/troff/input.cpp  | 14 ++++++++------
 3 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0d5a12e66..1173ff2b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2025-12-19  G. Branden Robinson <[email protected]>
+
+       [troff]: Further conceal broken nested class feature.
+
+       * src/roff/troff/charinfo.h (class charinfo): Annotate
+       nonfunctional member variable.
+       * src/roff/troff/input.cpp (define_class_request)
+       (charinfo::get_number, charinfo::contains): Drop word "cyclic"
+       from warning diagnostics in category "syntax"; we don't
+       implemented nested classes _at all_; lack of support is not
+       limited to non-cyclic ones.
+       (charinfo::contains): `#if 0`-disable code that searches
+       `nested_classes` member variable for matching `charinfo`
+       objects.
+
+       Fixes <https://savannah.gnu.org/bugs/?67770>.  Continues commit
+       d330127900, 6 December.
+
 2025-12-18  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (token::description): Size the buffer
diff --git a/src/roff/troff/charinfo.h b/src/roff/troff/charinfo.h
index a149f8dd6..1a2b8bc9c 100644
--- a/src/roff/troff/charinfo.h
+++ b/src/roff/troff/charinfo.h
@@ -41,7 +41,7 @@ class charinfo : glyph {
   char_mode mode;
   // Unicode character classes
   std::vector<std::pair<int, int> > ranges;
-  std::vector<charinfo *> nested_classes;
+  std::vector<charinfo *> nested_classes; // XXX: see Savannah #67770
 public:
   // Values for the flags bitmask.  See groff manual, description of the
   // '.cflags' request.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index d9099803f..58c9df9d8 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8779,7 +8779,7 @@ static void define_class_request()
     else if (child1 != 0 /* nullptr */) {
       if (child1->is_class()) {
        if (ci == child1) {
-         warning(WARN_SYNTAX, "invalid cyclic class nesting");
+         warning(WARN_SYNTAX, "cannot nest character classes");
          skip_line();
          return;
        }
@@ -8820,7 +8820,7 @@ static void define_class_request()
   if (child1 != 0 /* nullptr */) {
     if (child1->is_class()) {
       if (ci == child1) {
-       warning(WARN_SYNTAX, "invalid cyclic class nesting");
+       warning(WARN_SYNTAX, "cannot nest character classes");
        skip_line();
        return;
       }
@@ -10877,7 +10877,7 @@ int charinfo::get_number()
 bool charinfo::contains(int c, bool already_called)
 {
   if (already_called) {
-    warning(WARN_SYNTAX, "cyclic nested class detected while processing"
+    warning(WARN_SYNTAX, "nested class detected while processing"
            " character code %1", c);
     return false;
   }
@@ -10894,6 +10894,8 @@ bool charinfo::contains(int c, bool already_called)
     ++ranges_iter;
   }
 
+  // Nested classes don't work.  See Savannah #67770.
+#if 0
   std::vector<charinfo *>::const_iterator nested_iter;
   nested_iter = nested_classes.begin();
   while (nested_iter != nested_classes.end()) {
@@ -10901,6 +10903,7 @@ bool charinfo::contains(int c, bool already_called)
       return true;
     ++nested_iter;
   }
+#endif
 
   return false;
 }
@@ -10908,9 +10911,8 @@ bool charinfo::contains(int c, bool already_called)
 bool charinfo::contains(symbol s, bool already_called)
 {
   if (already_called) {
-    warning(WARN_SYNTAX,
-           "cyclic nested class detected while processing symbol %1",
-           s.contents());
+    warning(WARN_SYNTAX, "nested class detected while processing symbol"
+           " %1", s.contents());
     return false;
   }
   const char *unicode = glyph_name_to_unicode(s.contents());

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

Reply via email to