# Gathers all of the calls of "declare-" into a table from the project.janet file at path
(defn capture-declares [path]
(def *capture* @{})
(defn append-capture [name & arg]
(update *capture* name (fn [val] (array/push (or val @[]) ;arg))))
(defn only-captures [form]
(when (string/has-prefix? "declare-" (string (form 0)))
(append-capture (form 0) (slice form 1))
form)
nil)
(dofile path :expander only-captures)
*capture*)