Update of bug #67718 (group groff):

                  Status:                    None => In Progress
             Assigned to:                    None => gbranden

    _______________________________________________________

Follow-up Comment #2:

I have it.

`define_class()` is gargantuan because it adds a new form of expression syntax
to the *roff language.  And there was a wart in it.


$ git diff
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 6236def1d..3222edb8e 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8540,9 +8540,13 @@ static void define_class_request()
   macro *m = new macro;
   (void) ci->set_macro(m);
   charinfo *child1 = 0 /* nullptr */, *child2 = 0 /* nullptr */;
+  bool just_chained_a_range_expression = false;
   while (!tok.is_newline() && !tok.is_eof()) {
     tok.skip();
     debug("GBR: define_class(): A: token is now %1", tok.description());
+    // Chained range expressions like
+    //   \[u3041]-\[u3096]-\[u30FF]
+    // are not valid.
     if ((child1 != 0 /* nullptr */) && (tok.ch() == '-')) {
       tok.next();
       debug("GBR: define_class(): B1: in a range expression");
@@ -8579,6 +8583,7 @@ static void define_class_request()
       debug("GBR: define_class() B3: adding range: %1-%2", u1, u2);
       ci->add_to_class(u1, u2);
       child1 = child2 = 0 /* nullptr */;
+      just_chained_a_range_expression = true;
     }
     else if (child1 != 0 /* nullptr */) {
       debug("GBR: define_class(): C1: child1 is not null but not processing a
range");
@@ -8617,6 +8622,12 @@ static void define_class_request()
        skip_line();
       break;
     }
+    if (just_chained_a_range_expression) {
+      // Throw away `child1` so we don't duplicatively add the second
+      // end point of a range as a singleton.  See Savannah #67718.
+      child1 = 0 /* nullptr */;
+      just_chained_a_range_expression = false;
+    }
   }
   if (child1 != 0 /* nullptr */) {
     if (child1->is_class()) {




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67718>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to