Changeset 15375


Ignore:
Timestamp:
09/09/20 17:09:43 (3 years ago)
Author:
Mark Evenson
Message:

Untabify whitespace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/pathnames.lisp

    r15369 r15375  
    5555  (let ((testfunc (if ignore-case #'equalp #'equal)))
    5656    (labels ((split-string (delim str)
    57          (flet ((finder (char) (find char delim)))
    58     (loop
     57               (flet ((finder (char) (find char delim)))
     58                (loop
    5959                   :for x = (position-if-not #'finder str)
    6060                     :then (position-if-not #'finder str :start (or y (length str)))
    61        :for y = (position-if #'finder str :start (or x (length str)))
     61                   :for y = (position-if #'finder str :start (or x (length str)))
    6262                     :then (position-if #'finder str :start (or x (length str)))
    6363                   :while x
    64         :collect (subseq str x y))))
    65        (positions-larger (thing substrings previous-pos)
    66          (let ((new-pos (search (car substrings)
    67               thing
    68               :start2 previous-pos
    69               :test testfunc)))
    70     (or
    71       (not substrings)
    72       (and new-pos
    73            (>= new-pos previous-pos)
    74            (positions-larger thing
    75           (cdr substrings)
    76           new-pos))))))
     64                    :collect (subseq str x y))))
     65             (positions-larger (thing substrings previous-pos)
     66               (let ((new-pos (search (car substrings)
     67                                      thing
     68                                      :start2 previous-pos
     69                                      :test testfunc)))
     70                (or
     71                  (not substrings)
     72                  (and new-pos
     73                       (>= new-pos previous-pos)
     74                       (positions-larger thing
     75                                        (cdr substrings)
     76                                        new-pos))))))
    7777      (let ((split-result (split-string "*" wild)))
    78   (and (positions-larger thing split-result 0)
    79        (if (eql (elt wild 0) #\*)
    80     t
    81     (eql (search (first split-result) thing :test testfunc) 0))
    82        (if (eql (elt wild (1- (length wild))) #\*)
    83     t
    84     (let ((last-split-result (first (last split-result))))
    85        (eql (search last-split-result thing :from-end t
    86         :test testfunc)
    87       (- (length thing) (length last-split-result))))))))))
     78        (and (positions-larger thing split-result 0)
     79             (if (eql (elt wild 0) #\*)
     80                t
     81                (eql (search (first split-result) thing :test testfunc) 0))
     82             (if (eql (elt wild (1- (length wild))) #\*)
     83                t
     84                (let ((last-split-result (first (last split-result))))
     85                   (eql (search last-split-result thing :from-end t
     86                                :test testfunc)
     87                        (- (length thing) (length last-split-result))))))))))
    8888
    8989(defun component-match-p (thing wild ignore-case)
     
    9393         t)
    9494        ((and (stringp wild) (position #\* wild))
    95   (component-match-wild-p thing wild ignore-case))
     95        (component-match-wild-p thing wild ignore-case))
    9696        (ignore-case
    9797         (equalp thing wild))
Note: See TracChangeset for help on using the changeset viewer.