Json Parser¶
| Spice | |
|---|---|
JsonParser struct¶
Recursive-descent JSON parser.
Use parseJson for one-shot parsing; the struct is exposed mainly so the parser state (position, error message) can be inspected when needed.
The JsonValue data model lives in "std/text/json-value" and serialization in "std/text/json-serializer".
Constructors¶
ctor¶
| Spice | |
|---|---|
Construct a JSON parser over the given input string
Parameters
| Name | Type | Description |
|---|---|---|
input |
const String& |
JSON text to parse |
Methods¶
parse¶
| Spice | |
|---|---|
Parse the input string into a JSON value tree
Returns: Result<JsonValue*> — Result holding the root JSON value, or an error if the input is malformed
Functions¶
parseJson¶
| Spice | |
|---|---|
Parse a JSON document.
On success returns the root JsonValue (heap-allocated; the caller owns it). On failure returns an error describing the first problem encountered.
Parameters
| Name | Type | Description |
|---|---|---|
input |
const String& |
Returns: Result<JsonValue*>