diff --git a/NEWS.md b/NEWS.md index bfbd0cf3..d0c43878 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,7 @@ Red Panda C++ Version 2.23 - enhancement: improve code completion for std iterators defined with "using namespace std" - enhancement: improve pointer calculation when inferencing type info - enhancement: improve parsing for multiple vars defined in one line + - enhancement: improve parsing result for function parameters like 'Node (&node)[10]' Red Panda C++ Version 2.22 diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 7890ea6b..9ac96af8 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -5554,6 +5554,12 @@ void CppParser::scanMethodArgs(const PStatement& functionStatement, int argStart QString cmd=mTokenizer[i]->text; words.append(cmd); i++; + } else if (mTokenizer[i]->text.startsWith("[")) { + if (!words.isEmpty()) { + int lastIdx=words.count()-1; + words[lastIdx]=words[lastIdx]+mTokenizer[i]->text; + } + i++; } else { i++; }