JSONParser¶
High-level JSON parser. Returns a structured result rather than raising.
match JSONParser.parse(source)
| let json: JSONValue => // use json
| let err: JSONParseError => env.err.print(err.string())
end
Built on top of JSONTokenParser: the token parser handles all parsing
logic, and a JSONReassembler assembles the tokens into the result.
parse() applies no resource limits — it is for a whole document already
in memory, which is trusted to be as large as it is. For input of unknown
origin, or that arrives in pieces, use JSONTokenParser directly with a
JSONParseLimits.
Constructors¶
create¶
Returns¶
- JSONParser val^
Public Functions¶
parse¶
Parse a complete JSON document from a string.
Parameters¶
- source: String val
Returns¶
- (JSONValue | JSONParseError val)
eq¶
Parameters¶
- that: JSONParser val
Returns¶
- Bool val
ne¶
Parameters¶
- that: JSONParser val
Returns¶
- Bool val