Fixed #4505 (test/testtokenize.cpp: Assertion failed in 'make check')
This commit is contained in:
parent
cecd726b11
commit
569b2ae9cd
|
@ -294,19 +294,11 @@ bool TokenList::createTokens(std::istream &code, const std::string& file0)
|
||||||
std::getline(code, line);
|
std::getline(code, line);
|
||||||
|
|
||||||
// Update the current line number
|
// Update the current line number
|
||||||
std::string::size_type n = 0;
|
unsigned int row;
|
||||||
while (n < line.size() && std::isspace(line[n]))
|
if (!(std::stringstream(line) >> row))
|
||||||
++n;
|
|
||||||
if (n == line.size())
|
|
||||||
++lineno;
|
|
||||||
else {
|
|
||||||
while (n < line.size() && std::isdigit(line[n]))
|
|
||||||
++n;
|
|
||||||
if (n < line.size() && !std::isspace(line[n]))
|
|
||||||
++lineno;
|
++lineno;
|
||||||
else
|
else
|
||||||
std::istringstream(line) >> lineno;
|
lineno = row;
|
||||||
}
|
|
||||||
CurrentToken.clear();
|
CurrentToken.clear();
|
||||||
continue;
|
continue;
|
||||||
} else if (CurrentToken == "#endfile") {
|
} else if (CurrentToken == "#endfile") {
|
||||||
|
|
Loading…
Reference in New Issue