summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/parser.h
diff options
context:
space:
mode:
authorAhmad Samir <[email protected]>2023-05-18 23:11:31 +0300
committerAhmad Samir <[email protected]>2023-06-22 02:20:29 +0300
commita993510c9eb2da86a24a0c42ce13fbe3a9fa062b (patch)
tree40c34721b0db1e77fd3969a9e6376808a4bab731 /src/tools/moc/parser.h
parent39882a1354cb06d2b0b0a0d5b41a168041df0476 (diff)
Moc: simplify showing a warning
Instead of changing the "index" member then restoring it, add a symbolAt() method to get the Symbol in question, and pass it to new warning() overload. Change-Id: Ie84a6cf4d837f4ed694f617100e9556c2fc2eea3 Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/tools/moc/parser.h')
-rw-r--r--src/tools/moc/parser.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/moc/parser.h b/src/tools/moc/parser.h
index 7b5c604a715..6fe982a1ce7 100644
--- a/src/tools/moc/parser.h
+++ b/src/tools/moc/parser.h
@@ -44,10 +44,12 @@ public:
inline QByteArray lexem() { return symbols.at(index-1).lexem();}
inline QByteArray unquotedLexem() { return symbols.at(index-1).unquotedLexem();}
inline const Symbol &symbol() { return symbols.at(index-1);}
+ inline const Symbol &symbolAt(qsizetype idx) { return symbols.at(idx); }
Q_NORETURN void error(const Symbol &symbol);
Q_NORETURN void error(const char *msg = nullptr);
void warning(const char * = nullptr);
+ void warning(const Symbol &sym, QByteArrayView msg);
void note(const char * = nullptr);
void defaultErrorMsg(const Symbol &sym);
void printMsg(QByteArrayView formatStringSuffix, QByteArrayView msg, const Symbol &sym);