Fixing a bug in regexp-match not properly matching to the end of the string.

This commit is contained in:
Alex Shinn 2013-07-24 22:03:43 +09:00
parent 205c60a807
commit 781c7b45b0
2 changed files with 5 additions and 4 deletions

View file

@ -397,9 +397,10 @@
;; Terminate when the string is done or there are no more
;; searchers. If we terminate prematurely and are not
;; searching, return false.
(and (or search? (string-cursor>=? i end))
(searcher? (cdr accept))
(searcher-matches (cdr accept))))
(and (searcher? (cdr accept))
(let ((matches (searcher-matches (cdr accept))))
(and (or search? (>= (rx-match-ref matches 1) end))
(searcher-matches (cdr accept))))))
(else
;; Otherwise advance normally.
(let ((ch (string-cursor-ref str i))

View file

@ -6,7 +6,7 @@
rx-match? rx-match-num-matches
rx-match-submatch rx-match-submatch/list
rx-match->list rx-match->sexp)
(import (scheme base) (srfi 9) (srfi 33) (srfi 38) (srfi 69))
(import (srfi 9) (srfi 33) (srfi 38) (srfi 69))
;; Chibi's char-set library is more factored than SRFI-14.
(cond-expand
(chibi