Skip to content

Commit

Permalink
use same analysis for dom macros as $
Browse files Browse the repository at this point in the history
  • Loading branch information
lilactown committed Aug 4, 2024
1 parent 2bcb00c commit a6c4f5d
Showing 1 changed file with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,8 @@

(defn dom
"Macro analysis for `helix.dom/*`."
[{:keys [node]}]
(let [[fn-sym & body] (-> node :children)
[old-props body] (if (api/map-node? (first body))
[(-> body first :children) (next body)]
[nil body])
children body
new-props (when old-props
(->> old-props
(map
#(if (cond-> (api/sexpr %) symbol? (= '&))
(api/keyword-node :&)
%))
api/map-node))
expanded (api/list-node
(list* fn-sym new-props children))]
{:node (with-meta expanded (meta node))}))
[m]
($ m))


(defn analyze-definition
Expand Down

0 comments on commit a6c4f5d

Please sign in to comment.