File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ yp_regexp_char_expect(yp_regexp_parser_t *parser, char value) {
57
57
// This advances the current token to the next instance of the given character.
58
58
static bool
59
59
yp_regexp_char_find (yp_regexp_parser_t * parser , char value ) {
60
+ if (yp_regexp_char_is_eof (parser )) {
61
+ return false;
62
+ }
60
63
const char * end = (const char * ) memchr (parser -> cursor , value , (size_t ) (parser -> end - parser -> cursor ));
61
64
if (end == NULL ) {
62
65
return false;
@@ -383,7 +386,7 @@ yp_regexp_parse_group(yp_regexp_parser_t *parser) {
383
386
break ;
384
387
case '\'' : { // named capture group
385
388
const char * start = ++ parser -> cursor ;
386
- if (yp_regexp_char_is_eof ( parser ) || !yp_regexp_char_find (parser , '\'' )) {
389
+ if (!yp_regexp_char_find (parser , '\'' )) {
387
390
return false;
388
391
}
389
392
You can’t perform that action at this time.
0 commit comments