;; 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.8 2003/07/20 16:25:21 kevin Exp $
+;; $Id$
(defpackage #:puri
(:use #:cl)
+ #-allegro (:nicknames #:net.uri)
(:export
#:uri ; the type and a function
#:uri-p
#: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))))
#-allegro
(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))
-
-
-#-(or allegro lispworks)
-(define-condition parse-error (error)
- ((fmt-control :initarg :fmt-control
- :reader fmt-control)
- (fmt-args :initarg :fmt-args
- :reader fmt-args))
+ #+scl
+ (common-lisp::shrink-vector str size)
+ #-(or allegro cmu lispworks sbcl scl)
+ (setq str (subseq str 0 size))
+ str)
+
+
+;; 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-args c)))))
+ (format stream "Parse error:")
+ (apply #'format stream (fmt-control c) (fmt-arguments c)))))
-#-allegro
(defun .parse-error (fmt &rest args)
- (error (make-condition 'parse-error :fmt-control fmt :fmt-args args)))
+ (error 'uri-parse-error :fmt-control fmt :fmt-arguments args))
#-allegro
(defun internal-reader-error (stream fmt &rest args)
#+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*)))