yameru v0.1.0 Yameru

Yameru library for Elixir

Value

This parser map any value (scalar, block or tuple) to {scalar, block} form. When either one isn’t exist, just set nil.

Example

iex> input = """
...> key 1: scalar
...> key 2:
...>     - block
...> key 3: tuple /
...>     scalar and block
...> """
iex> {:ok, result} = Yameru.parse(input)
iex> result
%{
  "key 1" => {"scalar", nil},
  "key 2" => {nil, [{"block", nil}]},
  "key 3" => {"tuple", "scalar and block"}
}

Link to this section Summary

Functions

Loads and parses given name file

Parses given string

Link to this section Types

Link to this type block()
block() :: String.t() | dictionary() | sequence()
Link to this type dictionary()
dictionary() :: %{optional(scalar()) => sb()}
Link to this type sb()
sb() :: {scalar(), block()} | {scalar(), nil} | {nil, block()}
Link to this type scalar()
scalar() :: String.t() | special_scalar()
Link to this type sequence()
sequence() :: [sb()]
Link to this type special_scalar()
special_scalar() ::
  integer() | float() | boolean() | Date.t() | Time.t() | NaiveDateTime.t()

Link to this section Functions

Link to this function load(path)
load(Path.t()) :: {:ok, term()} | {:error, term()}

Loads and parses given name file.

Parses given string.