- fix: Fail to evaluate expressions if macro can't be expanded.
This commit is contained in:
parent
b3ca4f5d38
commit
cd65ecd74a
1
NEWS.md
1
NEWS.md
|
@ -164,6 +164,7 @@ Red Panda C++ Version 2.27
|
|||
- enhancement: New compiler option "stack size" in the link subpage.
|
||||
- change: Set "Ctrl+G" as the shortcut for "Goto page..."
|
||||
- change: Set "Ctrl+B" as the shortcut for "Toggle Bookmark"
|
||||
- fix: Fail to evaluate expressions if macro can't be expanded.
|
||||
|
||||
Red Panda C++ Version 2.26
|
||||
- enhancement: Code suggestion for embedded std::vectors.
|
||||
|
|
|
@ -5507,8 +5507,9 @@ bool CppParser::expandMacro(QStringList &phraseExpression, int pos, PStatement m
|
|||
phraseExpression.removeAt(pos);
|
||||
usedMacros.removeAt(pos);
|
||||
} else {
|
||||
if (pos+1 >= phraseExpression.length() || phraseExpression[pos+1]!=")")
|
||||
return false;
|
||||
//don't expand
|
||||
if (pos+1 >= phraseExpression.length() || phraseExpression[pos+1]!="(")
|
||||
return true;
|
||||
QString args=macro->args.mid(1,macro->args.length()-2).trimmed(); // remove '(' ')'
|
||||
|
||||
if(args=="")
|
||||
|
|
|
@ -761,12 +761,6 @@ void CodeCompletionPopup::getCompletionFor(
|
|||
|
||||
PStatement scope = mCurrentScope;//the scope the expression in
|
||||
PStatement parentTypeStatement;
|
||||
// QString scopeName = ownerExpression.join("");
|
||||
// PStatement ownerStatement = mParser->findStatementOf(
|
||||
// fileName,
|
||||
// scopeName,
|
||||
// mCurrentStatement,
|
||||
// parentTypeStatement);
|
||||
PEvalStatement ownerStatement = mParser->evalExpression(fileName,
|
||||
ownerExpression,
|
||||
scope);
|
||||
|
|
Loading…
Reference in New Issue