- fix: C++ compiler atrribute '[[xxx]]' are not correctly handled.
This commit is contained in:
parent
85ef5986bf
commit
3a78819fb8
2
NEWS.md
2
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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"<<timer.elapsed();
|
||||
|
@ -4416,7 +4416,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;
|
||||
|
@ -4429,8 +4429,8 @@ void CppParser::internalParse(const QString &fileName)
|
|||
}
|
||||
// qDebug()<<"parse"<<timer.elapsed();
|
||||
#ifdef QT_DEBUG
|
||||
// mStatementList.dumpAll(QString("r:\\all-stats-%1.txt").arg(extractFileName(fileName)));
|
||||
// mStatementList.dump(QString("r:\\stats-%1.txt").arg(extractFileName(fileName)));
|
||||
mStatementList.dumpAll(QString("r:\\all-stats-%1.txt").arg(extractFileName(fileName)));
|
||||
mStatementList.dump(QString("r:\\stats-%1.txt").arg(extractFileName(fileName)));
|
||||
#endif
|
||||
//reduce memory usage
|
||||
internalClear();
|
||||
|
|
|
@ -485,15 +485,17 @@ QString CppTokenizer::getWord()
|
|||
skipToNextToken();
|
||||
}
|
||||
} else if (*mCurrent == '[') {
|
||||
// Append array stuff
|
||||
while(true) {
|
||||
offset = mCurrent;
|
||||
skipPair('[', ']');
|
||||
result += QString(offset,mCurrent-offset);
|
||||
simplifyArgs(result);
|
||||
skipToNextToken();
|
||||
if (*mCurrent!='[') //maybe multi-dimension array
|
||||
break;
|
||||
if (*(mCurrent+1)!='[') {
|
||||
// Append array stuff
|
||||
while(true) {
|
||||
offset = mCurrent;
|
||||
skipPair('[', ']');
|
||||
result += QString(offset,mCurrent-offset);
|
||||
simplifyArgs(result);
|
||||
skipToNextToken();
|
||||
if (*mCurrent!='[') //maybe multi-dimension array
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ APP_NAME = RedPandaCPP
|
|||
|
||||
APP_VERSION = 2.26
|
||||
|
||||
TEST_VERSION = alpha1
|
||||
TEST_VERSION = alpha5
|
||||
|
||||
win32: {
|
||||
SUBDIRS += \
|
||||
|
|
Loading…
Reference in New Issue