Skip to content
Snippets Groups Projects
Commit f8531cc8 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Merge the environment from the previous parse.

parent 02de7907
No related branches found
No related tags found
No related merge requests found
...@@ -38,10 +38,20 @@ FastPreprocessor::FastPreprocessor(const Snapshot &snapshot) ...@@ -38,10 +38,20 @@ FastPreprocessor::FastPreprocessor(const Snapshot &snapshot)
QByteArray FastPreprocessor::run(QString fileName, const QString &source) 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); const QByteArray preprocessed = _preproc(fileName, source);
return preprocessed; return preprocessed;
} }
void FastPreprocessor::sourceNeeded(QString &fileName, IncludeType, unsigned)
{ mergeEnvironment(fileName); }
void FastPreprocessor::mergeEnvironment(const QString &fileName) void FastPreprocessor::mergeEnvironment(const QString &fileName)
{ {
if (! _merged.contains(fileName)) { if (! _merged.contains(fileName)) {
......
...@@ -54,8 +54,7 @@ public: ...@@ -54,8 +54,7 @@ public:
QByteArray run(QString fileName, const QString &source); QByteArray run(QString fileName, const QString &source);
// CPlusPlus::Client // CPlusPlus::Client
virtual void sourceNeeded(QString &fileName, IncludeType, unsigned) virtual void sourceNeeded(QString &fileName, IncludeType, unsigned);
{ mergeEnvironment(fileName); }
virtual void macroAdded(const Macro &) {} virtual void macroAdded(const Macro &) {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment