Make tape_builder primary entry point to stage 2

This commit is contained in:
John Keiser
2020-08-06 09:48:36 -07:00
parent d6339aa015
commit 04d39c0961
6 changed files with 22 additions and 36 deletions
+2 -7
View File
@@ -315,22 +315,17 @@ SIMDJSON_WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t
//
#include "fallback/stringparsing.h"
#include "fallback/numberparsing.h"
#include "generic/stage2/structural_parser.h"
#include "generic/stage2/tape_builder.h"
namespace {
namespace SIMDJSON_IMPLEMENTATION {
SIMDJSON_WARN_UNUSED error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept {
doc = &_doc;
stage2::tape_builder builder(*doc);
return stage2::structural_parser::parse<false>(*this, builder);
return stage2::tape_builder::parse_document<false>(*this, _doc);
}
SIMDJSON_WARN_UNUSED error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept {
doc = &_doc;
stage2::tape_builder builder(_doc);
return stage2::structural_parser::parse<true>(*this, builder);
return stage2::tape_builder::parse_document<true>(*this, _doc);
}
SIMDJSON_WARN_UNUSED error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept {