- fix: lambda expression is not correctly handled.
This commit is contained in:
parent
c304f3f8a0
commit
d4ccdbcdc2
|
@ -1901,11 +1901,18 @@ void CppParser::checkAndHandleMethodOrVar(KeywordType keywordType)
|
|||
return;
|
||||
}
|
||||
//it's not a function define
|
||||
if (mTokenizer[indexAfter]->text[0] == ',') {
|
||||
if (mTokenizer[indexAfter]->text != ';'
|
||||
&& mTokenizer[indexAfter]->text != '{'
|
||||
&& mTokenizer[indexAfter]->text != "->") {
|
||||
|
||||
if (mTokenizer[indexAfter]->text == ',') {
|
||||
// var decl with init
|
||||
handleVar(sType+" "+sName,isExtern,isStatic);
|
||||
return;
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
if (mTokenizer[indexAfter]->text[0] == ';' && sType!="void") {
|
||||
//function can only be defined in global/namespaces/classes
|
||||
PStatement currentScope=getCurrentScope();
|
||||
|
@ -3664,6 +3671,8 @@ void CppParser::handleVar(const QString& typePrefix,bool isExtern,bool isStatic)
|
|||
} else if (typePrefix=="static") {
|
||||
isStatic=true;
|
||||
} else {
|
||||
if (typePrefix.back()==':')
|
||||
return;
|
||||
lastType=typePrefix.trimmed();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue