Dogma.Script

This module provides the struct that we use to reprisent source files, their abstract syntax tree, etc, as well as a few convenient functions for working with them.

Source

Summary

parse!(source, path)

Builds a Script struct from the given source code and path

parse(source, path)

Builds a Script struct from the given source code and path

run_tests(script, rules)

Runs each of the given on the given script

walk(script, fun)

Postwalks the AST, calling the given fun/2 on each

Functions

parse(source, path)

Builds a Script struct from the given source code and path

Source
parse!(source, path)

Builds a Script struct from the given source code and path.

Raises an exception if the source is invalid.

Source
run_tests(script, rules)

Runs each of the given on the given script

Source
walk(script, fun)

Postwalks the AST, calling the given fun/2 on each.

script.errors is used as an accumulator for fun/2, the script with the new errors is returned.

fun/2 should take a node and the errors accumulator as arguments, and return {node, errors}

Source