Commit f8531cc8 authored by Roberto Raggi's avatar Roberto Raggi

Merge the environment from the previous parse.

parent 02de7907
......@@ -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)) {
......
......@@ -54,8 +54,7 @@ public:
QByteArray run(QString fileName, const QString &source);
// CPlusPlus::Client
virtual void sourceNeeded(QString &fileName, IncludeType, unsigned)
{ mergeEnvironment(fileName); }
virtual void sourceNeeded(QString &fileName, IncludeType, unsigned);
virtual void macroAdded(const Macro &) {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment