Clear key after matching on it

This commit is contained in:
2025-08-14 16:49:20 -04:00
parent 52381467f7
commit ee5d14c4cd
3 changed files with 67 additions and 28 deletions

View File

@@ -89,7 +89,7 @@ public:
ArenaString current_string;
ArenaString current_number;
bool in_key = false;
bool parse_error = false;
const char *parse_error = nullptr;
bool parse_complete = false;
// Current objects being parsed
@@ -222,7 +222,15 @@ public:
* @brief Check if there was a parse error.
* @return true if there was a parse error
*/
bool has_parse_error() const { return parser_context_.parse_error; }
bool has_parse_error() const {
return parser_context_.parse_error != nullptr;
}
/**
* @brief Get the parse error message if there was an error.
* @return Error message string, or nullptr if no error
*/
const char *get_parse_error() const { return parser_context_.parse_error; }
/**
* @brief Get the request ID if present.