summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/symbols.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/moc/symbols.h')
-rw-r--r--src/tools/moc/symbols.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/tools/moc/symbols.h b/src/tools/moc/symbols.h
index 35d4ed6ec9..b588cd5beb 100644
--- a/src/tools/moc/symbols.h
+++ b/src/tools/moc/symbols.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the tools applications of the Qt Toolkit.
@@ -134,6 +135,7 @@ typedef QVector<Symbol> Symbols;
struct SafeSymbols {
Symbols symbols;
QByteArray expandedMacro;
+ QSet<QByteArray> excludedSymbols;
int index;
};
@@ -159,6 +161,7 @@ public:
inline QByteArray unquotedLexem() { return symbol().unquotedLexem(); }
bool dontReplaceSymbol(const QByteArray &name);
+ QSet<QByteArray> excludeSymbols();
};
inline bool SymbolStack::test(Token token)
@@ -178,12 +181,22 @@ inline bool SymbolStack::test(Token token)
inline bool SymbolStack::dontReplaceSymbol(const QByteArray &name)
{
for (int i = 0; i < size(); ++i) {
- if (name == at(i).expandedMacro)
+ if (name == at(i).expandedMacro || at(i).excludedSymbols.contains(name))
return true;
}
return false;
}
+inline QSet<QByteArray> SymbolStack::excludeSymbols()
+{
+ QSet<QByteArray> set;
+ for (int i = 0; i < size(); ++i) {
+ set << at(i).expandedMacro;
+ set += at(i).excludedSymbols;
+ }
+ return set;
+}
+
QT_END_NAMESPACE
#endif // SYMBOLS_H