- fix: can't correctly handle '&&' and '||' in the #if directive (and correctly parse windows.h header file)
This commit is contained in:
parent
7bb59955e6
commit
3529e8dfea
1
NEWS.md
1
NEWS.md
|
@ -8,6 +8,7 @@ Version 0.7.3
|
||||||
- enhancement: "use utf8 by default" in editor's misc setting
|
- enhancement: "use utf8 by default" in editor's misc setting
|
||||||
- fix: syntax issues not correctly cleared when the file was saved as another name.
|
- fix: syntax issues not correctly cleared when the file was saved as another name.
|
||||||
- enhancement: when running a program, redirect a data file to its stdin
|
- enhancement: when running a program, redirect a data file to its stdin
|
||||||
|
- fix: can't correctly handle '&&' and '||' in the #if directive (and correctly parse windows.h header file)
|
||||||
|
|
||||||
Version 0.7.2
|
Version 0.7.2
|
||||||
- fix: rainbow parenthesis stop functioning when change editor's general options
|
- fix: rainbow parenthesis stop functioning when change editor's general options
|
||||||
|
|
|
@ -1320,21 +1320,21 @@ bool CppPreprocessor::evalNumber(const QString &expr, int &result, int &pos)
|
||||||
|
|
||||||
if (s.endsWith("LL",Qt::CaseInsensitive)) {
|
if (s.endsWith("LL",Qt::CaseInsensitive)) {
|
||||||
s.remove(s.length()-2,2);
|
s.remove(s.length()-2,2);
|
||||||
result = s.toLongLong(&ok,0);
|
result = s.toLongLong(&ok);
|
||||||
} else if (s.endsWith("L",Qt::CaseInsensitive)) {
|
} else if (s.endsWith("L",Qt::CaseInsensitive)) {
|
||||||
s.remove(s.length()-1,1);
|
s.remove(s.length()-1,1);
|
||||||
result = s.toLong(&ok,0);
|
result = s.toLong(&ok);
|
||||||
} else if (s.endsWith("ULL",Qt::CaseInsensitive)) {
|
} else if (s.endsWith("ULL",Qt::CaseInsensitive)) {
|
||||||
s.remove(s.length()-3,3);
|
s.remove(s.length()-3,3);
|
||||||
result = s.toULongLong(&ok,0);
|
result = s.toULongLong(&ok);
|
||||||
} else if (s.endsWith("UL",Qt::CaseInsensitive)) {
|
} else if (s.endsWith("UL",Qt::CaseInsensitive)) {
|
||||||
s.remove(s.length()-2,2);
|
s.remove(s.length()-2,2);
|
||||||
result = s.toULong(&ok,0);
|
result = s.toULong(&ok);
|
||||||
} else if (s.endsWith("U",Qt::CaseInsensitive)) {
|
} else if (s.endsWith("U",Qt::CaseInsensitive)) {
|
||||||
s.remove(s.length()-1,1);
|
s.remove(s.length()-1,1);
|
||||||
result = s.toUInt(&ok,0);
|
result = s.toUInt(&ok);
|
||||||
} else {
|
} else {
|
||||||
result = s.toInt(&ok,0);
|
result = s.toInt(&ok);
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
@ -1578,7 +1578,9 @@ bool CppPreprocessor::evalBitAndExpr(const QString &expr, int &result, int &pos)
|
||||||
while (true) {
|
while (true) {
|
||||||
if (!skipSpaces(expr,pos))
|
if (!skipSpaces(expr,pos))
|
||||||
break;
|
break;
|
||||||
if (expr[pos]=='&') {
|
if (expr[pos]=='&'
|
||||||
|
&& (pos == expr.length()
|
||||||
|
|| expr[pos+1]!='&')) {
|
||||||
pos++;
|
pos++;
|
||||||
int rightResult;
|
int rightResult;
|
||||||
if (!evalEqualExpr(expr,rightResult,pos))
|
if (!evalEqualExpr(expr,rightResult,pos))
|
||||||
|
@ -1626,7 +1628,9 @@ bool CppPreprocessor::evalBitOrExpr(const QString &expr, int &result, int &pos)
|
||||||
while (true) {
|
while (true) {
|
||||||
if (!skipSpaces(expr,pos))
|
if (!skipSpaces(expr,pos))
|
||||||
break;
|
break;
|
||||||
if (expr[pos] == '|') {
|
if (expr[pos] == '|'
|
||||||
|
&& (pos == expr.length()
|
||||||
|
|| expr[pos+1]!='|')) {
|
||||||
pos++;
|
pos++;
|
||||||
int rightResult;
|
int rightResult;
|
||||||
if (!evalBitXorExpr(expr,rightResult,pos))
|
if (!evalBitXorExpr(expr,rightResult,pos))
|
||||||
|
|
Loading…
Reference in New Issue