Use Macros.

This commit is contained in:
Roberto Raggi
2008-12-08 12:59:33 +01:00
parent 942363913c
commit 310d50fd07
11 changed files with 69 additions and 85 deletions

View File

@@ -138,19 +138,9 @@ void Document::addIncludeFile(const QString &fileName)
_includedFiles.append(fileName);
}
QByteArray Document::definedMacros() const
void Document::appendMacro(const Macro &macro)
{
return _definedMacros;
}
void Document::appendMacro(const QByteArray &macroName, const QByteArray &text)
{
int index = macroName.indexOf('(');
if (index == -1)
_macroNames.insert(macroName);
else
_macroNames.insert(macroName.left(index));
_definedMacros += text;
_definedMacros.append(macro);
}
void Document::addMacroUse(unsigned offset, unsigned length)
@@ -251,11 +241,6 @@ void Document::stopSkippingBlocks(unsigned stop)
_skippedBlocks.back() = Block(start, stop);
}
QSet<QByteArray> Document::macroNames() const
{
return _macroNames;
}
bool Document::parse(ParseMode mode)
{
TranslationUnit::ParseMode m = TranslationUnit::ParseTranlationUnit;