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> ctx = Context.new("")
iex> assert %Context{status: :ok, ast: nil} = Parser.invoke(ctx, eoi())

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