diff --git a/gash/pattern.scm b/gash/pattern.scm index a8c17e5..a6e825d 100644 --- a/gash/pattern.scm +++ b/gash/pattern.scm @@ -234,11 +234,14 @@ source string is the only string that will match it." ((string-ends-with-part s part start i) (- i (vector-length part))) (else (loop (1- i)))))) -(define* (pattern-match? pattern str #:optional (start 0) - (end (string-length str)) - #:key explicit-initial-period?) +(define* (pattern-match? pattern str #:key explicit-initial-period?) "Check if @var{str} matches @var{pattern}." + ;; XXX: These used to be optional arguments, but Mes handles mixing + ;; optional and keyword arguments differently than Guile. + (define start 0) + (define end (string-length str)) + (define (parts-match? parts start) (match parts (() (= start end)) @@ -255,8 +258,7 @@ source string is the only string that will match it." (char=? (string-ref str start) #\.)) (match parts ((#(#\. _ ...) . _) - (pattern-match? pattern str start end - #:explicit-initial-period? #f)) + (pattern-match? pattern str #:explicit-initial-period? #f)) (_ #f)) (match parts (() (= start end))