Ergo.Context.peek

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

Examples

iex> context = Context.new(&Ergo.Parser.call/2, "Hello")
iex> assert %Context{status: :ok, ast: ?H, input: "ello", index: 1, line: 1, col: 2} = Context.peek(context)

iex> context = Context.new(&Ergo.Parser.call/2, "")
iex> assert %Context{status: {:error, [{:unexpected_eoi, "Unexpected end of input"}]}, index: 0, line: 1, col: 1} = Context.peek(context)