Skip to content

Commit 76348be

Browse files
committed
Don't send comma to stage 2
1 parent 0276279 commit 76348be

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/generic/stage1_find_marks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ really_inline uint64_t json_structural_scanner::find_potential_structurals(const
401401
// backslash detection before we can determine a string. We may be able to safely shove those
402402
// processes into a branch.
403403
//
404-
return (start_value & ~space) | open | close | separator;
404+
return (start_value & ~space) | open | close | colon;
405405
}
406406

407407
//

src/generic/stage2_build_tape.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ unified_machine(const uint8_t *buf, size_t len, ParsedJson &pj) {
348348

349349
object_continue:
350350
switch (parser.advance_char()) {
351-
case ',':
352-
FAIL_IF( parser.advance_char() != '"' );
351+
case '"':
353352
FAIL_IF( parser.parse_string() );
354353
goto object_key_state;
355354
case '}':
@@ -375,15 +374,10 @@ unified_machine(const uint8_t *buf, size_t len, ParsedJson &pj) {
375374
GOTO( parser.parse_value(addresses, addresses.array_continue) );
376375

377376
array_continue:
378-
switch (parser.advance_char()) {
379-
case ',':
380-
parser.advance_char();
381-
goto main_array_switch;
382-
case ']':
377+
if (parser.advance_char() == ']') {
383378
goto scope_end;
384-
default:
385-
goto error;
386379
}
380+
goto main_array_switch;
387381

388382
finish:
389383
return parser.finish();

0 commit comments

Comments
 (0)