View Source Minipeg.Parser (Minipeg v0.1.2)

A struct containung a parser function and a name

Link to this section Summary

Link to this section Types

@type ast_t() :: any()
@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 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()}

Link to this section 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()