typed.clj.analyzer
-analyze-outer
(-analyze-outer ast {:typed.cljc.analyzer/keys [current-ns-name], :as opts})
If ast is :unanalyzed, then call analyze-form on it, otherwise returns ast.
-deftype
(-deftype cname class-name args interfaces)
analyze
(analyze form env opts)
Analyzes a clojure form using tools.analyzer augmented with the JVM specific special ops
and returns its AST, after running #'run-passes on it.
If no configuration option is provides, analyze will setup tools.analyzer using the extension
points declared in this namespace.
If provided, opts should be a map of options to analyze, currently the only valid
options are :bindings and :passes-opts (if not provided, :passes-opts defaults to the
value of `default-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}})analyze+eval
(analyze+eval form env {:keys [additional-gilardi-condition eval-fn annotate-do statement-opts-fn stop-gildardi-check analyze-fn], :or {additional-gilardi-condition (fn [form env] true), annotate-do (fn [a _ _] a), statement-opts-fn identity, stop-gildardi-check (fn [form env] false), analyze-fn analyze}, :as opts})
Like analyze but evals the form after the analysis and attaches the
returned value in the :result field of the AST node.
If evaluating the form will cause an exception to be thrown, the exception
will be caught and wrapped in an ExceptionThrown object, containing the
exception in the `e` field and the AST in the `ast` field.
The ExceptionThrown object is then passed to `handle-evaluation-exception`,
which by defaults throws the original exception, but can be used to provide
a replacement return value for the evaluation of the AST.
Unrolls `do` forms to handle the Gilardi scenario.
Useful when analyzing whole files/namespaces.
analyze-method-impls
(analyze-method-impls [method [this & params :as args] & body :as form] env opts)
create-var
(create-var sym {:keys [ns]} opts)
Creates a Var for sym and returns it.
The Var gets interned in the env namespace.
current-ns-name
(current-ns-name env opts)
Returns the current namespace symbol.
default-opts
(default-opts)
default-passes
Set of passes that will be run by default on the AST by #'run-passes
default-passes-opts
Default :passes-opts for `analyze`
default-thread-bindings
(default-thread-bindings env)
desugar-host-expr
(desugar-host-expr form env {:typed.cljc.analyzer/keys [resolve-ns], :as opts})
desugar-symbol
(desugar-symbol form env {:typed.cljc.analyzer/keys [resolve-ns], :as opts})
empty-env
(empty-env nsym)
eval-ast
(eval-ast a opts)
eval-ast2
(eval-ast2 ast opts)
Evaluate an AST node, attaching result to :result.
macroexpand-1
(macroexpand-1 form env opts)
If form represents a macro form or an inlineable function, returns its expansion,
else returns form.
parse
(parse form env opts)
Extension to clojure.core.typed.analyzer/-parse for JVM special forms
parse-case*
(parse-case* [_ expr shift mask default case-map switch-type test-type & [skip-check?] :as form] env opts)
parse-deftype*
(parse-deftype* [_ name class-name fields _ interfaces & methods :as form] env {:typed.clj.analyzer/keys [parse-deftype-with-existing-class], :as opts})
parse-import*
(parse-import* [_ class :as form] env opts)
parse-monitor-enter
(parse-monitor-enter [_ target :as form] env opts)
parse-monitor-exit
(parse-monitor-exit [_ target :as form] env opts)
parse-opts+methods
(parse-opts+methods methods)
parse-reify*
(parse-reify* [_ interfaces & methods :as form] env opts)
qualify-arglists
(qualify-arglists arglists)
resolve-ns
(resolve-ns ns-sym {:keys [ns]} opts)
Resolves the ns mapped by the given sym in the global env
resolve-op-sym
(resolve-op-sym form env opts)
Alpha - subject to change
In environment env, if form is an invocation of
a global var, return the fully qualified symbol of that var.
resolve-sym
(resolve-sym sym {:keys [ns locals], :as env} opts)
Resolves the value mapped by the given sym in the global env
If sym is shadowed by a local in env, returns nil.
scheduled-default-passes
(scheduled-default-passes opts)
specials
Set of the special forms for clojure in the JVM
unanalyzed
(unanalyzed form env opts)
var->sym
(var->sym v opts)
If given a var, returns the fully qualified symbol for that var, otherwise nil.