View Source Minipeg.Parsers.LispyParser (Minipeg v0.2.7)
Parses s-expressions (lispy) The syntax is very simple
s_exp:
----> ( `opening_literal`) ---------------------------------------------+-------------> ( `closing_literal` ) ------>
^ |
| |
| +---------+ |
+--- (whitespace) <--- | element | <-------+
+---------+
element:
string | integer | name | s_exp
opening_literal
defaults to (
and closing literal defaults to )
, of course
Summary
Functions
parses a string, integer, name (atom) or s-exp
Parses a name which is actually any non digit starting printable character sequence
Parses an s-expression according to the schema above
Types
@type ast_list_t() :: [ast_t()]
@type ast_t() :: any()
@type binaries() :: [binary()]
@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_t() :: (any() -> satisfier_result_t())
@type str_or_count_t() :: binary() | non_neg_integer()
Functions
@spec element_parser(binary?()) :: Minipeg.Parser.t()
parses a string, integer, name (atom) or s-exp
@spec name_parser(binary?()) :: Minipeg.Parser.t()
Parses a name which is actually any non digit starting printable character sequence
Link to this function
s_exp_parser(name \\ nil, opening_literal \\ "(", closing_literal \\ ")")
View Source@spec s_exp_parser(binary?(), binary(), binary()) :: Minipeg.Parser.t()
Parses an s-expression according to the schema above