mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
count skipped line numbers
This commit is contained in:
+8
-1
@@ -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;
|
||||
}
|
||||
|
||||
+2
-1
@@ -307,8 +307,9 @@ this is a comment that has =end with spaces after it
|
||||
=begin this is a comment
|
||||
this is a comment that has extra after =begin and =end with spaces after it
|
||||
=end
|
||||
line = __LINE__
|
||||
=begin this is a comment
|
||||
this is a comment that has extra after =begin and =end with tabs after it
|
||||
=end xxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
true
|
||||
assert_equal(line + 4, __LINE__)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user