JsonParser

If AllowNaN is true, then NaN, Infinity, and -Infinity are parsed.

NaN, Infinity, and -Infinity are technically not part of the JSON specification, but Javascript writes it by default, so it is by the far the most common cause of invalid JSON. Practically all JSON parsers (eg, Google GSON, Jackson, Ruby's JSON, simplejson, JSON.net, Lua CJson) ...have an option to accept NaN.

Constructors

this
this(const(T)[] text)

Construct a parser from a string

Members

Enums

Token
enum Token

JSON tokens. The last three are used only if AllowNaN is true

Functions

expected
void expected(cstring token)
expected
void expected(cstring token, const(T)* point)

Report error about an expected token not being found

next
bool next()
reset
bool reset(const(T)[] json)

Reset the parser to a new string

type
Token type()
value
const(T)[] value()

Variables

curType
Token curType;
Undocumented in source.
exception
JsonParserException exception;
Undocumented in source.
str
Iterator str;
Undocumented in source.

Meta