Revision: 4214
Author: edi
URL: http://bknr.net/trac/changeset/4214
Shadow Chunga symbols
U trunk/thirdparty/drakma/conditions.lisp
U trunk/thirdparty/drakma/packages.lisp
Modified: trunk/thirdparty/drakma/conditions.lisp
===================================================================
--- trunk/thirdparty/drakma/conditions.lisp 2009-02-09 14:52:07 UTC (rev 4213)
+++ trunk/thirdparty/drakma/conditions.lisp 2009-02-09 14:53:01 UTC (rev 4214)
@@ -58,7 +58,8 @@
(define-condition parameter-error (drakma-simple-error)
()
- (:documentation "Signalled if a function was called with inconsistent or illegal parameters."))
+ (:documentation "Signalled if a function was called with
+inconsistent or illegal parameters."))
(defun parameter-error (format-control &rest format-arguments)
"Signals an error of type PARAMETER-ERROR with the provided
Modified: trunk/thirdparty/drakma/packages.lisp
===================================================================
--- trunk/thirdparty/drakma/packages.lisp 2009-02-09 14:52:07 UTC (rev 4213)
+++ trunk/thirdparty/drakma/packages.lisp 2009-02-09 14:53:01 UTC (rev 4214)
@@ -33,6 +33,7 @@
(:use :cl :puri :flexi-streams :chunga)
;; the variable defined in the ASDF system definition
(:import-from :drakma-asd :*drakma-version-string*)
+ (:shadow :syntax-error :parameter-error)
(:export :*allow-dotless-cookie-domains-p*
:*body-format-function*
:*drakma-default-external-format*
Revision: 4212
Author: edi
URL: http://bknr.net/trac/changeset/4212
Conditions
U trunk/thirdparty/chunga/CHANGELOG.txt
U trunk/thirdparty/chunga/chunga.asd
U trunk/thirdparty/chunga/doc/index.html
U trunk/thirdparty/chunga/packages.lisp
U trunk/thirdparty/chunga/read.lisp
U trunk/thirdparty/chunga/streams.lisp
Modified: trunk/thirdparty/chunga/CHANGELOG.txt
===================================================================
--- trunk/thirdparty/chunga/CHANGELOG.txt 2009-02-09 14:16:22 UTC (rev 4211)
+++ trunk/thirdparty/chunga/CHANGELOG.txt 2009-02-09 14:50:22 UTC (rev 4212)
@@ -1,6 +1,7 @@
Version 1.0.0
2009-02-10
Switched to binary streams underneath and got rid of FLEXI-STREAMS dependency
+Added conditions
Exported (an improved version of) AS-KEYWORD
Added WITH-CHARACTER-STREAM-SEMANTICS
Modified: trunk/thirdparty/chunga/chunga.asd
===================================================================
--- trunk/thirdparty/chunga/chunga.asd 2009-02-09 14:16:22 UTC (rev 4211)
+++ trunk/thirdparty/chunga/chunga.asd 2009-02-09 14:50:22 UTC (rev 4212)
@@ -35,6 +35,7 @@
(:file "specials")
(:file "util")
(:file "known-words")
+ (:file "conditions")
(:file "read")
(:file "streams")
(:file "input")
Modified: trunk/thirdparty/chunga/doc/index.html
===================================================================
--- trunk/thirdparty/chunga/doc/index.html 2009-02-09 14:16:22 UTC (rev 4211)
+++ trunk/thirdparty/chunga/doc/index.html 2009-02-09 14:50:22 UTC (rev 4212)
@@ -72,6 +72,11 @@
</ol>
<li><a href="#conditions">Conditions</a>
<ol>
+ <li><a href="#chunga-condition"><code>chunga-condition</code></a>
+ <li><a href="#chunga-error"><code>chunga-error</code></a>
+ <li><a href="#chunga-warning"><code>chunga-warning</code></a>
+ <li><a href="#syntax-error"><code>syntax-error</code></a>
+ <li><a href="#parameter-error"><code>parameter-error</code></a>
<li><a href="#input-chunking-body-corrupted"><code>input-chunking-body-corrupted</code></a>
<li><a href="#input-chunking-unexpected-end-of-file"><code>input-chunking-unexpected-end-of-file</code></a>
</ol>
@@ -342,9 +347,69 @@
<h4><a name="conditions" class=none>Conditions</a></h4>
-Here are two conditions which might be signaled if something bad
-happens while reading from a chunked stream:
+Here are conditions which might be signalled if something bad happens
+with a chunked stream.
+<!-- Entry for CHUNGA-CONDITION -->
+
+<p><br>[Condition]
+<br><a class=none name="chunga-condition"><b>chunga-condition</b></a>
+
+<blockquote><br>
+All conditions signalled by Chunga are of this type. This is a subtype of <a href="http://www.lispworks.com/documentation/HyperSpec/Body/e_cnd.htm"><code>CONDITION</code></a>.
+</blockquote>
+
+<!-- End of entry for CHUNGA-CONDITION -->
+
+<!-- Entry for CHUNGA-ERROR -->
+
+<p><br>[Error]
+<br><a class=none name="chunga-error"><b>chunga-error</b></a>
+
+<blockquote><br>
+All errors signalled by Chunga are of this type. This is a subtype of <a href="#chunga-condition"><code>CHUNGA-CONDITION</code></a> and of
+<a href="http://www.lispworks.com/documentation/HyperSpec/Body/e_stm_er.htm"><code>STREAM-ERROR</code></a>,
+so <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stm_er.htm"><code>STREAM-ERROR-STREAM</code></a>
+can be used to access the offending stream.
+</blockquote>
+
+<!-- End of entry for CHUNGA-ERROR -->
+
+<!-- Entry for CHUNGA-WARNING -->
+
+<p><br>[Warning]
+<br><a class=none name="chunga-warning"><b>chunga-warning</b></a>
+
+<blockquote><br>
+All warnings signalled by Chunga are of this type. This is a subtype of <a href="#chunga-condition"><code>CHUNGA-CONDITION</code></a> and of <a href="http://www.lispworks.com/documentation/HyperSpec/Body/e_warnin.htm"><code>WARNING</code></a>.
+</blockquote>
+
+<!-- End of entry for CHUNGA-WARNING -->
+
+<!-- Entry for SYNTAX-ERROR -->
+
+<p><br>[Error]
+<br><a class=none name="syntax-error"><b>syntax-error</b></a>
+
+<blockquote><br> An error of this type is signalled if Chunga
+encounters wrong or unknown syntax when reading data. This is a
+subtype of <a href="#chunga-error"><code>CHUNGA-ERROR</code></a>.
+</blockquote>
+
+<!-- End of entry for SYNTAX-ERROR -->
+
+<!-- Entry for PARAMETER-ERROR -->
+
+<p><br>[Error]
+<br><a class=none name="parameter-error"><b>parameter-error</b></a>
+
+<blockquote><br> An error of this type is signalled if a function was
+called with inconsistent or illegal parameters. This is a subtype
+of <a href="#chunga-error"><code>CHUNGA-ERROR</code></a>.
+</blockquote>
+
+<!-- End of entry for PARAMETER-ERROR -->
+
<!-- Entry for INPUT-CHUNKING-BODY-CORRUPTED -->
<p><br>[Condition type]<br><a class=none name='input-chunking-body-corrupted'><b>input-chunking-body-corrupted</b></a>
@@ -353,11 +418,7 @@
A condition of this type is signaled if an
unexpected character (octet) is read while reading from a
<a href="#stream">chunked stream</a> with input chunking enabled. This is a subtype of
-<a
-href="http://www.lispworks.com/documentation/HyperSpec/Body/e_stm_er.htm"><code>STREAM-ERROR</code></a>,
-so <a
-href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stm_er.htm"><code>STREAM-ERROR-STREAM</code></a>
-can be used to access the offending stream.
+<a href="#chunga-error"><code>CHUNGA-ERROR</code></a>.
</blockquote>
@@ -372,11 +433,7 @@
A condition of this type is signaled if we
reach an unexpected EOF on a <a href="#stream">chunked stream</a> with input chunking
enabled. This is a subtype of
-<a
-href="http://www.lispworks.com/documentation/HyperSpec/Body/e_stm_er.htm"><code>STREAM-ERROR</code></a>,
-so <a
-href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stm_er.htm"><code>STREAM-ERROR-STREAM</code></a>
-can be used to access the offending stream.
+<a href="#chunga-error"><code>CHUNGA-ERROR</code></a>.
</blockquote>
Modified: trunk/thirdparty/chunga/packages.lisp
===================================================================
--- trunk/thirdparty/chunga/packages.lisp 2009-02-09 14:16:22 UTC (rev 4211)
+++ trunk/thirdparty/chunga/packages.lisp 2009-02-09 14:50:22 UTC (rev 4212)
@@ -39,6 +39,8 @@
:assert-char
:as-keyword
:as-capitalized-string
+ :chunga-error
+ :chunga-warning
:chunked-input-stream
:chunked-input-stream-extensions
:chunked-input-stream-trailers
@@ -58,6 +60,7 @@
:read-name-value-pairs
:read-token
:skip-whitespace
+ :syntax-error
:trim-whitespace
:with-character-stream-semantics))
Modified: trunk/thirdparty/chunga/read.lisp
===================================================================
--- trunk/thirdparty/chunga/read.lisp 2009-02-09 14:16:22 UTC (rev 4211)
+++ trunk/thirdparty/chunga/read.lisp 2009-02-09 14:50:22 UTC (rev 4212)
@@ -29,17 +29,23 @@
(in-package :chunga)
-(defun signal-unexpected-chars (last-char expected-chars)
+(defun signal-unexpected-chars (stream last-char expected-chars)
"Signals an error that LAST-CHAR was read although one of
-EXPECTED-CHARS was expected. \(Note that EXPECTED-CHARS,
-despites its name, can also be a single character instead of a
-list). Uses *CURRENT-ERROR-MESSAGE* if it's not NIL, or calls
-*CURRENT-ERROR-FUNCTION* otherwise."
+EXPECTED-CHARS was expected. \(Note that EXPECTED-CHARS, despites its
+name, can also be a single character instead of a list). Calls
+*CURRENT-ERROR-FUNCTION* if it's not NIL, or uses
+*CURRENT-ERROR-MESSAGE* otherwise."
(cond (*current-error-function*
(funcall *current-error-function* last-char expected-chars))
- (*current-error-message*
- (error "~@[~A~%~]~:[End of file~;Read character ~:*~S~], but expected ~:[a member of ~S~;~S~]."
- *current-error-message* last-char (atom expected-chars) expected-chars))))
+ (t
+ (error 'syntax-error
+ :stream stream
+ :format-control "~@[~A~%~]~:[End of file~;Read character ~:*~S~], ~
+but expected ~:[a member of ~S~;~S~]."
+ :format-arguments (list *current-error-message*
+ last-char
+ (atom expected-chars)
+ expected-chars)))))
(defun charp (char)
"Returns true if the Lisp character CHAR is a CHAR according to RFC 2616."
@@ -73,7 +79,7 @@
character EXPECTED-CHAR. Signals an error otherwise."
(let ((char (read-char* stream)))
(unless (and char (char= char expected-char))
- (signal-unexpected-chars char expected-char))
+ (signal-unexpected-chars stream char expected-char))
char))
(defun assert-crlf (stream)
@@ -170,7 +176,10 @@
Returns NIL if LINE consists solely of whitespace."
(unless (zerop (length (trim-whitespace line)))
(let ((colon-pos (or (position #\: line :test #'char=)
- (error "Couldn't find colon in header line ~S." line))))
+ (error 'syntax-error
+ :stream stream
+ :format-control "Couldn't find colon in header line ~S."
+ :format-arguments (list line)))))
(cons (as-keyword (subseq line 0 colon-pos))
(trim-whitespace (subseq line (1+ colon-pos)))))))
(add-header (pair)
@@ -231,7 +240,7 @@
(#\Return (assert-char stream #\Linefeed)
(let ((char (read-char* stream)))
(unless (whitespacep char)
- (signal-unexpected-chars char '(#\Space #\Tab)))))
+ (signal-unexpected-chars stream char '(#\Space #\Tab)))))
(otherwise (write-char char out))))))
(defun read-cookie-value (stream &key name separators)
Modified: trunk/thirdparty/chunga/streams.lisp
===================================================================
--- trunk/thirdparty/chunga/streams.lisp 2009-02-09 14:16:22 UTC (rev 4211)
+++ trunk/thirdparty/chunga/streams.lisp 2009-02-09 14:50:22 UTC (rev 4212)
@@ -110,40 +110,16 @@
(close real-stream :abort abort))
(t nil))))
-(define-condition input-chunking-unexpected-end-of-file (stream-error)
- ()
- (:documentation "A condition of this type is signaled if we
-reach an unexpected EOF on a chunked stream with input chunking
-enabled. This is a subtype of STREAM-ERROR, so
-STREAM-ERROR-STREAM can be used to access the offending
-stream."))
-
-(define-condition input-chunking-body-corrupted (stream-error)
- ((last-char :initarg :last-char
- :documentation "The \(unexpected) character which was read.")
- (expected-chars :initarg :expected-chars
- :documentation "The characters which were
-expected. A list of characters or one single character."))
- (:report (lambda (condition stream)
- (with-slots (last-char expected-chars)
- condition
- (format stream "Chunked stream ~S seems to be corrupted.
-Read character ~S, but expected ~:[a member of ~S~;~S~]."
- (stream-error-stream condition)
- last-char (atom expected-chars) expected-chars))))
- (:documentation "A condition of this type is signaled if an
-unexpected character \(octet) is read while reading from a
-chunked stream with input chunking enabled. This is a subtype of
-STREAM-ERROR, so STREAM-ERROR-STREAM can be used to access the
-offending stream."))
-
(defun make-chunked-stream (stream)
"Creates and returns a chunked stream \(a stream of type
CHUNKED-STREAM) which wraps STREAM. STREAM must be an open
binary stream."
(unless (and (streamp stream)
(open-stream-p stream))
- (error "~S should have been an open stream." stream))
+ (error 'parameter-error
+ :stream stream
+ :format-control "~S should have been an open stream."
+ :format-arguments (list stream)))
(make-instance ;; actual type depends on STREAM
(cond ((and (input-stream-p stream)
(output-stream-p stream))
Revision: 4209
Author: edi
URL: http://bknr.net/trac/changeset/4209
Forgot version string
U trunk/thirdparty/drakma/drakma.asd
Modified: trunk/thirdparty/drakma/drakma.asd
===================================================================
--- trunk/thirdparty/drakma/drakma.asd 2009-02-09 12:15:51 UTC (rev 4208)
+++ trunk/thirdparty/drakma/drakma.asd 2009-02-09 13:43:39 UTC (rev 4209)
@@ -38,7 +38,7 @@
(in-package :drakma-asd)
-(defvar *drakma-version-string* "0.11.5"
+(defvar *drakma-version-string* "1.0.0"
"Drakma's version number as a string.")
;; we export its name so we can import it later
Revision: 4207
Author: hans
URL: http://bknr.net/trac/changeset/4207
Specialize some arguments on type T to silence CCL warnings.
U trunk/thirdparty/cl-ppcre/convert.lisp
Modified: trunk/thirdparty/cl-ppcre/convert.lisp
===================================================================
--- trunk/thirdparty/cl-ppcre/convert.lisp 2009-02-09 12:15:01 UTC (rev 4206)
+++ trunk/thirdparty/cl-ppcre/convert.lisp 2009-02-09 12:15:29 UTC (rev 4207)
@@ -325,7 +325,7 @@
(:documentation "Helper function for CONVERT-AUX which converts
parse trees which are conses and dispatches on TOKEN which is the
first element of the parse tree.")
- (:method (token parse-tree &key)
+ (:method (token (parse-tree t) &key)
(signal-syntax-error "Unknown token ~A in parse-tree." token)))
(defmethod convert-compound-parse-tree ((token (eql :sequence)) parse-tree &key)
Revision: 4206
Author: hans
URL: http://bknr.net/trac/changeset/4206
Specialize some arguments on type T to silence CCL warnings.
U trunk/thirdparty/chunga/input.lisp
U trunk/thirdparty/chunga/output.lisp
Modified: trunk/thirdparty/chunga/input.lisp
===================================================================
--- trunk/thirdparty/chunga/input.lisp 2009-02-09 12:14:17 UTC (rev 4205)
+++ trunk/thirdparty/chunga/input.lisp 2009-02-09 12:15:01 UTC (rev 4206)
@@ -29,15 +29,15 @@
(in-package :chunga)
-(defmethod chunked-input-stream-extensions (object)
+(defmethod chunked-input-stream-extensions ((object t))
"The default method which always returns the empty list."
nil)
-(defmethod chunked-input-stream-trailers (object)
+(defmethod chunked-input-stream-trailers ((object t))
"The default method which always returns the empty list."
nil)
-(defmethod chunked-stream-input-chunking-p (object)
+(defmethod chunked-stream-input-chunking-p ((object t))
"The default method for all objects which are not of type
CHUNKED-INPUT-STREAM."
nil)
Modified: trunk/thirdparty/chunga/output.lisp
===================================================================
--- trunk/thirdparty/chunga/output.lisp 2009-02-09 12:14:17 UTC (rev 4205)
+++ trunk/thirdparty/chunga/output.lisp 2009-02-09 12:15:01 UTC (rev 4206)
@@ -29,7 +29,7 @@
(in-package :chunga)
-(defmethod chunked-stream-output-chunking-p (object)
+(defmethod chunked-stream-output-chunking-p ((object t))
"The default method for all objects which are not of type
CHUNKED-OUTPUT-STREAM."
nil)