Update of /project/cxml/cvsroot/cxml/xml
In directory common-lisp.net:/tmp/cvs-serv14107/xml
Modified Files:
package.lisp xml-name-rune-p.lisp xml-parse.lisp
Log Message:
- use trivial-gray-streams
- replaced dep-* files, since most of them were identical
Date: Sat Nov 26 22:48:25 2005
Author: dlichteblau
Index: cxml/xml/package.lisp
diff -u cxml/xml/package.lisp:1.2 cxml/xml/package.lisp:1.3
--- cxml/xml/package.lisp:1.2 Wed Apr 20 21:58:07 2005
+++ cxml/xml/package.lisp Sat Nov 26 22:48:25 2005
@@ -6,17 +6,7 @@
(in-package :cl-user)
(defpackage :cxml
- (:use :cl :runes :encoding)
- (:import-from #+sbcl :sb-gray
- #+allegro :excl
- #+cmu :ext
- #+clisp :gray
- #+openmcl :ccl
- #+lispworks :stream
- #-(or sbcl allegro cmu clisp openmcl lispworks) ...
- #:fundamental-binary-input-stream
- #-(or clisp openmcl) #:stream-read-sequence
- stream-read-byte)
+ (:use :cl :runes :encoding :trivial-gray-streams)
(:export
;; xstreams
#:make-xstream
Index: cxml/xml/xml-name-rune-p.lisp
diff -u cxml/xml/xml-name-rune-p.lisp:1.3 cxml/xml/xml-name-rune-p.lisp:1.4
--- cxml/xml/xml-name-rune-p.lisp:1.3 Wed Apr 20 21:58:07 2005
+++ cxml/xml/xml-name-rune-p.lisp Sat Nov 26 22:48:25 2005
@@ -11,7 +11,7 @@
(compile
nil
'(lambda ()
- (let ((*max* #xD800))
+ (let ((.max. #xD800))
(labels
((name-start-rune-p (rune)
(or (letter-rune-p rune)
@@ -207,7 +207,7 @@
(predicate-to-bv (p)
- (let ((r (make-array *max* :element-type 'bit :initial-element 0)))
+ (let ((r (make-array .max. :element-type 'bit :initial-element 0)))
(dotimes (i #x10000 r)
(when (funcall p i)
(setf (aref r i) 1))))) )
@@ -215,13 +215,13 @@
`(progn
(DEFINLINE NAME-RUNE-P (RUNE)
(SETF RUNE (RUNE-CODE RUNE))
- (AND (<= 0 RUNE ,*max*)
+ (AND (<= 0 RUNE ,.max.)
(LOCALLY (DECLARE (OPTIMIZE (SAFETY 0) (SPEED 3)))
(= 1 (SBIT ',(predicate-to-bv #'name-rune-p)
(THE FIXNUM RUNE))))))
(DEFINLINE NAME-START-RUNE-P (RUNE)
(SETF RUNE (RUNE-CODE RUNE))
- (AND (<= 0 RUNE ,*MAX*)
+ (AND (<= 0 RUNE ,.MAX.)
(LOCALLY (DECLARE (OPTIMIZE (SAFETY 0) (SPEED 3)))
(= 1 (SBIT ',(predicate-to-bv #'name-start-rune-p)
(THE FIXNUM RUNE)))))))) ))))
Index: cxml/xml/xml-parse.lisp
diff -u cxml/xml/xml-parse.lisp:1.6 cxml/xml/xml-parse.lisp:1.7
--- cxml/xml/xml-parse.lisp:1.6 Tue Aug 16 17:03:05 2005
+++ cxml/xml/xml-parse.lisp Sat Nov 26 22:48:25 2005
@@ -2608,7 +2608,7 @@
(if sax:*namespace-processing*
(p/element-ns input)
(p/element-no-ns input)))
-
+
(defun p/element-no-ns (input)
;; [39] element ::= EmptyElemTag | STag content ETag
(error "sorry, bitrot")
@@ -2660,14 +2660,16 @@
(error "Expecting element, got ~S." cat)))))
(undeclare-namespaces ns-decls))
(validate-end-element *ctx* name)))
-
+
(defun perror (stream format-string &rest format-args)
(when (zstream-p stream)
(setf stream (car (zstream-input-stack stream))))
- (error "Parse error at line ~D column ~D: ~A"
- (xstream-line-number stream)
- (xstream-column-number stream)
- (apply #'format nil format-string format-args)))
+ (if stream
+ (error "Parse error at line ~D column ~D: ~?"
+ (xstream-line-number stream)
+ (xstream-column-number stream)
+ format-string format-args)
+ (apply #'error format-string format-args)))
(defun p/content (input)
;; [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
@@ -2988,7 +2990,8 @@
;; XXX encoding is mis-handled by this kind of stream
(make-rod-xstream (string-rod string)))
-(defclass octet-input-stream (fundamental-binary-input-stream)
+(defclass octet-input-stream
+ (trivial-gray-stream fundamental-binary-input-stream)
((octets :initarg :octets)
(pos :initform 0)))
@@ -3005,9 +3008,7 @@
(incf pos)))))
(defmethod stream-read-sequence
- #-lispworks ((stream octet-input-stream) sequence
- &optional (start 0) (end (length sequence)))
- #+lispworks ((stream octet-input-stream) sequence start end)
+ ((stream octet-input-stream) sequence start end &key &allow-other-keys)
(with-slots (octets pos) stream
(let* ((length (min (- end start) (- (length octets) pos)))
(end1 (+ start length))
@@ -3021,20 +3022,6 @@
(defun parse-octets (octets handler &rest args)
(apply #'parse-stream (make-octet-input-stream octets) handler args))
-
-;;;;
-
-#+allegro
-(defmacro sp (&body body)
- `(progn
- (prof:with-profiling (:type :space) .,body)
- (prof:show-flat-profile)))
-
-#+allegro
-(defmacro tm (&body body)
- `(progn
- (prof:with-profiling (:type :time) .,body)
- (prof:show-flat-profile)))
;;;;