#| -*-Scheme-*-
-$Id: url.scm,v 1.48 2007/01/05 21:19:28 cph Exp $
+$Id: url.scm,v 1.49 2007/01/17 03:31:00 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
\f
(define (uri-scheme? object)
(and (interned-symbol? object)
- (complete-match matcher:scheme (symbol-name object))))
+ (*match-symbol matcher:scheme object)))
;;; A well-formed path is a list of N segments which is equivalent to
;;; a string in which there is a slash between each adjacent pair of
\f
(define (uri-userinfo? object)
(and (string? object)
- (complete-match parser:userinfo object)))
+ (*match-string parser:userinfo object)))
(define (uri-host? object)
(and (string? object)
- (complete-match matcher:host object)))
+ (*match-string matcher:host object)))
(define (uri-port? object)
(exact-nonnegative-integer? object))
(define-guarantee uri-host "URI host")
(define-guarantee uri-port "URI port")
-(define (complete-match matcher string #!optional start end)
- (let ((buffer (string->parser-buffer string start end)))
- (and (matcher buffer)
- (not (peek-parser-buffer-char buffer)))))
-
(define (uri=? u1 u2)
(eq? (->uri u1 'URI=?)
(->uri u2 'URI=?)))
;; Kludge: take advantage of fact that (NOT (NOT #!DEFAULT)).
(let* ((do-parse
(lambda (string)
- (let ((uri (complete-parse parser (string->parser-buffer string))))
+ (let ((uri (*parse-string parser string)))
(if (and (not uri) caller)
(error:bad-range-argument object caller))
uri)))
(default-object? start)
(default-object? end)
(hash-table/get interned-uris string #f))
- (complete-parse parser (string->parser-buffer string start end))
+ (*parse-string parser string start end)
(error:bad-range-argument string caller)))
-(define (complete-parse parser buffer)
- (let ((v (parser buffer)))
- (and v
- (not (peek-parser-buffer-char buffer))
- (vector-ref v 0))))
-
(define parse-uri
(*parser (encapsulate encapsulate-uri parser:uri-reference)))