Commit 8b13efc2 authored by Nobuyoshi Nakada's avatar Nobuyoshi Nakada

count skipped line numbers

parent cf3b880d
...@@ -3475,6 +3475,10 @@ skips(parser_state *p, const char *s) ...@@ -3475,6 +3475,10 @@ skips(parser_state *p, const char *s)
for (;;) { for (;;) {
c = nextc(p); c = nextc(p);
if (c < 0) return c; if (c < 0) return c;
if (c == '\n') {
p->lineno++;
p->column = 0;
}
if (c == *s) break; if (c == *s) break;
} }
s++; s++;
...@@ -3482,7 +3486,10 @@ skips(parser_state *p, const char *s) ...@@ -3482,7 +3486,10 @@ skips(parser_state *p, const char *s)
int len = strlen(s); int len = strlen(s);
while (len--) { while (len--) {
nextc(p); if (nextc(p) == '\n') {
p->lineno++;
p->column = 0;
}
} }
return TRUE; return TRUE;
} }
......
...@@ -307,8 +307,9 @@ this is a comment that has =end with spaces after it ...@@ -307,8 +307,9 @@ this is a comment that has =end with spaces after it
=begin this is a comment =begin this is a comment
this is a comment that has extra after =begin and =end with spaces after it this is a comment that has extra after =begin and =end with spaces after it
=end =end
line = __LINE__
=begin this is a comment =begin this is a comment
this is a comment that has extra after =begin and =end with tabs after it this is a comment that has extra after =begin and =end with tabs after it
=end xxxxxxxxxxxxxxxxxxxxxxxxxx =end xxxxxxxxxxxxxxxxxxxxxxxxxx
true assert_equal(line + 4, __LINE__)
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment