summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-04-29 12:29:29 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-04-29 12:29:29 +0900
commita2dc6f7db9c823d66371829e909d0c8b21ba13fb (patch)
treed6e9c2d56072132a6c0945f343ffb31b4362008e /src
parent0bd99d79595a3baf3fd4824f839a8e1f9ee7468c (diff)
parent9ac817ae7820d6cc6a7658997a63584daea1a296 (diff)
downloadmruby-a2dc6f7db9c823d66371829e909d0c8b21ba13fb.tar.gz
mruby-a2dc6f7db9c823d66371829e909d0c8b21ba13fb.zip
Merge pull request #2151 from carsonmcdonald/multilinecommentfix
Fix multiline comments
Diffstat (limited to 'src')
-rw-r--r--src/parse.y11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/parse.y b/src/parse.y
index 0d281feeb..aab1aaa40 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3429,7 +3429,7 @@ peek_n(parser_state *p, int c, int n)
list = push(list, (node*)(intptr_t)c0);
} while(n--);
if (p->pb) {
- p->pb = append(p->pb, (node*)list);
+ p->pb = append((node*)list, p->pb);
}
else {
p->pb = list;
@@ -4189,8 +4189,13 @@ parser_yylex(parser_state *p)
case '=':
if (p->column == 1) {
- if (peeks(p, "begin\n")) {
- skips(p, "\n=end\n");
+ if (peeks(p, "begin ") || peeks(p, "begin\n")) {
+ if (skips(p, "\n=end ")) {
+ goto retry;
+ }
+ if (skips(p, "\n=end\n")) {
+ goto retry;
+ }
goto retry;
}
}