Ergo.Combinators.transform

You're seeing just the function transform, go back to Ergo.Combinators module for more information.
Link to this function

transform(parser, t_fn, opts \\ [])

The transform/2 parser runs a transforming function on the AST of its child parser.

Examples

# Sum the digits
iex> alias Ergo.Context
iex> import Ergo.{Combinators, Terminals}
iex> digit_to_int = fn d -> List.to_string([d]) |> String.to_integer() end
iex> t_fn = fn ast -> ast |> Enum.map(digit_to_int) |> Enum.sum() end
iex> parser = sequence([digit(), digit(), digit(), digit()]) |> transform(t_fn)
iex> context = Ergo.parse(parser, "1234")
iex> %Context{status: :ok, ast: 10, index: 4, line: 1, col: 5} = context