Dogma v0.1.16 Dogma.Script

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

Summary

Functions

Builds a Script struct from the given source code and path

Builds a Script struct from the given source code and path

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

Functions

line(line)
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.

Raises an exception if the source is invalid.

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 ast and the errors accumulator as arguments, and return {ast, errors}