Elixpath.sigil_p
You're seeing just the macro
sigil_p
, go back to Elixpath module for more information.
Compiles string to internal Elixpath representation.
Warning: Do not specify unsafe_atom
modifier (u
) for untrusted input.
See String.to_atom/1
, which this function uses to create new atom, for details.
Modifiers
unsafe_atom
(u) - passesunsafe_atom: true
option toElixpath.Parser.parse/2
.atom_keys_preferred
(a) - passesprefer_keys: :atom
option toElixpath.Parser.parse/2
.
Examples
iex> import Elixpath, only: [sigil_p: 2]
iex> ~p/.string..:b[1]/
#Elixpath<[elixpath_child: "string", elixpath_descendant: :b, elixpath_child: 1]>
iex> ~p/.atom..:b[1]/a
#Elixpath<[elixpath_child: :atom, elixpath_descendant: :b, elixpath_child: 1]>