hara.common.emit-top-level
emit-declare
added in 4.0
(emit-declare key [tag & syms] grammar mopts)emits declared
(emit-declare :def ’(declare a b c) +grammar+ {}) => “def a,b,c”
emit-def
added in 3.0
(emit-def key [tag sym body :as form] grammar mopts)creates the def string
emit-form
added in 4.0
(emit-form key [sym & args :as form] {:keys [reserved], :as grammar} mopts)creates a customisable emit and integrating both top-level and statements ^:hiddn
(emit-form :custom ’(custom 1 2 3) (assoc-in +grammar+ :reserved ’custom {:emit (fn _ _ _ ’CUSTOM)}) []) => ’CUSTOM
emit-top-level
added in 3.0
(emit-top-level key [tag sym & more :as form] grammar mopts)generic define form
(binding common/emit-fn common/emit-common (emit-top-level :defn ’(defn abc a := 0 (+ 1 2 3)) +grammar+ {})) => “function abc(a = 0){\n 1 + 2 + 3;\n}”
transform-defclass-inner
added in 4.0
(transform-defclass-inner body)transforms the body to be fn.inner and var.inner