From: Arthur Gleckler Date: Wed, 28 Aug 1991 02:54:31 +0000 (+0000) Subject: Correct bug that assumed that regular expression registers might X-Git-Tag: 20090517-FFI~10282 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=9d6397f0632361df86deb184ce1924c73c6e51d9;p=mit-scheme.git Correct bug that assumed that regular expression registers might contain negative numbers, but never false. --- diff --git a/v7/src/edwin/regexp.scm b/v7/src/edwin/regexp.scm index 8371a3317..4a2f50c66 100644 --- a/v7/src/edwin/regexp.scm +++ b/v7/src/edwin/regexp.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/regexp.scm,v 1.58 1991/05/17 18:38:32 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/regexp.scm,v 1.59 1991/08/28 02:54:31 arthur Exp $ ;;; ;;; Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology ;;; @@ -58,13 +58,13 @@ (define (re-match-start i) (guarantee-re-register i 'RE-MATCH-START) (let ((index (re-match-start-index i))) - (and (not (negative? index)) + (and index (make-mark (re-match-group) index)))) (define (re-match-end i) (guarantee-re-register i 'RE-MATCH-END) (let ((index (re-match-end-index i))) - (and (not (negative? index)) + (and index (make-mark (re-match-group) index)))) (define (guarantee-re-register i operator) @@ -163,8 +163,8 @@ (char->digit char)))) (cond ((not n) (string char)) - ((negative? (re-match-start-index n)) - (string #\\ char)) + ((not (re-match-start-index n)) + (error "No match for register" n)) (else (extract-string (re-match-start n) @@ -175,6 +175,7 @@ (list (substring pattern start end)))))) pattern))) + (define (delete-match) (let ((start (re-match-start 0))) (delete-string start (re-match-end 0))