@@ -281,12 +281,12 @@ WARN_UNUSED static really_inline error_code parse_structurals(dom_parser_impleme
281
281
//
282
282
switch (parser.current_char ()) {
283
283
case ' {' : {
284
- if (parser.empty_object ()) { goto finish ; }
284
+ if (parser.empty_object ()) { goto document_end ; }
285
285
SIMDJSON_TRY ( parser.start_object () );
286
286
goto object_begin;
287
287
}
288
288
case ' [' : {
289
- if (parser.empty_array ()) { goto finish ; }
289
+ if (parser.empty_array ()) { goto document_end ; }
290
290
SIMDJSON_TRY ( parser.start_array () );
291
291
// Make sure the outer array is closed before continuing; otherwise, there are ways we could get
292
292
// into memory corruption. See https://github.com/simdjson/simdjson/issues/906
@@ -297,14 +297,14 @@ WARN_UNUSED static really_inline error_code parse_structurals(dom_parser_impleme
297
297
}
298
298
goto array_begin;
299
299
}
300
- case ' "' : SIMDJSON_TRY ( parser.parse_string () ); goto finish ;
301
- case ' t' : SIMDJSON_TRY ( parser.parse_root_true_atom () ); goto finish ;
302
- case ' f' : SIMDJSON_TRY ( parser.parse_root_false_atom () ); goto finish ;
303
- case ' n' : SIMDJSON_TRY ( parser.parse_root_null_atom () ); goto finish ;
300
+ case ' "' : SIMDJSON_TRY ( parser.parse_string () ); goto document_end ;
301
+ case ' t' : SIMDJSON_TRY ( parser.parse_root_true_atom () ); goto document_end ;
302
+ case ' f' : SIMDJSON_TRY ( parser.parse_root_false_atom () ); goto document_end ;
303
+ case ' n' : SIMDJSON_TRY ( parser.parse_root_null_atom () ); goto document_end ;
304
304
case ' -' :
305
305
case ' 0' : case ' 1' : case ' 2' : case ' 3' : case ' 4' :
306
306
case ' 5' : case ' 6' : case ' 7' : case ' 8' : case ' 9' :
307
- SIMDJSON_TRY ( parser.parse_root_number () ); goto finish ;
307
+ SIMDJSON_TRY ( parser.parse_root_number () ); goto document_end ;
308
308
default :
309
309
parser.log_error (" Document starts with a non-value character" );
310
310
return TAPE_ERROR;
@@ -320,9 +320,9 @@ WARN_UNUSED static really_inline error_code parse_structurals(dom_parser_impleme
320
320
}
321
321
parser.increment_count ();
322
322
SIMDJSON_TRY ( parser.parse_string (true ) );
323
- goto object_key_state ;
323
+ goto object_field ;
324
324
325
- object_key_state :
325
+ object_field :
326
326
if (unlikely ( parser.advance_char () != ' :' )) { parser.log_error (" Missing colon after key in object" ); return TAPE_ERROR; }
327
327
switch (parser.advance_char ()) {
328
328
case ' {' : {
@@ -354,7 +354,7 @@ WARN_UNUSED static really_inline error_code parse_structurals(dom_parser_impleme
354
354
parser.increment_count ();
355
355
if (unlikely ( parser.advance_char () != ' "' )) { parser.log_error (" Key string missing at beginning of field in object" ); return TAPE_ERROR; }
356
356
SIMDJSON_TRY ( parser.parse_string (true ) );
357
- goto object_key_state ;
357
+ goto object_field ;
358
358
case ' }' :
359
359
parser.end_object ();
360
360
goto scope_end;
@@ -364,7 +364,7 @@ WARN_UNUSED static really_inline error_code parse_structurals(dom_parser_impleme
364
364
}
365
365
366
366
scope_end:
367
- if (parser.depth == 0 ) { goto finish ; }
367
+ if (parser.depth == 0 ) { goto document_end ; }
368
368
if (parser.parser .is_array [parser.depth ]) { goto array_continue; }
369
369
goto object_continue;
370
370
@@ -374,7 +374,7 @@ WARN_UNUSED static really_inline error_code parse_structurals(dom_parser_impleme
374
374
array_begin:
375
375
parser.increment_count ();
376
376
377
- main_array_switch :
377
+ array_value :
378
378
switch (parser.advance_char ()) {
379
379
case ' {' : {
380
380
if (parser.empty_object ()) { break ; };
@@ -403,7 +403,7 @@ WARN_UNUSED static really_inline error_code parse_structurals(dom_parser_impleme
403
403
switch (parser.advance_char ()) {
404
404
case ' ,' :
405
405
parser.increment_count ();
406
- goto main_array_switch ;
406
+ goto array_value ;
407
407
case ' ]' :
408
408
parser.end_array ();
409
409
goto scope_end;
@@ -412,9 +412,10 @@ WARN_UNUSED static really_inline error_code parse_structurals(dom_parser_impleme
412
412
return TAPE_ERROR;
413
413
}
414
414
415
- finish :
415
+ document_end :
416
416
return parser.finish ();
417
- }
417
+
418
+ } // parse_structurals()
418
419
419
420
} // namespace stage2
420
421
} // namespace SIMDJSON_IMPLEMENTATION
0 commit comments