From 3a78819fb8827eda4fd800d876ed9427dc965646 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 25 Oct 2023 17:01:42 +0800 Subject: [PATCH] - fix: C++ compiler atrribute '[[xxx]]' are not correctly handled. --- NEWS.md | 2 ++ RedPandaIDE/RedPandaIDE.pro | 2 +- RedPandaIDE/editor.cpp | 13 ++++++++++--- RedPandaIDE/parser/cppparser.cpp | 10 +++++----- RedPandaIDE/parser/cpptokenizer.cpp | 20 +++++++++++--------- Red_Panda_CPP.pro | 2 +- 6 files changed, 30 insertions(+), 19 deletions(-) diff --git a/NEWS.md b/NEWS.md index 00475adb..f3459b0a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,8 @@ Red Panda C++ Version 2.26 - enhancement: Basic support for parsing variadic macros(macros that use __VA_ARGS__). - enhancement: Better support for expanding macros with complex parameters. - fix: Macros that defined by the compiler are not correctly syntax-colored and tooltiped. + - fix: Code suggestion for identifiers after '*' (eg. 3 * item->price) can't correct. + - fix: C++ compiler atrribute '[[xxx]]' are not correctly handled. Red Panda C++ Version 2.25 diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index f2bf4aa6..73de92ba 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -15,7 +15,7 @@ APP_NAME = RedPandaCPP APP_VERSION = 2.26 -TEST_VERSION = alpha4 +TEST_VERSION = alpha5 contains(QMAKE_HOST.arch, x86_64):{ DEFINES += ARCH_X86_64=1 diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 6d13d5dc..26dd2b4c 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -2318,10 +2318,17 @@ QStringList Editor::getExpressionAtPosition( return result; break; case LastSymbolType::AsteriskSign: // before '*': - if (token == '*') { - - } else + if (token == '*') { + } else { + QChar ch=token.front(); + if (isIdentChar(ch) + || ch.isDigit() + || ch == '.' + || ch == ')' ) { + result.pop_front(); + } return result; + } break; case LastSymbolType::AmpersandSign: // before '&': return result; diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 32acda4e..7e28ff83 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -4397,8 +4397,8 @@ void CppParser::internalParse(const QString &fileName) QStringList preprocessResult = mPreprocessor.result(); #ifdef QT_DEBUG -// stringsToFile(mPreprocessor.result(),QString("r:\\preprocess-%1.txt").arg(extractFileName(fileName))); -// mPreprocessor.dumpDefinesTo("r:\\defines.txt"); + stringsToFile(mPreprocessor.result(),QString("r:\\preprocess-%1.txt").arg(extractFileName(fileName))); + mPreprocessor.dumpDefinesTo("r:\\defines.txt"); // mPreprocessor.dumpIncludesListTo("r:\\includes.txt"); #endif //qDebug()<<"preprocess"<