Ergo.Terminals.eoi

You're seeing just the function eoi, go back to Ergo.Terminals module for more information.

The eoi parser is a terminal parser that checks whether the input has been fully consumed. If there is input remaining to be parsed the return context status is set to :error.

Examples

iex> alias Ergo.{Context, Parser}
iex> import Ergo.Terminals
iex> context = Context.new(&Ergo.Parser.call/2, "")
iex> assert %Context{status: :ok, ast: nil} = Parser.invoke(eoi(), context)

iex> alias Ergo.{Context, Parser}
iex> import Ergo.Terminals
iex> context = Context.new(&Ergo.Parser.call/2, "Hello World")
iex> assert %Context{status: {:error, [{:not_eoi, "Input not empty: Hello World"}]}, input: "Hello World"} = Parser.invoke(eoi(), context)