- 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: Double-clicking on touchpad can't select current word.
|
||||
- fix: foreach-loops are not correctly parsed.
|
||||
- fix: '^' is not correctly handled as operator.
|
||||
|
||||
Red Panda C++ Version 2.21
|
||||
|
||||
|
|
|
@ -3981,7 +3981,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;
|
||||
|
@ -3994,8 +3994,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();
|
||||
|
|
|
@ -1122,26 +1122,26 @@ bool CppPreprocessor::isSpaceChar(const QChar &ch)
|
|||
return ch == ' ' || ch == '\t';
|
||||
}
|
||||
|
||||
bool CppPreprocessor::isOperatorChar(const QChar &ch)
|
||||
{
|
||||
//bool CppPreprocessor::isOperatorChar(const QChar &ch)
|
||||
//{
|
||||
|
||||
switch(ch.unicode()) {
|
||||
case '+':
|
||||
case '-':
|
||||
case '*':
|
||||
case '/':
|
||||
case '!':
|
||||
case '=':
|
||||
case '<':
|
||||
case '>':
|
||||
case '&':
|
||||
case '|':
|
||||
case '^':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// switch(ch.unicode()) {
|
||||
// case '+':
|
||||
// case '-':
|
||||
// case '*':
|
||||
// case '/':
|
||||
// case '!':
|
||||
// case '=':
|
||||
// case '<':
|
||||
// case '>':
|
||||
// case '&':
|
||||
// case '|':
|
||||
// case '^':
|
||||
// return true;
|
||||
// default:
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
|
||||
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', '_'
|
||||
|
|
|
@ -373,6 +373,7 @@ QString CppTokenizer::getNextToken(TokenType *pTokenType)
|
|||
case '|':
|
||||
case '+':
|
||||
case '~':
|
||||
case '^':
|
||||
if (*(mCurrent + 1) == '=') {
|
||||
countLines();
|
||||
result = *mCurrent;
|
||||
|
|
Loading…
Reference in New Issue