diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-06-15 12:52:57 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-06-17 12:18:57 +0900 |
| commit | 4296c77e29b67e72399dde8295dd6fa4a10cc321 (patch) | |
| tree | f817694d59cb86b8f67d163a3c71c67bf755c308 | |
| parent | 4124047ccec9c299002902750fcb4b6534bbbdca (diff) | |
| download | mruby-4296c77e29b67e72399dde8295dd6fa4a10cc321.tar.gz mruby-4296c77e29b67e72399dde8295dd6fa4a10cc321.zip | |
Allow newlines and comments between method calls.
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index ff4016d8b..6ab91ce91 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -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, '.'); |
