Make parse part of structural_parser

This commit is contained in:
John Keiser
2020-08-03 15:47:31 -07:00
parent 03d54f8f6e
commit ee6647ce40
5 changed files with 18 additions and 20 deletions
+3 -2
View File
@@ -316,12 +316,13 @@ WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t len) cons
#include "fallback/stringparsing.h"
#include "fallback/numberparsing.h"
#include "generic/stage2/structural_parser.h"
#include "generic/stage2/tape_builder.h"
namespace {
namespace SIMDJSON_IMPLEMENTATION {
WARN_UNUSED error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept {
if (auto error = stage2::parse_structurals<false>(*this, _doc)) { return error; }
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 ) {
@@ -333,7 +334,7 @@ WARN_UNUSED error_code dom_parser_implementation::stage2(dom::document &_doc) no
}
WARN_UNUSED error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept {
return stage2::parse_structurals<true>(*this, _doc);
return stage2::structural_parser<stage2::tape_builder>::parse<true>(*this, _doc);
}
WARN_UNUSED error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept {