From 3d138e3ac53a348de912d96939196ac9cc899ac4 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 24 May 2023 20:32:27 +0800 Subject: [PATCH] - fix: lambda expression is not correctly handled. --- RedPandaIDE/parser/cppparser.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 9ca4627f..2a481913 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -1901,17 +1901,10 @@ void CppParser::checkAndHandleMethodOrVar(KeywordType keywordType) return; } //it's not a function define - 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 == ',') { + // var decl with init + handleVar(sType+" "+sName,isExtern,isStatic); + return; } if (mTokenizer[indexAfter]->text[0] == ';' && sType!="void") { //function can only be defined in global/namespaces/classes