summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2014-04-30 12:43:14 +0900
committerNobuyoshi Nakada <[email protected]>2014-05-03 08:42:32 +0900
commit8b13efc26d4a753490427a6db4c874844ea4a5de (patch)
treef7837f5dac220daf71ad0f0661ca286acf7b3245 /src/parse.y
parentcf3b880df6df004b9471c3bf67aa44774e3ca952 (diff)
downloadmruby-8b13efc26d4a753490427a6db4c874844ea4a5de.tar.gz
mruby-8b13efc26d4a753490427a6db4c874844ea4a5de.zip
count skipped line numbers
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/parse.y b/src/parse.y
index b0e324202..230d7659e 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3475,6 +3475,10 @@ skips(parser_state *p, const char *s)
for (;;) {
c = nextc(p);
if (c < 0) return c;
+ if (c == '\n') {
+ p->lineno++;
+ p->column = 0;
+ }
if (c == *s) break;
}
s++;
@@ -3482,7 +3486,10 @@ skips(parser_state *p, const char *s)
int len = strlen(s);
while (len--) {
- nextc(p);
+ if (nextc(p) == '\n') {
+ p->lineno++;
+ p->column = 0;
+ }
}
return TRUE;
}