original commit: 7da358f4d0c49fcca9081b0d8fa5abf90cefc8e8
This commit is contained in:
Matthew Flatt 2004-05-18 16:15:12 +00:00
parent de27c8ea0c
commit e468aeb397
2 changed files with 8 additions and 8 deletions

View File

@ -192,7 +192,7 @@
;; Not enough even in the special queue.
;; Read once and add it.
(let* ([t (make-bytes (min 4096 (+ sk (bytes-length s))))]
[r (read s)])
[r (read t)])
(cond
[(evt? r)
;; We can't deal with an event, so complain
@ -206,7 +206,7 @@
[else (let ([v (if (number? r)
(subbytes t 0 r)
r)])
(set-cdr! special-peeked-tail v)
(set-cdr! special-peeked-tail (cons v null))
;; Got something; now try again
(do-peek-it s skip unless-evt))]))]
[(eof-object? (car l))
@ -547,7 +547,7 @@
(let try-again ()
(let* ([progress-evt (port-progress-evt input-port)]
[m ((if poll?
regexp-match-peek-positions*
regexp-match-peek-positions-immediate
regexp-match-peek-positions)
pattern input-port 0 #f progress-evt)])
(cond

View File

@ -10,7 +10,7 @@
regexp-replace-quote
regexp-match*
regexp-match-positions*
regexp-match-peek-positions**
regexp-match-peek-positions*
regexp-split
regexp-match-exact?
regexp-match/fail-without-reading)
@ -316,12 +316,12 @@
(wrap regexp-match-positions* -regexp-match-positions*)
;; Returns all the positions at which the pattern matched.
(define -regexp-match-peek-positions**
(regexp-fn 'regexp-match-peek-positions**
(define -regexp-match-peek-positions*
(regexp-fn 'regexp-match-peek-positions*
;; success-k:
(lambda (expr string start end match-start match-end)
(cons (cons match-start match-end)
(regexp-match-peek-positions** expr string match-end end)))
(regexp-match-peek-positions* expr string match-end end)))
;; port-success-k --- use string case
#f
;; fail-k:
@ -331,7 +331,7 @@
#f
#f
#t))
(wrap regexp-match-peek-positions** -regexp-match-peek-positions**)
(wrap regexp-match-peek-positions* -regexp-match-peek-positions*)
;; Splits a string into a list by removing any piece which matches
;; the pattern.