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()
iex> Parser.call(eoi(), context)
%Context{status: :ok, ast: nil}

iex> alias Ergo.{Context, Parser}
iex> import Ergo.Terminals
iex> context = Context.new("Hello World")
iex> Parser.call(eoi(), context)
%Context{status: {:error, :not_eoi}, message: "Input not empty: Hello World…", input: "Hello World"}