JSON.Parser.String (json v1.4.1) View Source
Implements a JSON String Parser for Bitstring values
Link to this section Summary
Functions
parses a valid JSON string, returns its elixir representation
Link to this section Functions
parses a valid JSON string, returns its elixir representation
Examples
iex> JSON.Parser.String.parse ""
{:error, :unexpected_end_of_buffer}
iex> JSON.Parser.String.parse "face0ff"
{:error, {:unexpected_token, "face0ff"}}
iex> JSON.Parser.String.parse "-hello"
{:error, {:unexpected_token, "-hello"}}
iex> JSON.Parser.String.parse "129245"
{:error, {:unexpected_token, "129245"}}
iex> JSON.Parser.String.parse "\"7.something\""
{:ok, "7.something", ""}
iex> JSON.Parser.String.parse "\"-88.22suffix\" foo bar"
{:ok, "-88.22suffix", " foo bar"}
iex> JSON.Parser.String.parse "\"star -> \\u272d <- star\""
{:ok, "star -> ✭ <- star", ""}
iex> JSON.Parser.String.parse "\"\\u00df ist wunderbar\""
{:ok, "ß ist wunderbar", ""}
iex> JSON.Parser.String.parse "\"Rafaëlla\" foo bar"
{:ok, "Rafaëlla", " foo bar"}
iex> JSON.Parser.String.parse "\"Éloise woot\" Éloise"
{:ok, "Éloise woot", " Éloise"}