@@ -12,21 +12,47 @@ struct tape_builder {
12
12
dom_parser_implementation &dom_parser,
13
13
dom::document &doc) noexcept ;
14
14
15
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_root_primitive (json_iterator &iter, const uint8_t *value) noexcept ;
16
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_primitive (json_iterator &iter, const uint8_t *value) noexcept ;
17
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_empty_object (json_iterator &iter) noexcept ;
18
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_empty_array (json_iterator &iter) noexcept ;
19
-
15
+ /* * Called when a non-empty document starts. */
20
16
SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_document_start (json_iterator &iter) noexcept ;
21
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_object_start (json_iterator &iter) noexcept ;
22
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_array_start (json_iterator &iter) noexcept ;
17
+ /* * Called when a non-empty document ends without error. */
18
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_document_end (json_iterator &iter) noexcept ;
23
19
24
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_object_end (json_iterator &iter) noexcept ;
20
+ /* * Called when a non-empty array starts. */
21
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_array_start (json_iterator &iter) noexcept ;
22
+ /* * Called when a non-empty array ends. */
25
23
SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_array_end (json_iterator &iter) noexcept ;
26
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_document_end (json_iterator &iter) noexcept ;
24
+ /* * Called when an empty array is found. */
25
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_empty_array (json_iterator &iter) noexcept ;
26
+
27
+ /* * Called when a non-empty object starts. */
28
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_object_start (json_iterator &iter) noexcept ;
29
+ /* *
30
+ * Called when a key in a field is encountered.
31
+ *
32
+ * primitive, visit_object_start, visit_empty_object, visit_array_start, or visit_empty_array
33
+ * will be called after this with the field value.
34
+ */
27
35
SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_key (json_iterator &iter, const uint8_t *key) noexcept ;
36
+ /* * Called when a non-empty object ends. */
37
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_object_end (json_iterator &iter) noexcept ;
38
+ /* * Called when an empty object is found. */
39
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_empty_object (json_iterator &iter) noexcept ;
40
+
41
+ /* *
42
+ * Called when a string, number, boolean or null is found.
43
+ */
44
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_primitive (json_iterator &iter, const uint8_t *value) noexcept ;
45
+ /* *
46
+ * Called when a string, number, boolean or null is found at the top level of a document (i.e.
47
+ * when there is no array or object and the entire document is a single string, number, boolean or
48
+ * null.
49
+ *
50
+ * This is separate from primitive() because simdjson's normal primitive parsing routines assume
51
+ * there is at least one more token after the value, which is only true in an array or object.
52
+ */
53
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_root_primitive (json_iterator &iter, const uint8_t *value) noexcept ;
28
54
29
- // increment_count increments the count of keys in an object or values in an array.
55
+ /* * Called each time a new field or element in an array or object is found. */
30
56
SIMDJSON_WARN_UNUSED simdjson_really_inline error_code increment_count (json_iterator &iter) noexcept ;
31
57
32
58
private:
0 commit comments