Liking cljdoc? Tell your friends :D

eastwood.analyze-ns


*forms-analyzed-writer*clj

source

*forms-emitted-writer*clj

source

*forms-read-writer*clj

source

all-ns-names-setclj

(all-ns-names-set)
source

analyze-fileclj

(analyze-file source-path & {:keys [reader opt]})

Takes a file path and optionally a pushback reader. Returns a map with at least the following keys:

:forms - a sequence of forms as read in, with any forms within a top-level do, or do forms nested within a top-level do, 'flattened' to the top level themselves. This sequence will include all forms in the file, as far as the file could be successfully read, even if an exception was thrown earlier than that during analysis or evaluation of the forms.

:asts - a sequence of ASTs of the forms that were successfully analyzed without exception. They correspond one-to-one with forms in the :forms sequence.

:exception - nil if no exception occurred. An Exception object if an exception was thrown during analysis, emit-form, or eval.

If :exception is not nil, then the following keys will also be part of the returned map:

:exception-phase - If an exception was thrown, this is a keyword indicating in what portion of analyze-file's operation this exception occurred. Always :analyze+eval or :eval

:exception-form - If an exception was thrown, the current form being processed when the exception occurred.

Options:

  • :reader a pushback reader to use to read the namespace forms
  • :opt a map of analyzer options
    • :debug A set of keywords.
      • :all Enable all of the following debug messages.
      • :progress Print simple progress messages as analysis proceeds.
      • :ns Print all namespaces that exist according to (all-ns) before analysis begins, and then only when that set of namespaces changes after each form is analyzed.
      • :forms Print forms just before analysis, both before and after macroexpanding them.
      • :forms-pprint Pretty-print forms just before analysis, both before and after macroexpanding them.
      • :ast Print complete ASTs just after analysis of each form.

eg. (analyze-file "my/ns.clj" :opt {:debug-all true})

Takes a file path and optionally a pushback reader.  Returns a map
with at least the following keys:

:forms - a sequence of forms as read in, with any forms within a
    top-level do, or do forms nested within a top-level do,
    'flattened' to the top level themselves.  This sequence will
    include all forms in the file, as far as the file could be
    successfully read, even if an exception was thrown earlier than
    that during analysis or evaluation of the forms.

:asts - a sequence of ASTs of the forms that were successfully
    analyzed without exception.  They correspond one-to-one with
    forms in the :forms sequence.

:exception - nil if no exception occurred.  An Exception object if
    an exception was thrown during analysis, emit-form, or eval.

If :exception is not nil, then the following keys will also be part
of the returned map:

:exception-phase - If an exception was thrown, this is a keyword
    indicating in what portion of analyze-file's operation this
    exception occurred.  Always :analyze+eval or :eval

:exception-form - If an exception was thrown, the current form being
    processed when the exception occurred.

Options:
- :reader  a pushback reader to use to read the namespace forms
- :opt     a map of analyzer options
  - :debug A set of keywords.
    - :all Enable all of the following debug messages.
    - :progress Print simple progress messages as analysis proceeds.
    - :ns Print all namespaces that exist according to (all-ns)
          before analysis begins, and then only when that set of
          namespaces changes after each form is analyzed.
    - :forms Print forms just before analysis, both before and after
             macroexpanding them.
    - :forms-pprint Pretty-print forms just before analysis, both
                    before and after macroexpanding them.
    - :ast Print complete ASTs just after analysis of each form.

eg. (analyze-file "my/ns.clj" :opt {:debug-all true})
sourceraw docstring

analyze-nsclj

(analyze-ns source-nsym
            &
            {:keys [reader opt] :or {reader (pb-reader-for-ns source-nsym)}})

Takes an IndexingReader and a namespace symbol. Returns a map of results of analyzing the namespace. The map contains these keys:

:analyze-results - The value associated with this key is itself a map with the following keys: :namespace - The source-nsym argument to this fn :source - A string containing the source read in from the namespace's source file. :forms - See analyze-file docs for details :asts - See analyze-file :exception, :exception-phase, :exception-form - See analyze-file

Options:

  • :reader a pushback reader to use to read the namespace forms
  • :opt a map of analyzer options
    • same as analyze-file. See there.

eg. (analyze-ns 'my-ns :opt {} :reader (pb-reader-for-ns 'my.ns))

Takes an IndexingReader and a namespace symbol.
Returns a map of results of analyzing the namespace.  The map
contains these keys:

:analyze-results - The value associated with this key is itself a
    map with the following keys:
    :namespace - The source-nsym argument to this fn
    :source - A string containing the source read in from the
        namespace's source file.
    :forms - See analyze-file docs for details
    :asts - See analyze-file
:exception, :exception-phase, :exception-form - See analyze-file

Options:
- :reader  a pushback reader to use to read the namespace forms
- :opt     a map of analyzer options
  - same as analyze-file.  See there.

eg. (analyze-ns 'my-ns :opt {} :reader (pb-reader-for-ns 'my.ns))
sourceraw docstring

asts-with-eval-exceptionclj

(asts-with-eval-exception ast)

tools.analyzer.jvm/analyze+eval returns an AST with a :result key being a specific class of Exception object, if an exception occurred while eval'ing the corresponding expression. This is easy to check at the top level of an AST, but since analyze+eval recurses into top-level do forms, analyzing and eval'ing each independently, checking whether any of them threw an exception during eval requires recursing into ASTs with :op equal to :do

tools.analyzer.jvm/analyze+eval returns an AST with a :result key
being a specific class of Exception object, if an exception occurred
while eval'ing the corresponding expression.  This is easy to check at
the top level of an AST, but since analyze+eval recurses into
top-level do forms, analyzing and eval'ing each independently,
checking whether any of them threw an exception during eval requires
recursing into ASTs with :op equal to :do
sourceraw docstring

before-analyze-file-debugclj

(before-analyze-file-debug source-path opt)
source

begin-file-debugclj

(begin-file-debug filename ns opt)
source

cleanupclj

(cleanup form)
source

dont-expand-twice?clj

(dont-expand-twice? form)
source

eastwood-ast-additionsclj

(eastwood-ast-additions ast ast-idx)
source

eastwood-passesclj

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

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

eastwood-passes-optsclj

source

eastwood-wrong-tag-handlerclj

(eastwood-wrong-tag-handler t ast)
source

gen-interface-form?clj

(gen-interface-form? form)
source

pb-reader-for-nsclj

(pb-reader-for-ns ns-sym)

Returns an IndexingReader for namespace ns-sym

Returns an IndexingReader for namespace ns-sym
sourceraw docstring

post-analyze-debugclj

(post-analyze-debug filename asts form ast ns opt)
source

pre-analyze-debugclj

(pre-analyze-debug asts form _env ns opt)
source

remaining-formsclj

(remaining-forms pushback-reader forms)
source

run-passesclj

(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

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
sourceraw docstring

scheduled-eastwood-passesclj

source

uri-for-nsclj

(uri-for-ns ns-sym)

Returns a URI representing the namespace. Throws an exception if URI not found.

Returns a URI representing the namespace. Throws an
exception if URI not found.
sourceraw docstring

wrapped-exception?clj

(wrapped-exception? result)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close