minor things
svn: r8554
This commit is contained in:
parent
ab64d26a21
commit
6436441ebd
|
@ -121,7 +121,7 @@
|
||||||
end))
|
end))
|
||||||
(reverse
|
(reverse
|
||||||
(let loop ([acc '()] [start start] [end end])
|
(let loop ([acc '()] [start start] [end end])
|
||||||
(when (and (positive? start) (input-port? string) need-leftover?)
|
(when (and need-leftover? (positive? start) (input-port? string))
|
||||||
;; Skip start chars:
|
;; Skip start chars:
|
||||||
(let ([s (make-bytes 4096)])
|
(let ([s (make-bytes 4096)])
|
||||||
(let loop ([n 0])
|
(let loop ([n 0])
|
||||||
|
@ -185,14 +185,14 @@
|
||||||
;; success-k:
|
;; success-k:
|
||||||
(lambda (acc start end match-start match-end)
|
(lambda (acc start end match-start match-end)
|
||||||
(let ([acc (cons (cons match-start match-end) acc)])
|
(let ([acc (cons (cons match-start match-end) acc)])
|
||||||
(if (or (string? string) (bytes? string))
|
(if (input-port? string)
|
||||||
(loop acc match-end end)
|
|
||||||
;; Need to shift index of rest as reading, cannot do a
|
;; Need to shift index of rest as reading, cannot do a
|
||||||
;; tail call without adding another state variable to the loop:
|
;; tail call without adding another state variable to the loop:
|
||||||
(append (map (lambda (p)
|
(append (map (lambda (p)
|
||||||
(cons (+ match-end (car p)) (+ match-end (cdr p))))
|
(cons (+ match-end (car p)) (+ match-end (cdr p))))
|
||||||
(loop '() 0 (and end (- end match-end))))
|
(loop '() 0 (and end (- end match-end))))
|
||||||
acc))))
|
acc)
|
||||||
|
(loop acc match-end end))))
|
||||||
;; port-success-k: use string case
|
;; port-success-k: use string case
|
||||||
#f
|
#f
|
||||||
;; failure-k:
|
;; failure-k:
|
||||||
|
@ -235,7 +235,7 @@
|
||||||
(loop (cons leftovers acc) 0 new-end))
|
(loop (cons leftovers acc) 0 new-end))
|
||||||
;; failure-k:
|
;; failure-k:
|
||||||
(lambda (acc start end)
|
(lambda (acc start end)
|
||||||
(cons (sub buf start (or end (bstring-length buf))) acc))
|
(cons (if end (sub buf start end) (sub buf start)) acc))
|
||||||
;; port-fail-k
|
;; port-fail-k
|
||||||
(lambda (acc leftover) (cons leftover acc))
|
(lambda (acc leftover) (cons leftover acc))
|
||||||
#t
|
#t
|
||||||
|
|
Loading…
Reference in New Issue
Block a user