View Source Minipeg.Parser (Minipeg v0.2.4)

A struct containung a parser function and a name

Summary

Types

@type ast_list_t() :: [ast_t()]
@type ast_t() :: any()
@type binaries() :: [binary()]
@type binary?() :: maybe(binary())
@type char_set_t() :: [binary()] | binary()
Link to this type

either(success_t, error_t)

View Source
@type either(success_t, error_t) :: {:ok, success_t} | {:error, error_t}
@type input_t() :: binary() | [binary()] | Minipeg.Input.t()
@type maybe(t) :: nil | t
@type parser_function_t() ::
  (Minipeg.Input.t(), Minipeg.Cache.t(), binary() -> result_t())
@type result_t() :: Minipeg.Failure.t() | Minipeg.Success.t()
@type result_tuple_t(ast_t) :: {:ok, ast_t} | {:error, binary()}
@type satisfier_result_t() :: either(any(), binary())
@type satisfier_t() :: (any() -> satisfier_result_t())
@type str_or_count_t() :: binary() | non_neg_integer()
@type t() :: %Minipeg.Parser{name: binary(), parser_function: parser_function_t()}

Functions

Link to this function

new(name, parser_function)

View Source
@spec new(binary(), parser_function_t()) :: t()
Link to this function

parse(parser, input, cache)

View Source
@spec parse(t(), Minipeg.Input.t(), Minipeg.Cache.t()) :: result_t()
Link to this function

parse_string(parser, input_string)

View Source
@spec parse_string(t(), binary()) :: result_tuple_t(any())