- fix: '^' is not correctly handled as operator.
This commit is contained in:
parent
a251173a6a
commit
19a85db1f9
1
NEWS.md
1
NEWS.md
|
@ -3,6 +3,7 @@ Red Panda C++ Version 2.22
|
||||||
- fix: Crash at startup when current problem in the problem set is connected with source file.
|
- fix: Crash at startup when current problem in the problem set is connected with source file.
|
||||||
- fix: Double-clicking on touchpad can't select current word.
|
- fix: Double-clicking on touchpad can't select current word.
|
||||||
- fix: foreach-loops are not correctly parsed.
|
- fix: foreach-loops are not correctly parsed.
|
||||||
|
- fix: '^' is not correctly handled as operator.
|
||||||
|
|
||||||
Red Panda C++ Version 2.21
|
Red Panda C++ Version 2.21
|
||||||
|
|
||||||
|
|
|
@ -3981,7 +3981,7 @@ void CppParser::internalParse(const QString &fileName)
|
||||||
if (mTokenizer.tokenCount() == 0)
|
if (mTokenizer.tokenCount() == 0)
|
||||||
return;
|
return;
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
// mTokenizer.dumpTokens(QString("r:\\tokens-%1.txt").arg(extractFileName(fileName)));
|
mTokenizer.dumpTokens(QString("r:\\tokens-%1.txt").arg(extractFileName(fileName)));
|
||||||
#endif
|
#endif
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
mLastIndex = -1;
|
mLastIndex = -1;
|
||||||
|
@ -3994,8 +3994,8 @@ void CppParser::internalParse(const QString &fileName)
|
||||||
}
|
}
|
||||||
// qDebug()<<"parse"<<timer.elapsed();
|
// qDebug()<<"parse"<<timer.elapsed();
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
// mStatementList.dumpAll(QString("r:\\all-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)));
|
mStatementList.dump(QString("r:\\stats-%1.txt").arg(extractFileName(fileName)));
|
||||||
#endif
|
#endif
|
||||||
//reduce memory usage
|
//reduce memory usage
|
||||||
internalClear();
|
internalClear();
|
||||||
|
|
|
@ -1122,26 +1122,26 @@ bool CppPreprocessor::isSpaceChar(const QChar &ch)
|
||||||
return ch == ' ' || ch == '\t';
|
return ch == ' ' || ch == '\t';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CppPreprocessor::isOperatorChar(const QChar &ch)
|
//bool CppPreprocessor::isOperatorChar(const QChar &ch)
|
||||||
{
|
//{
|
||||||
|
|
||||||
switch(ch.unicode()) {
|
// switch(ch.unicode()) {
|
||||||
case '+':
|
// case '+':
|
||||||
case '-':
|
// case '-':
|
||||||
case '*':
|
// case '*':
|
||||||
case '/':
|
// case '/':
|
||||||
case '!':
|
// case '!':
|
||||||
case '=':
|
// case '=':
|
||||||
case '<':
|
// case '<':
|
||||||
case '>':
|
// case '>':
|
||||||
case '&':
|
// case '&':
|
||||||
case '|':
|
// case '|':
|
||||||
case '^':
|
// case '^':
|
||||||
return true;
|
// return true;
|
||||||
default:
|
// default:
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
bool CppPreprocessor::isMacroIdentChar(const QChar &ch)
|
bool CppPreprocessor::isMacroIdentChar(const QChar &ch)
|
||||||
{
|
{
|
||||||
|
|
|
@ -176,7 +176,7 @@ static bool isSpaceChar(const QChar& ch);
|
||||||
/*
|
/*
|
||||||
* '+', '-', '*', '/', '!', '=', '<', '>', '&', '|', '^'
|
* '+', '-', '*', '/', '!', '=', '<', '>', '&', '|', '^'
|
||||||
*/
|
*/
|
||||||
static bool isOperatorChar(const QChar& ch);
|
//static bool isOperatorChar(const QChar& ch);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 'A'..'Z', 'a'..'z', '_'
|
* 'A'..'Z', 'a'..'z', '_'
|
||||||
|
|
|
@ -373,6 +373,7 @@ QString CppTokenizer::getNextToken(TokenType *pTokenType)
|
||||||
case '|':
|
case '|':
|
||||||
case '+':
|
case '+':
|
||||||
case '~':
|
case '~':
|
||||||
|
case '^':
|
||||||
if (*(mCurrent + 1) == '=') {
|
if (*(mCurrent + 1) == '=') {
|
||||||
countLines();
|
countLines();
|
||||||
result = *mCurrent;
|
result = *mCurrent;
|
||||||
|
|
Loading…
Reference in New Issue