From c304f3f8a0879568e687d0b9e87dd744b29fe530 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 24 May 2023 17:02:59 +0800 Subject: [PATCH] - fix: lambda expression is not correctly handled. --- NEWS.md | 1 + RedPandaIDE/parser/cppparser.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 56caea43..a71895aa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ Red Panda C++ Version 2.22 - fix: Double-clicking on touchpad can't select current word. - fix: foreach-loops are not correctly parsed. - fix: '^' is not correctly handled as operator. + - fix: lambda expression is not correctly handled. Red Panda C++ Version 2.21 diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 4eebb2d4..5af70618 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -2516,7 +2516,7 @@ void CppParser::handleLambda(int index, int endIndex) return; } int bodyEnd = mTokenizer[bodyStart]->matchIndex; - if (bodyEnd>=endIndex) { + if (bodyEnd>endIndex) { return; } PStatement lambdaBlock = addStatement( @@ -3981,7 +3981,7 @@ void CppParser::internalParse(const QString &fileName) if (mTokenizer.tokenCount() == 0) return; #ifdef QT_DEBUG - mTokenizer.dumpTokens(QString("r:\\tokens-%1.txt").arg(extractFileName(fileName))); +// mTokenizer.dumpTokens(QString("r:\\tokens-%1.txt").arg(extractFileName(fileName))); #endif #ifdef QT_DEBUG mLastIndex = -1; @@ -3994,8 +3994,8 @@ void CppParser::internalParse(const QString &fileName) } // qDebug()<<"parse"<