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 an internal tree builder assembles the result.

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)
: (JsonObject val | JsonArray val | String val | 
    I64 val | F64 val | Bool val | 
    None val | 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