Merge the environment from the previous parse.

This commit is contained in:
Roberto Raggi
2009-06-29 09:59:55 +02:00
parent 02de790714
commit f8531cc833
2 changed files with 11 additions and 2 deletions

View File

@@ -38,10 +38,20 @@ FastPreprocessor::FastPreprocessor(const Snapshot &snapshot)
QByteArray FastPreprocessor::run(QString fileName, const QString &source)
{
if (Document::Ptr doc = _snapshot.value(fileName)) {
_merged.insert(fileName);
foreach (const Document::Include &i, doc->includes())
mergeEnvironment(i.fileName());
}
const QByteArray preprocessed = _preproc(fileName, source);
return preprocessed;
}
void FastPreprocessor::sourceNeeded(QString &fileName, IncludeType, unsigned)
{ mergeEnvironment(fileName); }
void FastPreprocessor::mergeEnvironment(const QString &fileName)
{
if (! _merged.contains(fileName)) {