Paste number 51406: block/exception loops

Paste number 51406: block/exception loops
Pasted by: cgay
10 months, 2 weeks ago
#dylan | Context in IRC logs
Paste contents:
Raw Source | XML | Display As
Changing this:

    for (group-number from 0,
         pcre-group in pcre-groups)
      let our-group = regexp-match-group(match, group-number);
      check-equal(format-to-string("Match %s against %s -- group %d is the same",
                                   test-string, pattern, group-number),
                  our-group,
                  pcre-group);
    end;

to this:

    for (group-number from 0,
         pcre-group in pcre-groups)
      let our-group = block ()
                        regexp-match-group(match, group-number)
                      exception (ex :: <invalid-match-group>)
                        #f
                      end;
      check-equal(format-to-string("Match %s against %s -- group %d is the same",
                                   test-string, pattern, group-number),
                  our-group,
                  pcre-group);
    end;

causes an infinite loop.  No symbols for the looping frames.

This paste has no annotations.

Colorize as:
Show Line Numbers

Ads absolutely not by Google

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.