Ergo.Terminals.alpha
You're seeing just the function
alpha
, go back to Ergo.Terminals module for more information.
Link to this function
alpha()
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> assert %Context{status: :ok, input: "ello World", ast: ?H, index: 1, line: 1, col: 2} = Ergo.parse(parser, "Hello World")
iex> alias Ergo.Context
iex> import Ergo.Terminals
iex> parser = alpha()
iex> assert %Context{status: :ok, input: "llo World", ast: ?e, index: 1, line: 1, col: 2} = Ergo.parse(parser, "ello World")
iex> alias Ergo.Context
iex> import Ergo.Terminals
iex> parser = alpha()
iex> assert %Context{status: {:error, [{:unexpected_char, "Expected: [a..z, A..Z] Actual: "}]}, input: " World"} = Ergo.parse(parser, " World")