Grumble. Messing around while debugging problems caused by
authorChris Hanson <org/chris-hanson/cph>
Mon, 5 Feb 2001 21:47:30 +0000 (21:47 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 5 Feb 2001 21:47:30 +0000 (21:47 +0000)
incorrectly built bands.

v7/src/runtime/rgxcmp.scm

index f9155c93470c5fd7a8a6b9f6c8edd1b7d3e3634d..3e82d36372c5481e5468f2a6582247caad90fb81 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: rgxcmp.scm,v 1.111 2001/02/05 20:08:15 cph Exp $
+;;; $Id: rgxcmp.scm,v 1.112 2001/02/05 21:47:30 cph Exp $
 ;;;
 ;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology
 ;;;
       (let loop
          ((chars
            (if (input-match? (input-peek) #\])
-               (list (input-read!))
+               (begin (input-discard!) '(#\]))
                '())))
        (if (input-end?)
            (premature-end))
-       (if (input-match? (input-peek) #\])
-           (begin
-             (input-discard!)
-             (for-each
-              (lambda (char)
-                ((ucode-primitive re-char-set-adjoin!) charset
-                                                       (char->ascii char)))
-              (char-set-members
-               (re-compile-char-set (list->string (reverse! chars)) #f))))
-           (loop (cons (input-read!) chars))))
+       (let ((char (input-read!)))
+         (if (input-match? char #\])
+             (begin
+               (for-each
+                (lambda (char)
+                  ((ucode-primitive re-char-set-adjoin!) charset
+                                                         (char->ascii char)))
+                (char-set-members
+                 (re-compile-char-set (list->string (reverse! chars)) #f))))
+             (loop (cons char chars)))))
       (output-start! (if invert? re-code:not-char-set re-code:char-set))
       ;; Discard any bitmap bytes that are all 0 at the end of
       ;; the map.  Decrement the map-length byte too.