Skip to content
Permalink
Browse files
Allow newlines and comments between method calls.
  • Loading branch information
matz committed Jun 17, 2019
1 parent 4124047 commit 4296c77e29b67e72399dde8295dd6fa4a10cc321
Showing 1 changed file with 8 additions and 0 deletions.
@@ -4757,6 +4757,14 @@ parser_yylex(parser_state *p)
case '\13': /* '\v' */
space_seen = 1;
break;
case '#': /* comment as a whitespace */
pushback(p, '#');
goto retry;
case '\n': /* consecutive newlines */
p->lineno++;
p->column = 0;
pushback(p, '\n');
goto retry;
case '.':
if (!peek(p, '.')) {
pushback(p, '.');

3 comments on commit 4296c77

@shuujii
Copy link
Contributor

@shuujii shuujii commented on 4296c77 Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this feature, but it doesn't seem to introduce to CRuby. Is this intentional?

@matz
Copy link
Member Author

@matz matz commented on 4296c77 Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be implemented also in CRuby soon.

@shuujii
Copy link
Contributor

@shuujii shuujii commented on 4296c77 Jun 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your reply. That's good news for me 😄

BTW, #4513 seems to be due to this change.

Please sign in to comment.