mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:27:35 +00:00
AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional)
Also add slightly richer parse errors now that we can include a string literal with returned errors. This will allow us to use TRY() when working with JSON data.
This commit is contained in:
parent
304c03f457
commit
587f9af960
54 changed files with 172 additions and 228 deletions
|
@ -18,19 +18,19 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
Optional<JsonValue> parse();
|
||||
ErrorOr<JsonValue> parse();
|
||||
|
||||
private:
|
||||
Optional<JsonValue> parse_helper();
|
||||
ErrorOr<JsonValue> parse_helper();
|
||||
|
||||
String consume_and_unescape_string();
|
||||
Optional<JsonValue> parse_array();
|
||||
Optional<JsonValue> parse_object();
|
||||
Optional<JsonValue> parse_number();
|
||||
Optional<JsonValue> parse_string();
|
||||
Optional<JsonValue> parse_false();
|
||||
Optional<JsonValue> parse_true();
|
||||
Optional<JsonValue> parse_null();
|
||||
ErrorOr<String> consume_and_unescape_string();
|
||||
ErrorOr<JsonValue> parse_array();
|
||||
ErrorOr<JsonValue> parse_object();
|
||||
ErrorOr<JsonValue> parse_number();
|
||||
ErrorOr<JsonValue> parse_string();
|
||||
ErrorOr<JsonValue> parse_false();
|
||||
ErrorOr<JsonValue> parse_true();
|
||||
ErrorOr<JsonValue> parse_null();
|
||||
|
||||
String m_last_string_starting_with_character[256];
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue