Changeset 263
- Timestamp:
- 08/23/04 14:11:47 (4 years ago)
- Files:
-
- trunk/thirdparty/cxml/cxml.asd (modified) (1 diff)
- trunk/thirdparty/cxml/dom/dom-sax.lisp (modified) (1 diff)
- trunk/thirdparty/cxml/runes/characters.lisp (modified) (1 diff)
- trunk/thirdparty/cxml/runes/runes.lisp (modified) (5 diffs)
- trunk/thirdparty/cxml/runes/syntax.lisp (modified) (1 diff)
- trunk/thirdparty/cxml/test/domtest.lisp (modified) (1 diff)
- trunk/thirdparty/cxml/xml/xml-parse.lisp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/thirdparty/cxml/cxml.asd
r254 r263 5 5 (:use :asdf :cl)) 6 6 (in-package :cxml-system) 7 8 ;; XXX das sollte natuerlich erst beim laden stattfinden 9 #+cmu 10 (require :gray-streams) 7 11 8 12 (defclass closure-source-file (cl-source-file) ()) trunk/thirdparty/cxml/dom/dom-sax.lisp
r253 r263 1 b(in-package :dom-impl)1 (in-package :dom-impl) 2 2 3 3 (defun dom:map-document trunk/thirdparty/cxml/runes/characters.lisp
r253 r263 135 135 (stringp object)) 136 136 137 (defun really-rod-p (object)138 (stringp object))139 140 137 (defun rod-subseq (source start &optional (end (length source))) 141 138 (unless (stringp source) trunk/thirdparty/cxml/runes/runes.lisp
r253 r263 90 90 (defun rod-downcase (rod) 91 91 ;; FIXME 92 (register-rod 93 (map '(simple-array (unsigned-byte 16) (*)) #'rune-downcase rod))) 92 (map '(simple-array (unsigned-byte 16) (*)) #'rune-downcase rod)) 94 93 95 94 (defun rod-upcase (rod) 96 95 ;; FIXME 97 (register-rod 98 (map '(simple-array (unsigned-byte 16) (*)) #'rune-upcase rod))) 96 (map '(simple-array (unsigned-byte 16) (*)) #'rune-upcase rod)) 99 97 100 98 (defsubst white-space-rune-p (char) … … 116 114 117 115 (defun rod (x) 118 (cond ((stringp x) ( register-rod (map 'rod #'char-code x)))116 (cond ((stringp x) (map 'rod #'char-code x)) 119 117 ((symbolp x) (rod (string x))) 120 118 ((characterp x) (rod (string x))) 121 ((vectorp x) ( register-rod (coerce x 'rod)))122 ((integerp x) ( register-rod (map 'rod #'identity (list x))))119 ((vectorp x) (coerce x 'rod)) 120 ((integerp x) (map 'rod #'identity (list x))) 123 121 (t (error "Cannot convert ~S to a ~S" x 'rod)))) 124 122 … … 145 143 146 144 (defsubst make-rod (size) 147 (let ((res (make-array size :element-type 'rune))) 148 (register-rod res) 149 res)) 145 (make-array size :element-type 'rune)) 150 146 151 147 (defun char-rune (char) … … 177 173 (defun rodp (object) 178 174 (typep object 'rod)) 179 180 (defun really-rod-p (object)181 (and (typep object 'rod)182 (really-really-rod-p object)))183 175 184 176 (defun rod-subseq (source start &optional (end (length source))) … … 221 213 (setf (%rune res i) (aref source (the fixnum (+ i start)))))))) 222 214 223 ;;; Support for telling ROD and arrays apart:224 225 #+CMU226 (progn227 (defvar *rod-hash-table*228 (make-array 5003 :initial-element nil)))229 230 (defun register-rod (rod)231 #+CMU232 (unless (really-really-rod-p rod)233 (push (ext:make-weak-pointer rod)234 (aref *rod-hash-table* (mod (cl::pointer-hash rod)235 (length *rod-hash-table*)))))236 rod)237 238 (defun really-really-rod-p (rod)239 #+CMU240 (find rod (aref *rod-hash-table* (mod (cl::pointer-hash rod)241 (length *rod-hash-table*)))242 :key #'ext:weak-pointer-value))243 244 #+CMU245 (progn246 (defun rod-hash-table-rehash ()247 (let* ((n 5003)248 (new (make-array n :initial-element nil)))249 (loop for bucket across *rod-hash-table* do250 (loop for item in bucket do251 (let ((v (ext:weak-pointer-value item)))252 (when v253 (push item (aref new (mod (cl::pointer-hash v) n)))))))254 (setf *rod-hash-table* new)))255 256 (defun rod-hash-after-gc-hook ()257 ;; hmm interesting question: should we rehash?258 (rod-hash-table-rehash))259 260 (pushnew 'rod-hash-after-gc-hook extensions:*after-gc-hooks*) )261 262 215 (defun rod< (rod1 rod2) 263 216 (do ((i 0 (+ i 1))) trunk/thirdparty/cxml/runes/syntax.lisp
r253 r263 179 179 (princ #\" stream)) 180 180 181 #-rune-is-character182 (set-pprint-dispatch '(satisfies really-rod-p) #'rod-printer)183 184 181 (set-dispatch-macro-character #\# #\" 'rod-reader) 185 186 #||187 (defun longish-array-p (arr)188 (and (arrayp arr)189 (> (array-total-size arr) 10)))190 191 (set-pprint-dispatch '(satisfies longish-array-p)192 #'(lambda (stream object)193 (let ((*print-array* nil)194 (*print-pretty* nil))195 (prin1 object stream))))196 ||#trunk/thirdparty/cxml/test/domtest.lisp
r253 r263 557 557 (bindings '()) 558 558 (code '())) 559 (declare (ignore title))560 559 (do-child-elements (e test) 561 560 (string-case (tag-name e) trunk/thirdparty/cxml/xml/xml-parse.lisp
r254 r263 147 147 ;; o xstreams auslagern, documententieren und dann auch in SGML und 148 148 ;; CSS parser verwenden. (halt alles was zeichen liest). 149 ::[ausgelagert sind sie; dokumentiert "so la la"; die Reintegration149 ;; [ausgelagert sind sie; dokumentiert "so la la"; die Reintegration 150 150 ;; in Closure ist ein ganz anderes Thema] 151 151 ;; … … 242 242 243 243 (defvar *ctx*) 244 245 ;; forward declaration for DEFVAR 246 (declaim (special *default-namespace-bindings*)) 244 247 245 248 (defstruct (context (:conc-name nil)) … … 2420 2423 (consume-token input))) 2421 2424 2422 ;; forward declaration for DEFVAR2423 (declaim (special *default-namespace-bindings*))2424 2425 2425 (defun p/document (input handler &key validate root) 2426 2426 (let ((*ctx* (make-context))
