From 9467645bef33c5108619ff9872c061adff24faab Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 21 Oct 2023 22:19:26 +0800 Subject: [PATCH] - fix: __attribute__ is not correctly handled if it is after 'static'. --- NEWS.md | 1 + RedPandaIDE/parser/cpptokenizer.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NEWS.md b/NEWS.md index 2773d745..957dae73 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ Red Panda C++ Version 2.26 - change: Use ctrl+mouseMove event to highlight jumpable symbols (instead of ctrl+tooltip). - enhancement: Auto adjust position of the suggestion popup window. - enhancement: Windows XP support ( by cyano.CN ) + - fix: __attribute__ is not correctly handled if it is after 'static'. Red Panda C++ Version 2.25 diff --git a/RedPandaIDE/parser/cpptokenizer.cpp b/RedPandaIDE/parser/cpptokenizer.cpp index 34768460..2cf64037 100644 --- a/RedPandaIDE/parser/cpptokenizer.cpp +++ b/RedPandaIDE/parser/cpptokenizer.cpp @@ -214,6 +214,11 @@ QString CppTokenizer::getNextToken(TokenType *pTokenType) } else if (isWord()) { countLines(); result = getWord(); + if (result == "__attribute__") { + result = ""; + if (*mCurrent=='(') + skipPair('(',')'); + } // if (result=="noexcept" || result == "throw") { // result=""; // if (*mCurrent=='(')