From 517fdbdecc7903b0458b4d345af09c2a0aeea4b4 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 22 Mar 2024 18:56:02 +0800 Subject: [PATCH] - enhancement: Improve lambda support. --- NEWS.md | 1 + RedPandaIDE/parser/cppparser.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index fe243d6d..8d673b49 100644 --- a/NEWS.md +++ b/NEWS.md @@ -77,6 +77,7 @@ Red Panda C++ Version 2.27 - enhancement: Show "std::function" in the completion list. - enhancement: Improvement in italic font support. - fix: History not correctly loaded with up/down arrow key in the debug console. + - enhancement: Improve lambda support. Red Panda C++ Version 2.26 diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index d3d97abb..c19b71d7 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -2894,12 +2894,10 @@ void CppParser::handleLambda(int index, int maxIndex) int argEnd= mTokenizer[argStart]->matchIndex; //TODO: parse captures int bodyStart=indexOfNextLeftBrace(argEnd+1, maxIndex); - qDebug()<=maxIndex) { return; } int bodyEnd = mTokenizer[bodyStart]->matchIndex; - qDebug()<<"end"<maxIndex) { return; } @@ -6414,9 +6412,11 @@ int CppParser::skipAssignment(int index, int maxIndex) switch(mTokenizer[index]->text[0].unicode()) { case ';': case ',': - case '{': + case '}': + case ')': stop=true; break; + case '{': case '(': index = mTokenizer[index]->matchIndex+1; break;