Ergo.Combinators.choice

You're seeing just the function choice, go back to Ergo.Combinators module for more information.
Link to this function

choice(parsers, opts \\ [])

The choice/1 parser takes a list of parsers. It tries each in order attempting to match one. Once a match has been made choice returns the result of the matching parser.

Examples

iex> alias Ergo.Context
iex> import Ergo.{Terminals, Combinators}
iex> parser = choice([literal("Foo"), literal("Bar"), literal("Hello"), literal("World")], label: "Foo|Bar|Hello|World")
iex> context = Ergo.parse(parser, "Hello World")
iex> assert %Context{status: :ok, ast: "Hello", input: " World", char: ?o, index: 5, col: 6} = context

iex> alias Ergo.Context
iex> import Ergo.{Terminals, Combinators}
iex> parser = choice([literal("Foo"), literal("Bar")])
iex> context = Ergo.parse(parser, "Hello World")
iex> %Context{status: {:error, :no_valid_choice}, message: "No valid choice", ast: nil, input: "Hello World"} = context