tryParseBuiltin

Attempts to parse a builtin constant.

bool
tryParseBuiltin
(
T
Consumer
)
(
ref string hjson
,
ref size_t collumn
,,
string repr
,
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 if and only if the constant was succesfully parsed.

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.

value T

Value of the constant.

repr string

How the constant is represented in Hjson.

consumer Consumer

Object responsible for processing the parsed tokens.

Return Value

Type: bool

true if parsing the constant succeeds, false if the value was actually a quoteless string.

Throws

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

Meta