X-Git-Url: http://git.kpe.io/?p=puri.git;a=blobdiff_plain;f=src.lisp;h=ff4cd44b7c8dd9153f9d9d6a0909cd51cfd7c7f7;hp=426270158992aa6587abb94a12769452991f319f;hb=bfb444f6454719a1f312b17a45eeb7e38f94767a;hpb=59760539abefec1794539a587e007870670811ce diff --git a/src.lisp b/src.lisp index 4262701..ff4cd44 100644 --- a/src.lisp +++ b/src.lisp @@ -22,7 +22,7 @@ ;; Original version from ACL 6.1: ;; uri.cl,v 2.3.6.4.2.1 2001/08/09 17:42:39 layer ;; -;; $Id: src.lisp,v 1.7 2003/07/19 20:32:48 kevin Exp $ +;; $Id: src.lisp,v 1.10 2003/07/20 21:03:54 kevin Exp $ (defpackage #:puri (:use #:cl) @@ -55,16 +55,15 @@ #:uri= #:intern-uri #:unintern-uri - #:do-all-uris)) + #:do-all-uris -(in-package #:puri) + #:uri-parse-error ;; Added by KMR + )) -(eval-when (:compile-toplevel) - (declaim (optimize (speed 3)))) +(in-package #:puri) +(eval-when (:compile-toplevel) (declaim (optimize (speed 3)))) -#-(or allegro lispworks) -(define-condition parse-error (error) ()) #-allegro (defun parse-body (forms &optional env) @@ -93,16 +92,25 @@ (lisp::shrink-vector str size) #+lispworks (system::shrink-vector$vector str size) - #+(or allegro cmu sbcl lispworks) - str - #-(or allegro cmu sbcl lispworks) - (subseq str 0 size)) + #+scl + (common-lisp::shrink-vector str size) + #-(or allegro cmu lispworks sbcl scl) + (setq str (subseq str 0 size)) + str) -#-allegro +;; KMR: Added new condition to handle cross-implementation variances +;; in the parse-error condition many implementations define + +(define-condition uri-parse-error (parse-error) + ((fmt-control :initarg :fmt-control :accessor fmt-control) + (fmt-arguments :initarg :fmt-arguments :accessor fmt-arguments )) + (:report (lambda (c stream) + (format stream "Parse error:") + (apply #'format stream (fmt-control c) (fmt-arguments c))))) + (defun .parse-error (fmt &rest args) - (error (make-condition 'parse-error :format-control fmt - :format-arguments args))) + (error 'uri-parse-error :fmt-control fmt :fmt-arguments args)) #-allegro (defun internal-reader-error (stream fmt &rest args) @@ -112,7 +120,6 @@ #+allegro (eval-when (:compile-toplevel :load-toplevel :execute) (import '(excl:*current-case-mode* excl:delimited-string-to-list - excl::.parse-error excl::parse-body excl::internal-reader-error excl:if*)))