parseAggregate

Parses a single Hjson object or array.

void
parseAggregate
(
dchar start
dchar end
alias parseMember
Consumer
)
(
ref string hjson
,
ref size_t collumn
,
ref Consumer consumer
)

Parameters

hjson string

string being parsed. Must not contain leading whitespace. The beginning of the string until the end of the parsed Hjson value is consumed.

collumn size_t

How many dchars were popped from the front of hjson since last line feed. Will be updated by the function. Needed to properly parse multiline strings.

consumer Consumer

Object responsible for processing the parsed tokens.

start

Token which marks the beginning of parsed aggregate ('[' for array, '{' for object)

end

Token which marks the end of parsed aggregate (']' for array, '}' for object)

parseMember

Function used to parse a single aggregate member. Parameters are the same as parseAggregate. Hjson passed to parseMember contains no leading whitespace.

Throws

HjsonException if hjson starts with an invalid Hjson value. Invalid Hjson past the first valid value is not detected.

Meta