# JsonParser
<span class="source-link">[[Source]](src/json/json_parser.md#L-0-1)</span>

High-level JSON parser. Returns a structured result rather than raising.

```pony
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.


```pony
primitive val JsonParser
```

## Constructors

### create
<span class="source-link">[[Source]](src/json/json_parser.md#L-0-1)</span>


```pony
new val create()
: JsonParser val^
```

#### Returns

* [JsonParser](json-JsonParser.md) val^

---

## Public Functions

### parse
<span class="source-link">[[Source]](src/json/json_parser.md#L-0-16)</span>


Parse a complete JSON document from a string.

```pony
fun box parse(
  source: String val)
: (JsonObject val | JsonArray val | String val | 
    I64 val | F64 val | Bool val | 
    None val | JsonParseError val)
```
#### Parameters

*   source: [String](builtin-String.md) val

#### Returns

* ([JsonObject](json-JsonObject.md) val | [JsonArray](json-JsonArray.md) val | [String](builtin-String.md) val | 
    [I64](builtin-I64.md) val | [F64](builtin-F64.md) val | [Bool](builtin-Bool.md) val | 
    [None](builtin-None.md) val | [JsonParseError](json-JsonParseError.md) val)

---

### eq
<span class="source-link">[[Source]](src/json/json_parser.md#L-0-16)</span>


```pony
fun box eq(
  that: JsonParser val)
: Bool val
```
#### Parameters

*   that: [JsonParser](json-JsonParser.md) val

#### Returns

* [Bool](builtin-Bool.md) val

---

### ne
<span class="source-link">[[Source]](src/json/json_parser.md#L-0-16)</span>


```pony
fun box ne(
  that: JsonParser val)
: Bool val
```
#### Parameters

*   that: [JsonParser](json-JsonParser.md) val

#### Returns

* [Bool](builtin-Bool.md) val

---

