Ergo.Terminals.alpha

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

The alpha/0 parser accepts a single character in the range a..z or A..Z.

Examples

iex> alias Ergo.Context
iex> import Ergo.Terminals
iex> parser = alpha()
iex> Ergo.parse(parser, "Hello World")
%Context{status: :ok, input: "ello World", char: ?H, ast: ?H, index: 1, line: 1, col: 2}

iex> alias Ergo.Context
iex> import Ergo.Terminals
iex> parser = alpha()
iex> Ergo.parse(parser, "ello World")
%Context{status: :ok, input: "llo World", char: ?e, ast: ?e, index: 1, line: 1, col: 2}

iex> alias Ergo.Context
iex> import Ergo.Terminals
iex> parser = alpha()
iex> Ergo.parse(parser, " World")
%Context{status: {:error, :unexpected_char}, message: "Expected: [a..z, A..Z] Actual:  ", input: " World"}