diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index c7dbadc5..8ad50205 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -4327,6 +4327,9 @@ void CppParser::handleVar(const QString& typePrefix,bool isExtern,bool isStatic, } mIndex=mTokenizer[mIndex]->matchIndex+1; addedVar.reset(); + //If there are multiple var define in the same line, the next token should be ',' + if (mIndex>=maxIndex || mTokenizer[mIndex]->text != ",") + return; break; default: if (isIdentChar(mTokenizer[mIndex]->text[0])) {