diff options
| author | Nobuyoshi Nakada <[email protected]> | 2014-04-30 12:32:18 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <[email protected]> | 2014-05-03 08:42:31 +0900 |
| commit | cf3b880df6df004b9471c3bf67aa44774e3ca952 (patch) | |
| tree | 034f68f607ea1197bb675d652f87dcdce303cc31 | |
| parent | 82fce52211f729c98bce1f4cd020157e56a4fd4d (diff) | |
| download | mruby-cf3b880df6df004b9471c3bf67aa44774e3ca952.tar.gz mruby-cf3b880df6df004b9471c3bf67aa44774e3ca952.zip | |
skip to the next line and reset column after `=end`
| -rw-r--r-- | src/parse.y | 3 | ||||
| -rw-r--r-- | test/t/syntax.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/parse.y b/src/parse.y index 082b49294..b0e324202 100644 --- a/src/parse.y +++ b/src/parse.y @@ -4206,6 +4206,9 @@ parser_yylex(parser_state *p) } c = nextc(p); } while (!(c < 0 || isspace(c))); + if (c != '\n') skip(p, '\n'); + p->lineno++; + p->column = 0; goto retry; } } diff --git a/test/t/syntax.rb b/test/t/syntax.rb index 05d4a15b1..a64000534 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -309,6 +309,6 @@ this is a comment that has extra after =begin and =end with spaces after it =end =begin this is a comment this is a comment that has extra after =begin and =end with tabs after it -=end +=end xxxxxxxxxxxxxxxxxxxxxxxxxx true end |
