- fix: lambda expression is not correctly handled.

This commit is contained in:
Roy Qu 2023-05-24 20:32:27 +08:00
parent d4ccdbcdc2
commit 3d138e3ac5
1 changed files with 4 additions and 11 deletions

View File

@ -1901,18 +1901,11 @@ void CppParser::checkAndHandleMethodOrVar(KeywordType keywordType)
return; return;
} }
//it's not a function define //it's not a function define
if (mTokenizer[indexAfter]->text != ';'
&& mTokenizer[indexAfter]->text != '{'
&& mTokenizer[indexAfter]->text != "->") {
if (mTokenizer[indexAfter]->text == ',') { if (mTokenizer[indexAfter]->text == ',') {
// var decl with init // var decl with init
handleVar(sType+" "+sName,isExtern,isStatic); handleVar(sType+" "+sName,isExtern,isStatic);
return; return;
} }
return ;
}
if (mTokenizer[indexAfter]->text[0] == ';' && sType!="void") { if (mTokenizer[indexAfter]->text[0] == ';' && sType!="void") {
//function can only be defined in global/namespaces/classes //function can only be defined in global/namespaces/classes
PStatement currentScope=getCurrentScope(); PStatement currentScope=getCurrentScope();