Changeset 14263 in project


Ignore:
Timestamp:
04/15/09 23:21:01 (11 years ago)
Author:
sjamaan
Message:

Now, make use of the proper result of string-{search,match}-offsets so that string-{search,match}-positions propagate #f.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/utf8/trunk/utf8-support.scm

    r14262 r14263  
    595595(define (string-match-positions rx str . opt)
    596596  (let* ((size (byte-string-length str))
    597          (->pos (lambda (o) (utf8-offset->index str opt))))
    598     (map (lambda (x) (if (pair? x) (map ->pos x) x))
    599          (or (apply string-match-offsets rx str opt) '()))))
     597         (->pos (lambda (o) (utf8-offset->index str opt)))
     598         (offsets (apply string-match-offsets rx str opt)))
     599    (and offsets
     600         (map (lambda (x) (if (pair? x) (map ->pos x) x)) offsets))))
    600601
    601602(define (string-search-positions rx str . opt)
    602603  (let* ((size (byte-string-length str))
    603          (->pos (lambda (o) (utf8-offset->index str opt))))
    604     (map (lambda (x) (if (pair? x) (map ->pos x) x))
    605          (or (apply string-search-offsets rx str opt) '()))))
     604         (->pos (lambda (o) (utf8-offset->index str opt)))
     605         (offsets (apply string-search-offsets rx str opt)))
     606    (and offsets (map (lambda (x) (if (pair? x) (map ->pos x) x)) offsets))))
Note: See TracChangeset for help on using the changeset viewer.