summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-03-01 00:05:54 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-03-01 00:05:54 +0900
commitcd0ac59dd36fc515e3667ab462fe8c4424b5928a (patch)
treecb8aaa1d18aab06adebcc31a199334f73ec65bc2 /mrbgems/mruby-compiler
parent1a1f834adeb243c5938604eb826c65d1f0efede0 (diff)
downloadmruby-cd0ac59dd36fc515e3667ab462fe8c4424b5928a.tar.gz
mruby-cd0ac59dd36fc515e3667ab462fe8c4424b5928a.zip
Newlines in strings should be counted; fix #3477
Diffstat (limited to 'mrbgems/mruby-compiler')
-rw-r--r--mrbgems/mruby-compiler/core/parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index 1203393bf..6548eb18c 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -4069,6 +4069,10 @@ parse_string(parser_state *p)
return tSTRING_MID;
}
}
+ if (c == '\n') {
+ p->lineno++;
+ p->column = 0;
+ }
tokadd(p, c);
}