fixed recovering of includes
This commit is contained in:
@@ -577,10 +577,20 @@ string removeIncludeStatsAndUnparse(SgFile *file, const char *fileName, const ch
|
|||||||
for (auto& incl : inclByPos.second)
|
for (auto& incl : inclByPos.second)
|
||||||
inlcude += (renameIncludes ? renameInclude(incl) : incl);
|
inlcude += (renameIncludes ? renameInclude(incl) : incl);
|
||||||
|
|
||||||
if (st->comments())
|
//check inserted operators
|
||||||
st->setComments((inlcude + st->comments()).c_str());
|
SgStatement* toInsert = st;
|
||||||
|
do {
|
||||||
|
auto lexPrev = toInsert->lexPrev();
|
||||||
|
if (lexPrev && lexPrev->variant() > 0 && lexPrev->lineNumber() < 0)
|
||||||
|
toInsert = lexPrev;
|
||||||
else
|
else
|
||||||
st->addComment(inlcude.c_str());
|
break;
|
||||||
|
} while (true);
|
||||||
|
|
||||||
|
if (toInsert->comments())
|
||||||
|
toInsert->setComments((inlcude + toInsert->comments()).c_str());
|
||||||
|
else
|
||||||
|
toInsert->addComment(inlcude.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2465"
|
#define VERSION_SPF "2466"
|
||||||
|
|||||||
Reference in New Issue
Block a user