From c24da9a7e96c788247dd8d419bc0d01575beb7ef Mon Sep 17 00:00:00 2001 From: paku Date: Sun, 26 May 2024 21:45:49 +0900 Subject: [PATCH] Fix bug --- src/hsx.lisp | 4 ++-- tests/hsx-macro.lisp | 2 +- tests/hsx.lisp | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hsx.lisp b/src/hsx.lisp index ac49790..db0ac09 100644 --- a/src/hsx.lisp +++ b/src/hsx.lisp @@ -25,7 +25,7 @@ (multiple-value-bind (props children) (parse-body body) `(create-element ,',(string-downcase name) - ',props + (list ,@props) ,@children)))) (defparameter *builtin-elements* (make-hash-table)) @@ -58,7 +58,7 @@ (multiple-value-bind (props children) (parse-body body) `(create-element #',',%name - ',props + (list ,@props) ,@children)))))) (defun builtin-element-p (node) diff --git a/tests/hsx-macro.lisp b/tests/hsx-macro.lisp index 6829c27..d6eeac5 100644 --- a/tests/hsx-macro.lisp +++ b/tests/hsx-macro.lisp @@ -3,7 +3,7 @@ #:fiveam) (:import-from #:hsx/element #:element-type - #:element-props) + #:element-children) (:import-from #:hsx/hsx #:hsx #:defcomp)) diff --git a/tests/hsx.lisp b/tests/hsx.lisp index 81783ef..2d0c6da 100644 --- a/tests/hsx.lisp +++ b/tests/hsx.lisp @@ -13,14 +13,14 @@ '(div)) '(create-element "div" - 'nil)))) + (list))))) (test hsx-with-props (is (equal (macroexpand-1 '(div :prop1 "value1" :prop2 "value2")) '(create-element "div" - '(:prop1 "value1" :prop2 "value2"))))) + (list :prop1 "value1" :prop2 "value2"))))) (test hsx-with-children (is (equal (macroexpand-1 @@ -29,7 +29,7 @@ "child2")) '(create-element "div" - 'nil + (list) "child1" "child2")))) @@ -40,7 +40,7 @@ "child2")) '(create-element "div" - '(:prop1 "value1" :prop2 "value2") + (list :prop1 "value1" :prop2 "value2") "child1" "child2")))) @@ -54,6 +54,6 @@ "child2")) '(create-element #'%comp - '(:prop1 "value1" :prop2 "value2") + (list :prop1 "value1" :prop2 "value2") "child1" "child2"))))