API for js - Javascript-specific passes for tools.analyzer 0.1.0 (in development)


Full namespace name: clojure.tools.analyzer.js

Overview

Analyzer for clojurescript code, extends tools.analyzer with JS specific passes/forms

Public Variables and Functions



analyze

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
  


analyze-ns

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
  


backup-env

function
Usage: (backup-env)
Caches the current namespaces state in a resource file, can be restored with
(restore-env)

    
    
    Source
  


cljs-env->env

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
  


create-var

function
Usage: (create-var sym {:keys [ns]})
Creates a var map for sym and returns it.

    
    
    Source
  


default-passes

var

    
Set of passes that will be run by default on the AST by #'run-passes

    
    
    Source
  


empty-env

function
Usage: (empty-env)
Returns an empty env map

    
    
    Source
  


parse

multimethod
No usage documentation available
Extension to tools.analyzer/-parse for CLJS special forms

    
    
    Source
  


restore-env

function
Usage: (restore-env)
Uses a cached env to populate the default namespace map

    
    
    Source
  


run-passes

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
  


setup-rt!

function
Usage: (setup-rt!)
Setups the basic runtime, loading cljs.core and initializing cljs.user

    
    
    Source
  


specials

var

    
Set of the special forms for clojurescript

    
    
    Source
  
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.