Fix regexp-match/fail-without-reading -- don't fail if some subpattern didn't
match so its info was #f instead of a pair. original commit: 79c4f331d9e9c801a7e09023543fcd12ba537c74
This commit is contained in:
parent
98ae6cb185
commit
5bd7d3925b
|
@ -137,13 +137,13 @@
|
|||
(let ([m (regexp-match-peek-positions pattern input-port start-k end-k)])
|
||||
(and m
|
||||
;; What happens if someone swipes our chars before we can get them?
|
||||
(begin
|
||||
(let ([drop (caar m)])
|
||||
;; drop prefix before match:
|
||||
(read-string (caar m) input-port)
|
||||
(let ([s (read-string (- (cdar m) (caar m)) input-port)])
|
||||
(read-string drop input-port)
|
||||
(let ([s (read-string (- (cdar m) drop) input-port)])
|
||||
(cons s
|
||||
(map (lambda (p)
|
||||
(substring s (- (car p) (caar m)) (- (cdr p) (caar m))))
|
||||
(and p (substring s (- (car p) drop) (- (cdr p) drop))))
|
||||
(cdr m)))))))))
|
||||
|
||||
;; Helper function for the regexp functions below.
|
||||
|
|
Loading…
Reference in New Issue
Block a user