JSON.Parser.Array (json v1.4.1) View Source

Implements a JSON Array Parser for Bitstring values

Link to this section Summary

Functions

parses a valid JSON array value, returns its elixir list representation

Link to this section Functions

parses a valid JSON array value, returns its elixir list representation

Examples

iex> JSON.Parser.Array.parse ""
{:error, :unexpected_end_of_buffer}

iex> JSON.Parser.Array.parse "[1, 2 "
{:error, :unexpected_end_of_buffer}

iex> JSON.Parser.Array.parse "face0ff"
{:error, {:unexpected_token, "face0ff"}}

iex> JSON.Parser.Array.parse "[] lala"
{:ok, [], " lala"}

iex> JSON.Parser.Array.parse "[]"
{:ok, [], ""}

iex> JSON.Parser.Array.parse "[\"foo\", 1, 2, 1.5] lala"
{:ok, ["foo", 1, 2, 1.5], " lala"}