Ergo.Terminals.ws

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

The ws/0 parser accepts a white space character and is equivalent to the \s regular expression.

Examples

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

iex> alias Ergo.Context
iex> import Ergo.Terminals
iex> parser = ws()
iex> Ergo.parse(parser, "\tWorld")
%Context{status: :ok, char: ?\t, ast: ?\t, input: "World", index: 1, line: 1, col: 2}

iex> alias Ergo.Context
iex> import Ergo.Terminals
iex> parser = ws()
iex> Ergo.parse(parser, "\nWorld")
%Context{status: :ok, char: ?\n, ast: ?\n, input: "World", index: 1, line: 2, col: 1}

iex> alias Ergo.Context
iex> import Ergo.Terminals
iex> parser = ws()
iex> Ergo.parse(parser, "Hello World")
%Context{status: {:error, :unexpected_char}, message: "Expected: [\s, \t, \r, \n, \v] Actual: H", input: "Hello World"}