From dlichteblau at common-lisp.net Wed May 4 19:24:14 2005 From: dlichteblau at common-lisp.net (David Lichteblau) Date: Wed, 4 May 2005 21:24:14 +0200 (CEST) Subject: [closure-cvs] CVS update: closure/src/css/css-selector.lisp Message-ID: <20050504192414.456E488720@common-lisp.net> Update of /project/closure/cvsroot/closure/src/css In directory common-lisp.net:/tmp/cvs-serv16924 Modified Files: css-selector.lisp Log Message: funktion zum parsen von assignmen listen fuer style-attribute Date: Wed May 4 21:24:13 2005 Author: dlichteblau Index: closure/src/css/css-selector.lisp diff -u closure/src/css/css-selector.lisp:1.4 closure/src/css/css-selector.lisp:1.5 --- closure/src/css/css-selector.lisp:1.4 Sun Mar 13 19:00:58 2005 +++ closure/src/css/css-selector.lisp Wed May 4 21:24:13 2005 @@ -1,4 +1,4 @@ -;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CSS; Readtable: GLISP; Encoding: utf-8; -*- +;;; -*- Mode: Lisp; Syntax: Common-Lisp; Encoding: utf-8; -*- ;;; --------------------------------------------------------------------------- ;;; Title: CSS selectors ;;; [Split off from css-parse.lisp] @@ -28,7 +28,7 @@ ;;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -(in-package :CSS) +(in-package :css) (defun create-style-sheet (super-sheet &key (name "Anonymous style sheet") base-url @@ -435,19 +435,6 @@ (and r (cons (cons 'or (car r)) (cdr r))))) -(defun parse-media-type (string) - ;; xxx unicode! - (let ((r (parse-media-type-2 - (tokenize - (slurp - (cl-char-stream->gstream - (make-string-input-stream string))))))) - (cond ((and r (null (cdr r))) - (car r)) - (t - (warn "Bad media type: ~S." string) - nil)))) - (defun parse-import-rule (seq) (let ((toks (tokenize seq)) (media-type :all)) @@ -650,7 +637,7 @@ (tagbody loob (let ((a (q/simple-selector))) - (q/S*) + (q/s*) (push a res) (cond ((member (q/tok) '(:ident :hash :|.| :|[| :|:| :|*|)) (push 'ancestor res) @@ -809,6 +796,14 @@ (setf res (map 'vector #'+ res (css2-selector-specificity (cdr p))))))) res)) +(defun parse-style-sheet (str) + (with-input-from-string (s str) + (parse-style-sheet* (slurp s) 0 nil))) + +(defun parse-assignment-list-string (str) + (with-input-from-string (s str) + (parse-assignment-list (slurp s)))) + (defun parse-style-sheet* (seq &optional (start 0) (import-ok? t)) (let (p0 p1) (when (setq p0 (position-if-not #'white-space-p* seq :start start)) @@ -823,8 +818,8 @@ nil) (t (multiple-value-bind (sel-list condition) - (ignore-errors (parse-css2-selector-list seq p0 p1)) - (cond (condition + (parse-css2-selector-list seq p0 p1) + (cond (condition (warn "CSS selector list does not parse: `~A'." (as-string (subseq seq p0 p1))) (setq sel-list nil))) @@ -858,13 +853,13 @@ (defparameter *media-types* '(:screen :all)) -(defmethod is-of-media-type-p ((medium T) (media-type (eql :all))) t) +(defmethod is-of-media-type-p ((medium t) (media-type (eql :all))) t) (defmethod is-of-media-type-p ((medium (eql :screen)) (media-type (eql :screen))) t) -(defmethod is-of-media-type-p ((medium T) (media-type T)) +(defmethod is-of-media-type-p ((medium t) (media-type t)) nil) -(defmethod is-of-media-type-p ((medium T) (media-type cons)) +(defmethod is-of-media-type-p ((medium t) (media-type cons)) (ecase (car media-type) ((OR) (some (curry #'is-of-media-type-p medium) media-type)) From dlichteblau at common-lisp.net Wed May 4 19:30:49 2005 From: dlichteblau at common-lisp.net (David Lichteblau) Date: Wed, 4 May 2005 21:30:49 +0200 (CEST) Subject: [closure-cvs] CVS update: closure/src/css/css-selector.lisp Message-ID: <20050504193049.A09F588720@common-lisp.net> Update of /project/closure/cvsroot/closure/src/css In directory common-lisp.net:/tmp/cvs-serv17135 Modified Files: css-selector.lisp Log Message: revert rev 1.5! (Sorry! That was never meant to be checked in. Serves me right for not deleting the CVS directory before importing into subversion...) Date: Wed May 4 21:30:48 2005 Author: dlichteblau Index: closure/src/css/css-selector.lisp diff -u closure/src/css/css-selector.lisp:1.5 closure/src/css/css-selector.lisp:1.6 --- closure/src/css/css-selector.lisp:1.5 Wed May 4 21:24:13 2005 +++ closure/src/css/css-selector.lisp Wed May 4 21:30:48 2005 @@ -1,4 +1,4 @@ -;;; -*- Mode: Lisp; Syntax: Common-Lisp; Encoding: utf-8; -*- +;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CSS; Readtable: GLISP; Encoding: utf-8; -*- ;;; --------------------------------------------------------------------------- ;;; Title: CSS selectors ;;; [Split off from css-parse.lisp] @@ -28,7 +28,7 @@ ;;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -(in-package :css) +(in-package :CSS) (defun create-style-sheet (super-sheet &key (name "Anonymous style sheet") base-url @@ -435,6 +435,19 @@ (and r (cons (cons 'or (car r)) (cdr r))))) +(defun parse-media-type (string) + ;; xxx unicode! + (let ((r (parse-media-type-2 + (tokenize + (slurp + (cl-char-stream->gstream + (make-string-input-stream string))))))) + (cond ((and r (null (cdr r))) + (car r)) + (t + (warn "Bad media type: ~S." string) + nil)))) + (defun parse-import-rule (seq) (let ((toks (tokenize seq)) (media-type :all)) @@ -637,7 +650,7 @@ (tagbody loob (let ((a (q/simple-selector))) - (q/s*) + (q/S*) (push a res) (cond ((member (q/tok) '(:ident :hash :|.| :|[| :|:| :|*|)) (push 'ancestor res) @@ -796,14 +809,6 @@ (setf res (map 'vector #'+ res (css2-selector-specificity (cdr p))))))) res)) -(defun parse-style-sheet (str) - (with-input-from-string (s str) - (parse-style-sheet* (slurp s) 0 nil))) - -(defun parse-assignment-list-string (str) - (with-input-from-string (s str) - (parse-assignment-list (slurp s)))) - (defun parse-style-sheet* (seq &optional (start 0) (import-ok? t)) (let (p0 p1) (when (setq p0 (position-if-not #'white-space-p* seq :start start)) @@ -818,8 +823,8 @@ nil) (t (multiple-value-bind (sel-list condition) - (parse-css2-selector-list seq p0 p1) - (cond (condition + (ignore-errors (parse-css2-selector-list seq p0 p1)) + (cond (condition (warn "CSS selector list does not parse: `~A'." (as-string (subseq seq p0 p1))) (setq sel-list nil))) @@ -853,13 +858,13 @@ (defparameter *media-types* '(:screen :all)) -(defmethod is-of-media-type-p ((medium t) (media-type (eql :all))) t) +(defmethod is-of-media-type-p ((medium T) (media-type (eql :all))) t) (defmethod is-of-media-type-p ((medium (eql :screen)) (media-type (eql :screen))) t) -(defmethod is-of-media-type-p ((medium t) (media-type t)) +(defmethod is-of-media-type-p ((medium T) (media-type T)) nil) -(defmethod is-of-media-type-p ((medium t) (media-type cons)) +(defmethod is-of-media-type-p ((medium T) (media-type cons)) (ecase (car media-type) ((OR) (some (curry #'is-of-media-type-p medium) media-type)) From dlichteblau at common-lisp.net Fri May 13 19:57:39 2005 From: dlichteblau at common-lisp.net (David Lichteblau) Date: Fri, 13 May 2005 21:57:39 +0200 (CEST) Subject: [closure-cvs] CVS update: cxml/cxml.asd Message-ID: <20050513195739.25A068873C@common-lisp.net> Update of /project/cxml/cvsroot/cxml In directory common-lisp.net:/tmp/cvs-serv2122 Modified Files: cxml.asd Log Message: defsystem fix (thanks to Dave Lambert) Date: Fri May 13 21:57:38 2005 Author: dlichteblau Index: cxml/cxml.asd diff -u cxml/cxml.asd:1.3 cxml/cxml.asd:1.4 --- cxml/cxml.asd:1.3 Wed Apr 20 21:57:59 2005 +++ cxml/cxml.asd Fri May 13 21:57:38 2005 @@ -81,7 +81,6 @@ (:file "xml-name-rune-p" :depends-on ("package")) (:file "split-sequence" :depends-on ("package")) (:file "xml-parse" :depends-on ("package" "util" "sax-handler" "split-sequence" "xml-name-rune-p" "characters")) - (:file "characters" :depends-on ("package")) (:file "unparse" :depends-on ("xml-parse")) (:file "xmls-compat" :depends-on ("xml-parse")) (:file "recoder" :depends-on ("xml-parse"))