@@ -17,81 +17,81 @@ struct tape_builder {
17
17
return iter.walk_document <STREAMING>(builder);
18
18
}
19
19
20
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code root_primitive (json_iterator &iter, const uint8_t *value) {
20
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_root_primitive (json_iterator &iter, const uint8_t *value) {
21
21
switch (*value) {
22
- case ' "' : return parse_string (iter, value);
23
- case ' t' : return parse_root_true_atom (iter, value);
24
- case ' f' : return parse_root_false_atom (iter, value);
25
- case ' n' : return parse_root_null_atom (iter, value);
22
+ case ' "' : return visit_string (iter, value);
23
+ case ' t' : return visit_root_true_atom (iter, value);
24
+ case ' f' : return visit_root_false_atom (iter, value);
25
+ case ' n' : return visit_root_null_atom (iter, value);
26
26
case ' -' :
27
27
case ' 0' : case ' 1' : case ' 2' : case ' 3' : case ' 4' :
28
28
case ' 5' : case ' 6' : case ' 7' : case ' 8' : case ' 9' :
29
- return parse_root_number (iter, value);
29
+ return visit_root_number (iter, value);
30
30
default :
31
31
iter.log_error (" Document starts with a non-value character" );
32
32
return TAPE_ERROR;
33
33
}
34
34
}
35
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code primitive (json_iterator &iter, const uint8_t *value) {
35
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_primitive (json_iterator &iter, const uint8_t *value) {
36
36
switch (*value) {
37
- case ' "' : return parse_string (iter, value);
38
- case ' t' : return parse_true_atom (iter, value);
39
- case ' f' : return parse_false_atom (iter, value);
40
- case ' n' : return parse_null_atom (iter, value);
37
+ case ' "' : return visit_string (iter, value);
38
+ case ' t' : return visit_true_atom (iter, value);
39
+ case ' f' : return visit_false_atom (iter, value);
40
+ case ' n' : return visit_null_atom (iter, value);
41
41
case ' -' :
42
42
case ' 0' : case ' 1' : case ' 2' : case ' 3' : case ' 4' :
43
43
case ' 5' : case ' 6' : case ' 7' : case ' 8' : case ' 9' :
44
- return parse_number (iter, value);
44
+ return visit_number (iter, value);
45
45
default :
46
46
iter.log_error (" Non-value found when value was expected!" );
47
47
return TAPE_ERROR;
48
48
}
49
49
}
50
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code empty_object (json_iterator &iter) {
50
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_empty_object (json_iterator &iter) {
51
51
iter.log_value (" empty object" );
52
52
return empty_container (iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT);
53
53
}
54
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code empty_array (json_iterator &iter) {
54
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_empty_array (json_iterator &iter) {
55
55
iter.log_value (" empty array" );
56
56
return empty_container (iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY);
57
57
}
58
58
59
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code start_document (json_iterator &iter) {
59
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_document_start (json_iterator &iter) {
60
60
iter.log_start_value (" document" );
61
61
start_container (iter);
62
62
iter.dom_parser .is_array [iter.depth ] = false ;
63
63
return SUCCESS;
64
64
}
65
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code start_object (json_iterator &iter) {
65
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_object_start (json_iterator &iter) {
66
66
iter.log_start_value (" object" );
67
67
start_container (iter);
68
68
iter.dom_parser .is_array [iter.depth ] = false ;
69
69
return SUCCESS;
70
70
}
71
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code start_array (json_iterator &iter) {
71
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_array_start (json_iterator &iter) {
72
72
iter.log_start_value (" array" );
73
73
start_container (iter);
74
74
iter.dom_parser .is_array [iter.depth ] = true ;
75
75
return SUCCESS;
76
76
}
77
77
78
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code end_object (json_iterator &iter) {
78
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_object_end (json_iterator &iter) {
79
79
iter.log_end_value (" object" );
80
80
return end_container (iter, internal::tape_type::START_OBJECT, internal::tape_type::END_OBJECT);
81
81
}
82
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code end_array (json_iterator &iter) {
82
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_array_end (json_iterator &iter) {
83
83
iter.log_end_value (" array" );
84
84
return end_container (iter, internal::tape_type::START_ARRAY, internal::tape_type::END_ARRAY);
85
85
}
86
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code end_document (json_iterator &iter) {
86
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_document_end (json_iterator &iter) {
87
87
iter.log_end_value (" document" );
88
88
constexpr uint32_t start_tape_index = 0 ;
89
89
tape.append (start_tape_index, internal::tape_type::ROOT);
90
90
tape_writer::write (iter.dom_parser .doc ->tape [start_tape_index], next_tape_index (iter), internal::tape_type::ROOT);
91
91
return SUCCESS;
92
92
}
93
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code key (json_iterator &iter, const uint8_t *key) {
94
- return parse_string (iter, key, true );
93
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_key (json_iterator &iter, const uint8_t *key) {
94
+ return visit_string (iter, key, true );
95
95
}
96
96
97
97
// increment_count increments the count of keys in an object or values in an array.
@@ -111,7 +111,7 @@ struct tape_builder {
111
111
112
112
simdjson_really_inline tape_builder (dom::document &doc) noexcept : tape{doc.tape .get ()}, current_string_buf_loc{doc.string_buf .get ()} {}
113
113
114
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code parse_string (json_iterator &iter, const uint8_t *value, bool key = false ) {
114
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_string (json_iterator &iter, const uint8_t *value, bool key = false ) {
115
115
iter.log_value (key ? " key" : " string" );
116
116
uint8_t *dst = on_start_string (iter);
117
117
dst = stringparsing::parse_string (value, dst);
@@ -123,13 +123,13 @@ struct tape_builder {
123
123
return SUCCESS;
124
124
}
125
125
126
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code parse_number (json_iterator &iter, const uint8_t *value) {
126
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_number (json_iterator &iter, const uint8_t *value) {
127
127
iter.log_value (" number" );
128
128
if (!numberparsing::parse_number (value, tape)) { iter.log_error (" Invalid number" ); return NUMBER_ERROR; }
129
129
return SUCCESS;
130
130
}
131
131
132
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code parse_root_number (json_iterator &iter, const uint8_t *value) {
132
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_root_number (json_iterator &iter, const uint8_t *value) {
133
133
//
134
134
// We need to make a copy to make sure that the string is space terminated.
135
135
// This is not about padding the input, which should already padded up
@@ -149,47 +149,47 @@ struct tape_builder {
149
149
}
150
150
memcpy (copy, value, iter.remaining_len ());
151
151
memset (copy + iter.remaining_len (), ' ' , SIMDJSON_PADDING);
152
- error_code error = parse_number (iter, copy);
152
+ error_code error = visit_number (iter, copy);
153
153
free (copy);
154
154
return error;
155
155
}
156
156
157
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code parse_true_atom (json_iterator &iter, const uint8_t *value) {
157
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_true_atom (json_iterator &iter, const uint8_t *value) {
158
158
iter.log_value (" true" );
159
159
if (!atomparsing::is_valid_true_atom (value)) { return T_ATOM_ERROR; }
160
160
tape.append (0 , internal::tape_type::TRUE_VALUE);
161
161
return SUCCESS;
162
162
}
163
163
164
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code parse_root_true_atom (json_iterator &iter, const uint8_t *value) {
164
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_root_true_atom (json_iterator &iter, const uint8_t *value) {
165
165
iter.log_value (" true" );
166
166
if (!atomparsing::is_valid_true_atom (value, iter.remaining_len ())) { return T_ATOM_ERROR; }
167
167
tape.append (0 , internal::tape_type::TRUE_VALUE);
168
168
return SUCCESS;
169
169
}
170
170
171
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code parse_false_atom (json_iterator &iter, const uint8_t *value) {
171
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_false_atom (json_iterator &iter, const uint8_t *value) {
172
172
iter.log_value (" false" );
173
173
if (!atomparsing::is_valid_false_atom (value)) { return F_ATOM_ERROR; }
174
174
tape.append (0 , internal::tape_type::FALSE_VALUE);
175
175
return SUCCESS;
176
176
}
177
177
178
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code parse_root_false_atom (json_iterator &iter, const uint8_t *value) {
178
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_root_false_atom (json_iterator &iter, const uint8_t *value) {
179
179
iter.log_value (" false" );
180
180
if (!atomparsing::is_valid_false_atom (value, iter.remaining_len ())) { return F_ATOM_ERROR; }
181
181
tape.append (0 , internal::tape_type::FALSE_VALUE);
182
182
return SUCCESS;
183
183
}
184
184
185
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code parse_null_atom (json_iterator &iter, const uint8_t *value) {
185
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_null_atom (json_iterator &iter, const uint8_t *value) {
186
186
iter.log_value (" null" );
187
187
if (!atomparsing::is_valid_null_atom (value)) { return N_ATOM_ERROR; }
188
188
tape.append (0 , internal::tape_type::NULL_VALUE);
189
189
return SUCCESS;
190
190
}
191
191
192
- SIMDJSON_WARN_UNUSED simdjson_really_inline error_code parse_root_null_atom (json_iterator &iter, const uint8_t *value) {
192
+ SIMDJSON_WARN_UNUSED simdjson_really_inline error_code visit_root_null_atom (json_iterator &iter, const uint8_t *value) {
193
193
iter.log_value (" null" );
194
194
if (!atomparsing::is_valid_null_atom (value, iter.remaining_len ())) { return N_ATOM_ERROR; }
195
195
tape.append (0 , internal::tape_type::NULL_VALUE);
0 commit comments