Status commit
Fri Nov 13 07:44:02 UTC 2009 pix@kepibu.org
* Status commit
diff -rN -u old-Oh, Ducks!/css-selector-unifier.asd new-Oh, Ducks!/css-selector-unifier.asd
--- old-Oh, Ducks!/css-selector-unifier.asd 2015-10-03 02:36:56.000000000 +0000
+++ new-Oh, Ducks!/css-selector-unifier.asd 2015-10-03 02:36:56.000000000 +0000
@@ -1,11 +1,13 @@
-
(asdf:defsystem css-selector-unifier
:version "0"
:description "cl-unification templates using CSS-style selectors"
:maintainer " <pix@kepibu.org>"
:author " <pix@kepibu.org>"
:licence "BSD-style"
- :depends-on (:closure-html :cxml :cl-ppcre :cl-unification :split-sequence)
+ ;; TODO: submit a patch for cl-unification to use
+ ;; asdf-system-connections. Getting an unmodified version of
+ ;; cl-unification to load the cl-ppcre stuff is a PITA.
+ :depends-on (:cl-unification :cl-ppcre :cxml :closure-html :split-sequence)
:serial t
;; components likely need manual reordering
:components ((:file "package")
@@ -17,3 +19,9 @@
(:file "lhtml" :depends-on ("interface"))
(:file "pt" :depends-on ("interface"))))
(:file "unification-templates")))
+
+;; closure-html and cl-unification both indiscriminately set up #t as a
+;; reader. We ensure cl-unification's #t wins.
+#+(or)
+(eval-when (:load-toplevel :execute)
+ (set-dispatch-macro-character #\# #\T 'unify::|sharp-T-reader|))
diff -rN -u old-Oh, Ducks!/regexp-template.lisp new-Oh, Ducks!/regexp-template.lisp
--- old-Oh, Ducks!/regexp-template.lisp 2015-10-03 02:36:56.000000000 +0000
+++ new-Oh, Ducks!/regexp-template.lisp 2015-10-03 02:36:56.000000000 +0000
@@ -9,7 +9,8 @@
(make-instance 'unify::regular-expression-template
:spec (list* re-kwd
(concatenate 'string regexp "(.*)$")
- (append vars '(?rest))
+ (append vars '(?&rest))
keys))))
-#+(or) (match #t(regexp+ "^f(o+)" (?o)) (values o rest))
+;; (match (#t(regexp+ "^f(o+)" (?o)) "fooooooobar") (values o &rest))
+;; => "ooooooo", "bar"
diff -rN -u old-Oh, Ducks!/unification-templates.lisp new-Oh, Ducks!/unification-templates.lisp
--- old-Oh, Ducks!/unification-templates.lisp 2015-10-03 02:36:56.000000000 +0000
+++ new-Oh, Ducks!/unification-templates.lisp 2015-10-03 02:36:56.000000000 +0000
@@ -90,12 +90,12 @@
(defun parse-css-specifier (specifier)
(match-case (specifier)
;; combinators
- (#T(unify::regexp "^[ ]*[>][ ]*(.*)$" (?rest)) (list (make-instance 'css-descendant-selector :arg :direct :matcher (parse-css-specifier rest))))
- (#T(unify::regexp "^[ ]+(.*)$" (?rest)) (list (make-instance 'css-descendant-selector :arg t :matcher (parse-css-specifier rest))))
+ (#T(regexp+ "^[ ]*[>][ ]*" ()) (list (make-instance 'css-descendant-selector :arg :direct :matcher (parse-css-specifier &rest))))
+ (#T(regexp+ "^[ ]+" ()) (list (make-instance 'css-descendant-selector :arg t :matcher (parse-css-specifier &rest))))
;; simple selector sequence
- (#T(unify::regexp "^(\\w+)(.*)$" (?element-type ?rest)) (cons (make-instance 'css-type-selector :arg element-type) (parse-css-specifier rest)))
- (#T(unify::regexp "^[#](\\w+)(.*)$" (?element-id ?rest)) (cons (make-instance 'css-id-selector :arg element-id) (parse-css-specifier rest)))
- (#T(unify::regexp "^[\\.](\\w+)(.*)$" (?class ?rest)) (cons (make-instance 'css-class-selector :arg class) (parse-css-specifier rest)))))
+ (#T(regexp+ "^(\\w+)" (?element-type)) (cons (make-instance 'css-type-selector :arg element-type) (parse-css-specifier &rest)))
+ (#T(regexp+ "^[#](\\w+)" (?element-id)) (cons (make-instance 'css-id-selector :arg element-id) (parse-css-specifier &rest)))
+ (#T(regexp+ "^[\\.](\\w+)" (?class)) (cons (make-instance 'css-class-selector :arg class) (parse-css-specifier &rest)))))
(defgeneric css-select (specifier document))