1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Keep lex.pcur after looking_at_eol_p

This commit is contained in:
Nobuyoshi Nakada 2019-11-04 23:37:53 +09:00
parent 26316cc350
commit e91e3274be
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -6283,11 +6283,11 @@ pushback(struct parser_params *p, int c)
static int
looking_at_eol_p(struct parser_params *p)
{
int c;
while ((c = nextc(p)) != -1) {
const char *ptr = p->lex.pcur;
while (ptr < p->lex.pend) {
int c = (unsigned char)*ptr++;
int eol = (c == '\n' || c == '#');
if (eol || !ISSPACE(c)) {
pushback(p, c);
return eol;
}
}