Rename fileInd to fileIndex
This commit is contained in:
parent
90a215af0e
commit
0be78bbde6
|
@ -1083,31 +1083,31 @@ std::string Token::stringifyList(bool varid, bool attributes, bool linenumbers,
|
||||||
std::ostringstream ret;
|
std::ostringstream ret;
|
||||||
|
|
||||||
unsigned int lineNumber = mImpl->mLineNumber - (linenumbers ? 1U : 0U);
|
unsigned int lineNumber = mImpl->mLineNumber - (linenumbers ? 1U : 0U);
|
||||||
unsigned int fileInd = files ? ~0U : mImpl->mFileIndex;
|
unsigned int fileIndex = files ? ~0U : mImpl->mFileIndex;
|
||||||
std::map<int, unsigned int> lineNumbers;
|
std::map<int, unsigned int> lineNumbers;
|
||||||
for (const Token *tok = this; tok != end; tok = tok->next()) {
|
for (const Token *tok = this; tok != end; tok = tok->next()) {
|
||||||
bool fileChange = false;
|
bool fileChange = false;
|
||||||
if (tok->mImpl->mFileIndex != fileInd) {
|
if (tok->mImpl->mFileIndex != fileIndex) {
|
||||||
if (fileInd != ~0U) {
|
if (fileIndex != ~0U) {
|
||||||
lineNumbers[fileInd] = tok->mImpl->mFileIndex;
|
lineNumbers[fileIndex] = tok->mImpl->mFileIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
fileInd = tok->mImpl->mFileIndex;
|
fileIndex = tok->mImpl->mFileIndex;
|
||||||
if (files) {
|
if (files) {
|
||||||
ret << "\n\n##file ";
|
ret << "\n\n##file ";
|
||||||
if (fileNames && fileNames->size() > tok->mImpl->mFileIndex)
|
if (fileNames && fileNames->size() > tok->mImpl->mFileIndex)
|
||||||
ret << fileNames->at(tok->mImpl->mFileIndex);
|
ret << fileNames->at(tok->mImpl->mFileIndex);
|
||||||
else
|
else
|
||||||
ret << fileInd;
|
ret << fileIndex;
|
||||||
ret << '\n';
|
ret << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
lineNumber = lineNumbers[fileInd];
|
lineNumber = lineNumbers[fileIndex];
|
||||||
fileChange = true;
|
fileChange = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (linebreaks && (lineNumber != tok->linenr() || fileChange)) {
|
if (linebreaks && (lineNumber != tok->linenr() || fileChange)) {
|
||||||
if (lineNumber+4 < tok->linenr() && fileInd == tok->mImpl->mFileIndex) {
|
if (lineNumber+4 < tok->linenr() && fileIndex == tok->mImpl->mFileIndex) {
|
||||||
ret << '\n' << lineNumber+1 << ":\n|\n";
|
ret << '\n' << lineNumber+1 << ":\n|\n";
|
||||||
ret << tok->linenr()-1 << ":\n";
|
ret << tok->linenr()-1 << ":\n";
|
||||||
ret << tok->linenr() << ": ";
|
ret << tok->linenr() << ": ";
|
||||||
|
|
Loading…
Reference in New Issue