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