hjson.parser

Undocumented in source.

Members

Aliases

enforce
alias enforce = _enforce!HjsonException
Undocumented in source.

Classes

HjsonException
class HjsonException

Functions

isPunctuator
bool isPunctuator(dchar c)

Checks whether given dchar is a Hjson punctuator. Hjson quoteless strings may not start with a punctuator, and quoteless object keys may not contain any punctuators.

parseAggregate
void parseAggregate(string hjson, size_t collumn, Consumer consumer)

Parses a single Hjson object or array.

parseHjson
JSONValue parseHjson(string hjson)

Parses a Hjson value into a JSONValue object.

parseHjson
void parseHjson(string hjson, Consumer consumer)

Parses a Hjson value and feeds the parsed tokens into given consumer. This allows for parsing into representations other than std.json.JSONValue.

parseJSONString
string parseJSONString(string hjson, size_t collumn)

Parses a Hjson JSON-string.

parseMultilineString
string parseMultilineString(string hjson, size_t collumn)

Parses a Hjson multiline string.

parseObjectMember
void parseObjectMember(string hjson, size_t collumn, Consumer consumer)

Parses a single object member.

parseQuotelessString
string parseQuotelessString(string hjson)

Parses a Hjson quoteless string.

parseValue
void parseValue(string hjson, size_t collumn, Consumer consumer)

Parses a single Hjson value (object, array, string, number, bool or null).

skipWC
bool skipWC(string hjson, size_t collumn)

Consumes all whitespace and comments from the front of the passed Hjson.

tryParseBuiltin
bool tryParseBuiltin(string hjson, size_t collumn, T value, string repr, Consumer consumer)

Attempts to parse a builtin constant.

tryParseNumber
bool tryParseNumber(string hjson, Consumer consumer)

Attempts to parse a Hjson number.

turnsIntoQuotelessString
bool turnsIntoQuotelessString(string sufix)

In JSON you can determine the type of the parsed value by looking at just their first character. In Hjson if you follow a valid JSON number/bool/null with certain other characters it will turn into a quoteless string. This function checks whether parsed value turns into a quoteless string by looking at the following characters.

Imports

JSONValue (from std.json)
public import std.json : JSONValue;
Undocumented in source.

Meta