- fix #388: Temp object + member function call is wrongly parsed as constructor.

This commit is contained in:
Roy Qu 2024-04-23 13:31:05 +08:00
parent 3887b9387d
commit 96c4e95172
2 changed files with 8 additions and 0 deletions

View File

@ -148,6 +148,7 @@ Red Panda C++ Version 2.27
- fix: Name of the macro for project private resource header is not correct.
- fix: In sdcc project, sdcc keywords are not in completion suggest list.
- fix: In sdcc project, parser are not correctly inited as sdcc parser.
- fix: Temp object + member function call is wrongly parsed as constructor.
Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors.

View File

@ -2332,6 +2332,13 @@ void CppParser::checkAndHandleMethodOrVar(KeywordType keywordType, int maxIndex)
//Won't implement: ignore function decl like int (text)(int x) { };
return;
}
//it's a chain function call
if (mTokenizer[indexAfter]->text == "."
|| mTokenizer[indexAfter]->text == "->"
|| mTokenizer[indexAfter]->text == "::" ) {
mIndex = indexOfNextPeriodOrSemicolon(indexAfter, maxIndex);
return;
}
//it's not a function define
if (mTokenizer[indexAfter]->text == ',') {
// var decl with init