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;
|
++lineno;
|
||||||
else {
|
else
|
||||||
while (n < line.size() && std::isdigit(line[n]))
|
lineno = row;
|
||||||
++n;
|
|
||||||
if (n < line.size() && !std::isspace(line[n]))
|
|
||||||
++lineno;
|
|
||||||
else
|
|
||||||
std::istringstream(line) >> lineno;
|
|
||||||
}
|
|
||||||
CurrentToken.clear();
|
CurrentToken.clear();
|
||||||
continue;
|
continue;
|
||||||
} else if (CurrentToken == "#endfile") {
|
} else if (CurrentToken == "#endfile") {
|
||||||
|
|
Loading…
Reference in New Issue