tryParseNumber

Attempts to parse a Hjson number.

bool
tryParseNumber
(
Consumer
)
(
ref string hjson
,
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 number was succesfully parsed.

consumer Consumer

Object responsible for processing the parsed tokens.

Return Value

Type: bool

true if parsing the number 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