forked from qt-creator/qt-creator
Added macro expanding events and some initial on the macro highlighting support.
This commit is contained in:
@@ -153,6 +153,11 @@ void Document::appendMacro(const QByteArray ¯oName, const QByteArray &text)
|
||||
_definedMacros += text;
|
||||
}
|
||||
|
||||
void Document::addMacroUse(unsigned offset, unsigned length)
|
||||
{
|
||||
_macroUses.append(Block(offset, offset + length));
|
||||
}
|
||||
|
||||
TranslationUnit *Document::translationUnit() const
|
||||
{
|
||||
return _translationUnit;
|
||||
|
||||
@@ -68,6 +68,8 @@ public:
|
||||
|
||||
void appendMacro(const QByteArray ¯oName, const QByteArray &text);
|
||||
|
||||
void addMacroUse(unsigned offset, unsigned length);
|
||||
|
||||
Control *control() const;
|
||||
TranslationUnit *translationUnit() const;
|
||||
|
||||
@@ -176,6 +178,9 @@ public:
|
||||
QList<Block> skippedBlocks() const
|
||||
{ return _skippedBlocks; }
|
||||
|
||||
QList<Block> macroUses() const
|
||||
{ return _macroUses; }
|
||||
|
||||
private:
|
||||
Symbol *findSymbolAt(unsigned line, unsigned column, Scope *scope) const;
|
||||
|
||||
@@ -189,6 +194,7 @@ private:
|
||||
QByteArray _definedMacros;
|
||||
QSet<QByteArray> _macroNames;
|
||||
QList<Block> _skippedBlocks;
|
||||
QList<Block> _macroUses;
|
||||
};
|
||||
|
||||
} // end of namespace CPlusPlus
|
||||
|
||||
Reference in New Issue
Block a user