json v1.0.3 JSON.Parser.Charlist.Array View Source

Implements a JSON Array Parser for Charlist 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.Charlist.Array.parse ''
{:error, :unexpected_end_of_buffer}

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

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

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

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

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