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:
parent
26316cc350
commit
e91e3274be
1 changed files with 3 additions and 3 deletions
6
parse.y
6
parse.y
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue