@@ -2,12 +2,21 @@ namespace stage2 {
22
33class structural_iterator {
44public:
5- really_inline structural_iterator (const uint8_t * _buf, size_t _len, const uint32_t *_structural_indexes, size_t next_structural_index)
6- : buf{_buf},
7- len{_len},
8- structural_indexes{_structural_indexes},
9- next_structural{next_structural_index}
10- {}
5+ const uint8_t * const buf;
6+ const size_t len;
7+ const uint32_t * const structural_indexes;
8+ size_t next_structural; // next structural index
9+ size_t idx{0 }; // location of the structural character in the input (buf)
10+ uint8_t c{0 }; // used to track the (structural) character we are looking at
11+ dom_parser_implementation &parser;
12+
13+ really_inline structural_iterator (dom_parser_implementation &_parser, size_t _next_structural)
14+ : buf{_parser.buf },
15+ len{_parser.len },
16+ structural_indexes{_parser.structural_indexes .get ()},
17+ next_structural{_next_structural},
18+ parser{_parser} {
19+ }
1120 really_inline char advance_char () {
1221 idx = structural_indexes[next_structural];
1322 next_structural++;
@@ -63,13 +72,6 @@ class structural_iterator {
6372 really_inline size_t next_structural_index () {
6473 return next_structural;
6574 }
66-
67- const uint8_t * const buf;
68- const size_t len;
69- const uint32_t * const structural_indexes;
70- size_t next_structural; // next structural index
71- size_t idx{0 }; // location of the structural character in the input (buf)
72- uint8_t c{0 }; // used to track the (structural) character we are looking at
7375};
7476
7577} // namespace stage2
0 commit comments