Make the skip count correct (even if not used currently)

This commit is contained in:
Jean Pierre Cimalando 2020-04-20 22:59:00 +02:00
parent 605e552a25
commit 353cea949e

View file

@ -389,20 +389,21 @@ size_t Parser::skipComment()
switch (commentType) {
case CommentType::Line:
{
int c;
while ((c = reader.getChar()) != Reader::kEof && c != '\r' && c != '\n')
++count;
terminated = true;
while (!terminated) {
int c = reader.getChar();
count += (c != Reader::kEof);
terminated = c == Reader::kEof || c == '\r' || c == '\n';
}
break;
case CommentType::Block:
{
int c1 = 0;
int c2 = reader.getChar();
count += (c2 != Reader::kEof);
while (!terminated && c2 != Reader::kEof) {
c1 = c2;
c2 = reader.getChar();
count += (c2 != Reader::kEof);
terminated = c1 == '*' && c2 == '/';
}
}