Ergo.Combinators.sequence

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

sequence(parsers, opts \\ [])

Examples

iex> alias Ergo.Context
iex> import Ergo.{Terminals, Combinators}
iex> parser = sequence([literal("Hello"), ws(), literal("World")])
iex> context = Ergo.parse(parser, "Hello World")
%Context{status: :ok, ast: ["Hello", ?\s, "World"], char: ?d, index: 11, line: 1, col: 12} = context

iex> Logger.disable(self())
iex> alias Ergo.Context
iex> import Ergo.{Terminals, Combinators}
iex> parser = sequence([literal("Hello"), ws(), literal("World")], label: "HelloWorld")
iex> context = Ergo.parse(parser, "Hello World", debug: true)
iex> assert %Context{status: :ok, debug: true, ast: ["Hello", ?\s, "World"], char: ?d, index: 11, line: 1, col: 12} = context

iex> alias Ergo.Context
iex> import Ergo.{Terminals, Combinators}
iex> parser = sequence([literal("Hello"), ws(), literal("World")], map: fn ast -> Enum.join(ast, " ") end)
iex> context = Ergo.parse(parser, "Hello World")
iex> assert %Context{status: :ok, ast: "Hello 32 World", char: ?d, index: 11, line: 1, col: 12} = context

iex> Logger.disable(self())
iex> alias Ergo.Context
iex> import Ergo.{Terminals, Combinators}
iex> parser = sequence([literal("Hello"), ws(), literal("World")], label: "HelloWorld", map: fn ast -> Enum.join(ast, " ") end)
iex> context = Ergo.parse(parser, "Hello World", debug: true)
iex> assert %Context{status: :ok, debug: true, ast: "Hello 32 World", char: ?d, index: 11, line: 1, col: 12} = context

iex> alias Ergo.Context
iex> import Ergo.{Combinators, Terminals}
iex> parser = sequence([literal("foo"), ws(), literal("bar")])
iex> assert %Context{status: {:error, :unexpected_char}} = Ergo.parse(parser, "Hello World")