Improve find-builtin-symbols
This commit is contained in:
parent
458785bfb1
commit
d10b24c2c8
1 changed files with 10 additions and 12 deletions
22
src/hsx.lisp
22
src/hsx.lisp
|
@ -45,15 +45,13 @@
|
||||||
(error "The body of the hsx macro must be a single form."))
|
(error "The body of the hsx macro must be a single form."))
|
||||||
(find-builtin-symbols (car form)))
|
(find-builtin-symbols (car form)))
|
||||||
|
|
||||||
(defun find-builtin-symbols (tree)
|
(defun find-builtin-symbols (node)
|
||||||
(if tree
|
(if (atom node)
|
||||||
(cons (let ((first-node (first tree)))
|
(or (find-symbol (string node) :hsx/builtin)
|
||||||
(if (listp first-node)
|
node)
|
||||||
(find-builtin-symbols first-node)
|
(cons (find-builtin-symbols (car node))
|
||||||
(or (find-symbol (string first-node) :hsx/builtin)
|
(mapcar (lambda (n)
|
||||||
first-node)))
|
(if (listp n)
|
||||||
(mapcar (lambda (node)
|
(find-builtin-symbols n)
|
||||||
(if (listp node)
|
n))
|
||||||
(find-builtin-symbols node)
|
(cdr node)))))
|
||||||
node))
|
|
||||||
(rest tree)))))
|
|
||||||
|
|
Loading…
Reference in a new issue