Skip to content

Commit

Permalink
BUGFIX: haml-comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Unspeakable committed Feb 23, 2012
1 parent 562771e commit 80bac22
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/cl-haml.lisp
Expand Up @@ -90,7 +90,7 @@ Must accept a function designater which must be called with the lock hold.")
(with-lock
(maphash (lambda (key value)
(declare (ignore value))
(when (type key 'pathname)
(when (typep key 'pathname)
(remhash key *functions*)))
*functions*)))

Expand Down
2 changes: 1 addition & 1 deletion src/cl-who-patch.lisp
@@ -1,7 +1,7 @@
(in-package :cl-who)

(defmethod convert-tag-to-string-list (tag attr-list body body-fn)
(declare (optimize speed space))
;; (declare (optimize speed space))
(let ((tag (string tag)))
(nconc (when *indent*
(list +newline+ (n-spaces *indent*)))
Expand Down
2 changes: 1 addition & 1 deletion src/read-element.lisp
Expand Up @@ -40,7 +40,7 @@
(char= char #\:))
do (write-char (read-char stream) out)))
:keyword)
(error "Type Error: Attribute key. [~S]" (read in))))
(error "Type Error: Attribute key. [~S]" (read stream))))


(defun read-attributes (stream &optional (eof-error-p nil)
Expand Down
2 changes: 1 addition & 1 deletion src/read-lisp-block.lisp
Expand Up @@ -10,5 +10,5 @@
(let ((line (read-line stream nil eof-value)))
(list (if (or (eq line eof-value)
(zerop (length (string-trim *whitespace-chars* line))))
+haml-multiple-commen+
+haml-multiple-comment+
+haml-line-comment+))))
2 changes: 1 addition & 1 deletion src/specials.lisp
Expand Up @@ -9,7 +9,7 @@
(defconstant +lisp+ '+lisp+)
(defconstant +haml+ '+haml+)
(defconstant +haml-multiple-comment+ '+haml-multiple-comment+)
(defconstant +haml-line-comment '+haml-line-comment+)
(defconstant +haml-line-comment+ '+haml-line-comment+)

(defconstant +eof+ 'eof)

Expand Down
4 changes: 2 additions & 2 deletions test/reader-test.lisp
Expand Up @@ -19,8 +19,8 @@
'(+haml+ (:|meta| :|http-equiv| "content-type" :|content| "text/html")))
(is "%title Hello, world" +haml+ '(+haml+ (:|title| "Hello, world")))
(is "%body.class1.class2{:class \"class3\"}" +haml+
'(+haml+ (:|body| :|class| "class1 class2 class3")))
(is "%h1#id2{:id \"id-x\"}" +haml+ '(+haml+ (:|h1| :|id| "id2")))
'(+haml+ (:|body| :|class| (.class "class1 class2" "class3"))))
(is "%h1#id2{:id \"id-x\"}" +haml+ '(+haml+ (:|h1| :|id| (.id "id2" "id-x"))))
(is "%p{:id \"id-x\"}= (format nil \"Hello, World\")" +haml+
'(+haml+ (:|p| :|id| "id-x"
(cl-who:str (format nil "Hello, World")))))
Expand Down
8 changes: 7 additions & 1 deletion test/test-haml/test-01.haml
Expand Up @@ -16,6 +16,11 @@
%header
%h1#id1.class1.class2{:class "class3"} This is Test!
-#
%div#id.class1.class2 Comment!
% Comment?
% Comment...
%article#main
%h2= (format nil "~{~A~^, ~}" '(hello world))
%table{:border "1"}
Expand All @@ -29,6 +34,7 @@
- dotimes (j 9)
%td= (* (1+ i) (1+ j))
-# Comment!
%footer
%p
Multiple line 1.
Expand All @@ -45,4 +51,4 @@
- (oddp i)
%p !!!
- t
%p ???
%p ???

0 comments on commit 80bac22

Please sign in to comment.