From: Chris Hanson Date: Wed, 17 Jan 2007 03:31:00 +0000 (+0000) Subject: Use new matching procedures. X-Git-Tag: 20090517-FFI~781 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=2fdd0b14bd9da431e041df47d448ccc479ecc75c;p=mit-scheme.git Use new matching procedures. --- diff --git a/v7/src/runtime/url.scm b/v7/src/runtime/url.scm index 09ad11f2a..4c02db291 100644 --- a/v7/src/runtime/url.scm +++ b/v7/src/runtime/url.scm @@ -1,6 +1,6 @@ #| -*-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, @@ -113,7 +113,7 @@ USA. (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 @@ -184,11 +184,11 @@ USA. (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)) @@ -200,11 +200,6 @@ USA. (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=?))) @@ -338,7 +333,7 @@ USA. ;; 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))) @@ -374,15 +369,9 @@ USA. (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)))