scscm/expander
src/scscm/expander.tur
defn
scscm-macros-reset
(scscm-macros-reset)
forget every defmacro. The table holds AST nodes,
defn
expand
(expand [ast : int])
expand macros in a single AST node.
Parameters
| ast | AST node handle (from parser) |
Returns
Expanded AST node handle, built from core forms (may be a new allocation; input nodes are shared, not copied).
Example
(expand (parse-one-form my-tokens))
Since: SC3
defn
expand-all
(expand-all [asts : int])
expand macros in a cons list of top-level AST nodes.
Parameters
| asts | cons list of AST node handles |
Returns
Cons list of expanded AST node handles, in order. A defmacro is recorded and becomes an empty form, which codegen drops.
Example
(expand-all top-level-nodes)
Since: SC3
Internal definitions
scscm-macro-env-opscscm-macro-getscscm-macro-setscscm-macro-definescscm-macro-lookup-loopscscm-macro-lookupscscm-kind?scscm-symscscm-kwscscm-numscscm-strscscm-nilscscm-addscscm-l1scscm-l2scscm-l3scscm-l4scscm-l5scscm-append-fromscscm-call-fromscscm-fn-fromscscm-do-fromscscm-sendscscm-class-sendscscm-default-clockscscm-done-action-2scscm-argscscm-bind-0scscm-bind-1scscm-params1scscm-sym-stringscscm-thread-firstscscm-thread-lastscscm-mac-whenscscm-mac-unlessscscm-else-test?scscm-cond-clauses?scscm-cond-ifsscscm-cond-splitscscm-mac-condscscm-mac-iteratescscm-mac-accumulatescscm-comp-fromscscm-mac-partialscscm-mac-defsynthscscm-mac-definstscscm-mac-routinescscm-mac-patternscscm-mac-pbindscscm-mac-ctlscscm-mac-schedscscm-mac-demoscscm-mac-adsrscscm-mac-percscscm-mac-env-linescscm-mac-degreesscscm-pct-indexscscm-pct-opscscm-pct-scanscscm-pct-scan-childrenscscm-pct-namescscm-pct-substscscm-pct-subst-fillscscm-pct-paramsscscm-mac-hash-fnscscm-kind-intscscm-bind-paramsscscm-cons-to-listscscm-cons-to-list-fillscscm-env-lookupscscm-substscscm-subst-fillscscm-qqscscm-qq-fillscscm-macro-bodyscscm-macro-applyscscm-children-consscscm-children-cons-loopscscm-expand-fromscscm-expand-fillscscm-expand-letscscm-expand-bindingsscscm-handle-defmacroscscm-builtinscscm-expand-listscscm-expand-dot