diff --git a/NEWS.md b/NEWS.md index 84d3ed06..876f384b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -28,6 +28,7 @@ Red Panda C++ Version 2.23 - fix: GLFW project template. - fix: Inherited class/struct members are not correctly shown in the completion suggestions. - enhancement: Sort symbols by their declaration pos in the Class Browser, if not sort by alpha order. + - fix: Keyword asm is not correctly parsed. Red Panda C++ Version 2.22 diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 94e32180..b518ff85 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -2595,10 +2595,10 @@ void CppParser::handleKeyword(KeywordType skipType) // Skip to { mIndex = indexOfNextLeftBrace(mIndex); break; - case KeywordType::MoveToRightBrace: - // Skip pass {} - mIndex = indexPassBraces(mIndex); - break; +// case KeywordType::MoveToRightBrace: +// // Skip pass {} +// mIndex = indexPassBraces(mIndex); +// break; default: break; } @@ -5950,22 +5950,22 @@ int CppParser::indexPassParenthesis(int index) return index; } -int CppParser::indexPassBraces(int index) -{ - int tokenCount = mTokenizer.tokenCount(); - while (indextext[0].unicode()) { - case '{': - return mTokenizer[index]->matchIndex+1; - case '(': - index = mTokenizer[index]->matchIndex+1; - break; - default: - index++; - } - } - return index; -} +//int CppParser::indexPassBraces(int index) +//{ +// int tokenCount = mTokenizer.tokenCount(); +// while (indextext[0].unicode()) { +// case '{': +// return mTokenizer[index]->matchIndex+1; +// case '(': +// index = mTokenizer[index]->matchIndex+1; +// break; +// default: +// index++; +// } +// } +// return index; +//} void CppParser::skipNextSemicolon(int index) { diff --git a/RedPandaIDE/parser/cppparser.h b/RedPandaIDE/parser/cppparser.h index 8529c0bd..f90ea159 100644 --- a/RedPandaIDE/parser/cppparser.h +++ b/RedPandaIDE/parser/cppparser.h @@ -653,7 +653,7 @@ private: int indexOfNextColon(int index); int indexOfNextLeftBrace(int index); int indexPassParenthesis(int index); - int indexPassBraces(int index); +// int indexPassBraces(int index); int skipAssignment(int index, int endIndex); void skipNextSemicolon(int index); int moveToEndOfStatement(int index, bool checkLambda, int endIndex=-1); diff --git a/RedPandaIDE/parser/parserutils.cpp b/RedPandaIDE/parser/parserutils.cpp index 1057ffa1..d67b6d2c 100644 --- a/RedPandaIDE/parser/parserutils.cpp +++ b/RedPandaIDE/parser/parserutils.cpp @@ -127,8 +127,8 @@ void initParser() CppKeywords.insert("_Pragma",KeywordType::SkipNextParenthesis); // Skip to } - CppKeywords.insert("asm",KeywordType::MoveToRightBrace); - CppKeywords.insert("__asm",KeywordType::MoveToRightBrace); + CppKeywords.insert("asm",KeywordType::SkipNextParenthesis); + CppKeywords.insert("__asm",KeywordType::SkipNextParenthesis); // Skip to { // wont handle diff --git a/RedPandaIDE/parser/parserutils.h b/RedPandaIDE/parser/parserutils.h index c7b96c21..543be90b 100644 --- a/RedPandaIDE/parser/parserutils.h +++ b/RedPandaIDE/parser/parserutils.h @@ -62,7 +62,7 @@ enum class KeywordType { SkipNextColon, // move to : and skip it SkipNextParenthesis, // move to ) and skip it MoveToLeftBrace,// move to { - MoveToRightBrace, // move to } +// MoveToRightBrace, // move to } For, //for Catch, //catch Public, // public