diff --git a/NEWS.md b/NEWS.md index 2e5893a0..d5078d19 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,8 @@ Red Panda C++ Version 1.0.4 - enhancement: prefer local headers over system headers when complete #include header path - fix: tab/shift+tab not correctly handled in options dialog's code template page - enhancement: batch set cases ( in problem case table's context menu ) + - enhancement: add Portugese translation + - fix: crash when eval statements like "fsm::stack fsm;" Red Panda C++ Version 1.0.3 - fix: when oj problem grabbed by competitive companion received, diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 3a4d2462..c4ceecec 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -350,6 +350,10 @@ PStatement CppParser::findStatementOf(const QString &fileName, QString typeName; PStatement typeStatement; while (!memberName.isEmpty()) { + if (statement->kind!=StatementKind::skClass + && operatorToken == "::") { + return PStatement(); + } if (statement->kind == StatementKind::skVariable || statement->kind == StatementKind::skParameter || statement->kind == StatementKind::skFunction) { @@ -544,6 +548,7 @@ PStatement CppParser::findTypeDefinitionOf(const QString &fileName, const QStrin if (mParsing) return PStatement(); + // Remove pointer stuff from type QString s = aType; // 'Type' is a keyword int position = s.length()-1; @@ -4369,7 +4374,8 @@ void CppParser::scanMethodArgs(const PStatement& functionStatement, const QStrin } } -QString CppParser::splitPhrase(const QString &phrase, QString &sClazz, QString &sMember, QString &sOperator) +QString CppParser::splitPhrase(const QString &phrase, QString &sClazz, + QString &sOperator, QString &sMember) { sClazz=""; sMember=""; diff --git a/RedPandaIDE/parser/cppparser.h b/RedPandaIDE/parser/cppparser.h index 83570384..e711fc03 100644 --- a/RedPandaIDE/parser/cppparser.h +++ b/RedPandaIDE/parser/cppparser.h @@ -404,8 +404,8 @@ private: void scanMethodArgs( const PStatement& functionStatement, const QString& argStr); - QString splitPhrase(const QString& phrase, QString& sClazz, QString &sMember, - QString& sOperator); + QString splitPhrase(const QString& phrase, QString& sClazz, + QString& sOperator, QString &sMember); QString removeArgNames(const QString& args);