API for js
-
Full namespace name:
clojure.tools.analyzer.js
Overview
Analyzer for clojurescript code, extends tools.analyzer with JS specific passes/forms
Public Variables and Functions
function
Usage: (analyze form)
(analyze form env)
(analyze form env opts)
Returns an AST for the form.
Binds tools.analyzer/{macroexpand-1,create-var,parse} to
tools.analyzer.js/{macroexpand-1,create-var,parse} and analyzes the form.
If provided, opts should be a map of options to analyze, currently the only valid
options are :bindings and :passes-opts.
If provided, :bindings should be a map of Var->value pairs that will be merged into the
default bindings for tools.analyzer, useful to provide custom extension points.
If provided, :passes-opts should be a map of pass-name-kw->pass-config-map pairs that
can be used to configure the behaviour of each pass.
E.g.
(analyze form env {:bindings {#'ana/macroexpand-1 my-mexpand-1}})
Calls `run-passes` on the AST.
Source
function
Usage: (analyze-ns ns)
Analyzes a whole namespace, returns a vector of the ASTs for all the
top-level ASTs of that namespace.
Source
function
Usage: (backup-env)
Caches the current namespaces state in a resource file, can be restored with
(restore-env)
Source
function
Usage: (cljs-env->env)
Converts the namespace map of the current cljs environment in a tools.analyzer.js
namespace map and returns it.
Source
function
Usage: (create-var sym {:keys [ns]})
Creates a var map for sym and returns it.
Source
var
Set of passes that will be run by default on the AST by #'run-passes
Source
function
Usage: (empty-env)
Returns an empty env map
Source
multimethod
No usage documentation available
Extension to tools.analyzer/-parse for CLJS special forms
Source
function
Usage: (restore-env)
Uses a cached env to populate the default namespace map
Source
dynamic function
Usage: (run-passes ast)
Function that will be invoked on the AST tree immediately after it has been constructed,
by default set-ups and runs the default passes declared in #'default-passes
Source
function
Usage: (setup-rt!)
Setups the basic runtime, loading cljs.core and initializing cljs.user
Source
var
Set of the special forms for clojurescript
Source