Current section
Files
Jump to
Current section
Files
lib/minipeg/types.ex
defmodule Minipeg.Types do
@moduledoc false
defmacro __using__(_opts) do
quote do
@type ast_t :: any()
@type ast_list_t :: list(ast_t())
@type atoms :: list(atom())
@type continue_return_t :: {:cont|:stop, Minipeg.Input.t(), ast_t()}
@type continue_fun_t :: (Minipeg.Input.t(), ast_t() -> continue_return_t())
@type either(success_t, error_t) :: {:ok, success_t} | {:error, error_t}
@type satisfier_result_t :: either(any(), binary())
@type satisfier_t :: (any() -> satisfier_result_t())
@type satisfier2_t :: (any(), Minipeg.Input.t() -> satisfier_result_t())
@type input_t :: binary() | list(binary) | Minipeg.Input.t()
@type maybe(t) :: nil | t
@type binary? :: maybe(binary())
@type binaries() :: list(binary())
@type char_set_t :: list(binary()) | binary()
@type char_set_spec_t :: maybe(binary() | list())
@type name_t :: atom() | binary()
@type name_t? :: maybe(name_t())
@type parser_function_t :: (Minipeg.Input.t(), Minipeg.Cache.t(), binary() -> result_t())
@type position_t :: {pos_integer(), pos_integer()}
@type result_t :: Minipeg.Failure.t() | Minipeg.Ignore.t() | Minipeg.Success.t()
@type str_or_count_t :: binary() | non_neg_integer()
@typep token_parse_part1 :: binary() | Minipeg.Parser.t()
@typep token_parse_part2 :: Regex.t() | Minipeg.Parser.t()
@type token_comp_t :: list(token1_comp_t())
@type token1_comp_t :: {atom(), token_parse_part2()} | {atom(), token_parse_part2(), (binary() -> any())}
@type token_spec_t :: list(token1_spec_t())
@type token1_spec_t :: {atom(), token_parse_part1()} | {atom(), token_parse_part1(), (binary() -> any())}
# @type parse_function_t :: (Minipeg.Input.t(), Minipeg.Cache.t() -> result_t())
# @type parser_t :: parse_function_t() | Minipeg.Parser.t()
# @type predicate_t :: (Minipeg.Result.t() -> boolean())
# @type result_t :: Minipeg.Success.t() | Minipeg.Failure.t()
end
end
end
# SPDX-License-Identifier: Apache-2.0