diff --git a/src/generic/stage2/structural_iterator.h b/src/generic/stage2/structural_iterator.h index 6e102c054..36814f149 100644 --- a/src/generic/stage2/structural_iterator.h +++ b/src/generic/stage2/structural_iterator.h @@ -34,11 +34,8 @@ public: return parser.len - *current_structural; } - really_inline bool past_end(uint32_t n_structural_indexes) { - return current_structural >= &parser.structural_indexes[n_structural_indexes]; - } - really_inline bool at_end(uint32_t n_structural_indexes) { - return current_structural == &parser.structural_indexes[n_structural_indexes]; + really_inline bool at_end() { + return current_structural == &parser.structural_indexes[parser.n_structural_indexes]; } really_inline bool at_beginning() { return current_structural == parser.structural_indexes.get(); diff --git a/src/generic/stage2/structural_parser.h b/src/generic/stage2/structural_parser.h index eefadceb9..c3e2f38b5 100644 --- a/src/generic/stage2/structural_parser.h +++ b/src/generic/stage2/structural_parser.h @@ -223,6 +223,16 @@ struct structural_parser : structural_iterator { return SUCCESS; } + WARN_UNUSED really_inline error_code start() { + logger::log_start(); + + // If there are no structurals left, return EMPTY + if (at_end()) { return EMPTY; } + + // Push the root scope (there is always at least one scope) + return start_document(); + } + WARN_UNUSED really_inline error_code finish() { end_document(); parser.next_structural_index = uint32_t(current_structural + 1 - &parser.structural_indexes[0]); @@ -235,29 +245,10 @@ struct structural_parser : structural_iterator { return SUCCESS; } - really_inline void init() { - log_start(); - } - - WARN_UNUSED really_inline error_code start() { - // If there are no structurals left, return EMPTY - if (at_end(parser.n_structural_indexes)) { - return EMPTY; - } - - init(); - // Push the root scope (there is always at least one scope) - return start_document(); - } - really_inline void log_value(const char *type) { logger::log_line(*this, "", type, ""); } - static really_inline void log_start() { - logger::log_start(); - } - really_inline void log_start_value(const char *type) { logger::log_line(*this, "+", type, ""); if (logger::LOG_ENABLED) { logger::log_depth++; }