Ergo.Combinators.replace
You're seeing just the function
replace
, go back to Ergo.Combinators module for more information.
Link to this function
replace(parser, replacement_value, opts \\ [])
The replace/3 combinator replaces the AST value of it's child with a constant.
Examples
iex> alias Ergo.Context
iex> alias Ergo
iex> import Ergo.{Combinators, Terminals}
iex> parser = ignore(literal("foo")) |> replace(:foo)
iex> assert %Context{status: {:error, _}} = Ergo.parse(parser, "flush")