Skip to content

JSONParser

[Source]

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.

primitive val JSONParser

Constructors

create

[Source]

new val create()
: JSONParser val^

Returns


Public Functions

parse

[Source]

Parse a complete JSON document from a string.

fun box parse(
  source: String val)
: (JSONValue | JSONParseError val)

Parameters

Returns


eq

[Source]

fun box eq(
  that: JSONParser val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: JSONParser val)
: Bool val

Parameters

Returns