diff options
Diffstat (limited to 'src/tools/moc/parser.h')
-rw-r--r-- | src/tools/moc/parser.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/moc/parser.h b/src/tools/moc/parser.h index 715c441e89..6fe982a1ce 100644 --- a/src/tools/moc/parser.h +++ b/src/tools/moc/parser.h @@ -16,7 +16,7 @@ class Parser public: Parser():index(0), displayWarnings(true), displayNotes(true) {} Symbols symbols; - int index; + qsizetype index; bool displayWarnings; bool displayNotes; @@ -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); @@ -65,7 +67,7 @@ inline bool Parser::test(Token token) inline Token Parser::lookup(int k) { - const int l = index - 1 + k; + const qsizetype l = index - 1 + k; return l < symbols.size() ? symbols.at(l).token : NOTOKEN; } |