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.
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 |
Functions
Builds a Script struct from the given source code and path
Builds a Script struct from the given source code and path.
Raises an exception if the source is invalid.
Runs each of the given on the given script
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}