Don't pass depth to on_end_*

This commit is contained in:
John Keiser 2020-05-11 05:15:39 -07:00
parent 54fe302907
commit 0875bce68f
3 changed files with 15 additions and 15 deletions

View File

@ -1030,9 +1030,9 @@ public:
really_inline bool on_start_object() noexcept; ///< @private
really_inline bool on_start_array() noexcept; ///< @private
// TODO we're not checking this bool
really_inline bool on_end_document(uint32_t depth) noexcept; ///< @private
really_inline bool on_end_object(uint32_t depth) noexcept; ///< @private
really_inline bool on_end_array(uint32_t depth) noexcept; ///< @private
really_inline bool on_end_document(uint32_t start_tape_index, uint32_t count) noexcept; ///< @private
really_inline bool on_end_object(const scope_descriptor &scope) noexcept; ///< @private
really_inline bool on_end_array(const scope_descriptor &scope) noexcept; ///< @private
really_inline bool on_true_atom() noexcept; ///< @private
really_inline bool on_false_atom() noexcept; ///< @private
really_inline bool on_null_atom() noexcept; ///< @private

View File

@ -40,23 +40,23 @@ really_inline bool parser::on_start_array() noexcept {
return true;
}
// TODO we're not checking this bool
really_inline bool parser::on_end_document(uint32_t depth) noexcept {
really_inline bool parser::on_end_document(uint32_t start_tape_index, uint32_t count) noexcept {
// write our doc.tape location to the header scope
// The root scope gets written *at* the previous location.
write_tape(containing_scope[depth].tape_index, internal::tape_type::ROOT);
end_scope(containing_scope[depth].tape_index, containing_scope[depth].count);
write_tape(start_tape_index, internal::tape_type::ROOT);
end_scope(start_tape_index, count);
return true;
}
really_inline bool parser::on_end_object(uint32_t depth) noexcept {
really_inline bool parser::on_end_object(const scope_descriptor &scope) noexcept {
// write our doc.tape location to the header scope
write_tape(containing_scope[depth].tape_index, internal::tape_type::END_OBJECT);
end_scope(containing_scope[depth].tape_index, containing_scope[depth].count);
write_tape(scope.tape_index, internal::tape_type::END_OBJECT);
end_scope(scope.tape_index, scope.count);
return true;
}
really_inline bool parser::on_end_array(uint32_t depth) noexcept {
really_inline bool parser::on_end_array(const scope_descriptor &scope) noexcept {
// write our doc.tape location to the header scope
write_tape(containing_scope[depth].tape_index, internal::tape_type::END_ARRAY);
end_scope(containing_scope[depth].tape_index, containing_scope[depth].count);
write_tape(scope.tape_index, internal::tape_type::END_ARRAY);
end_scope(scope.tape_index, scope.count);
return true;
}

View File

@ -154,17 +154,17 @@ struct structural_parser {
really_inline bool end_object() {
depth--;
doc_parser.on_end_object(depth);
doc_parser.on_end_object(doc_parser.containing_scope[depth]);
return false;
}
really_inline bool end_array() {
depth--;
doc_parser.on_end_array(depth);
doc_parser.on_end_array(doc_parser.containing_scope[depth]);
return false;
}
really_inline bool end_document() {
depth--;
doc_parser.on_end_document(depth);
doc_parser.on_end_document(doc_parser.containing_scope[depth].tape_index, doc_parser.containing_scope[depth].count);
return false;
}