Hacks to fit in with the new SRE regexp system.
This commit is contained in:
parent
0d3f69124f
commit
64613d96db
14
scsh/fr.scm
14
scsh/fr.scm
|
@ -69,11 +69,15 @@
|
|||
|
||||
(define (->delim-matcher x)
|
||||
(if (procedure? x) x ; matcher proc
|
||||
;; The matcher proc.
|
||||
(lambda (s i)
|
||||
(cond ((regexp-search x s i) =>
|
||||
(lambda (m) (values (match:start m 0) (match:end m 0))))
|
||||
(else (values #f #f))))))
|
||||
(let ((re (cond ((string? x) (re-string x))
|
||||
((char-set? x) (re-char-set x))
|
||||
((char? x) (re-string (string x)))
|
||||
((regexp? x) x)
|
||||
(else (error "Illegal field-reader delimiter value" x)))))
|
||||
(lambda (s i)
|
||||
(cond ((regexp-search re s i) =>
|
||||
(lambda (m) (values (match:start m 0) (match:end m 0))))
|
||||
(else (values #f #f)))))))
|
||||
|
||||
;;; (infix-splitter [re num-fields handle-delim]) -> parser
|
||||
;;; (suffix-splitter [re num-fields handle-delim]) -> parser
|
||||
|
|
Loading…
Reference in New Issue