Elixpath.Parser (elixpath v0.1.0)
Parses Elixpath expressions.
Link to this section Summary
Link to this section Types
Link to this type
option()
Specs
option() :: {:unsafe_atom, boolean()} | {:prefer_keys, :string | :atom}
Link to this section Functions
Link to this function
parse(str_or_path, opts \\ [])
Specs
parse(String.t() | Elixpath.t(), [option()]) :: {:ok, Elixpath.t()} | {:error, reason :: term()}
Parses an Elixpath expression. See this page for syntax.
Warning: when unsafe_atom: true
is specified, this function creates new atom using String.to_atom/1
.
Do not specify unsafe_atom: true
for untrusted input.
See String.to_atom/1
for details.
Options
:unsafe_atom
- iftrue
, allows to create non-existing atoms, defaults tofalse
.:prefer_keys
- unquoted keys are converted to string (:string
) or atom (:atom
). Defaults to:string
.
Link to this function
parse!(str_or_path, opts \\ [])
Specs
parse!(String.t() | Elixpath.t(), [option()]) :: Elixpath.t() | no_return()
Parses an Elixpath expression.
Raises on error.
See parse/2
for available options.