mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
De-templatize stage2::structural_parser
This commit is contained in:
@@ -114,19 +114,15 @@ WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t len) cons
|
||||
}
|
||||
|
||||
WARN_UNUSED error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept {
|
||||
if (auto error = stage2::structural_parser<stage2::tape_builder>::parse<false>(*this, _doc)) { return error; }
|
||||
|
||||
// If we didn't make it to the end, it's an error
|
||||
if ( next_structural_index != n_structural_indexes ) {
|
||||
logger::log_string("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
|
||||
return TAPE_ERROR;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
doc = &_doc;
|
||||
stage2::tape_builder builder(*doc);
|
||||
return stage2::structural_parser::parse<false>(*this, builder);
|
||||
}
|
||||
|
||||
WARN_UNUSED error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept {
|
||||
return stage2::structural_parser<stage2::tape_builder>::parse<true>(*this, _doc);
|
||||
doc = &_doc;
|
||||
stage2::tape_builder builder(_doc);
|
||||
return stage2::structural_parser::parse<true>(*this, builder);
|
||||
}
|
||||
|
||||
WARN_UNUSED error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept {
|
||||
|
||||
Reference in New Issue
Block a user