- enhancement: Support operator() overload.
This commit is contained in:
parent
c83da8309c
commit
1f6ef884e6
1
NEWS.md
1
NEWS.md
|
@ -15,6 +15,7 @@ Red Panda C++ Version 3.1
|
|||
- fix: Mingw32-make doesn't work correctly if there are bash in the path.
|
||||
- fix: All color scheme names are incorrectly displayed as bold, if the current one is a customed one.
|
||||
- fix: Variables defined by using alias can't show completion info.
|
||||
- enhancement: Support operator() overload.
|
||||
|
||||
Red Panda C++ Version 3.0
|
||||
|
||||
|
|
|
@ -5127,6 +5127,24 @@ PEvalStatement CppParser::doEvalMemberAccess(const QString &fileName,
|
|||
// if (result->effectiveTypeStatement)
|
||||
// qDebug()<<"typeStatement"<<result->effectiveTypeStatement->fullName;
|
||||
result->kind = EvalStatementKind::Variable;
|
||||
} else if(result->kind == EvalStatementKind::Variable
|
||||
&& result->effectiveTypeStatement
|
||||
&& result->effectiveTypeStatement->kind == StatementKind::Class) {
|
||||
//overload of operator ()
|
||||
const StatementMap& statementMap = mStatementList.childrenStatements(result->effectiveTypeStatement);
|
||||
if (statementMap.isEmpty())
|
||||
result = PEvalStatement();
|
||||
else {
|
||||
PStatement operStatement = statementMap.value("operator()");
|
||||
if (operStatement) {
|
||||
doSkipInExpression(phraseExpression,pos,"(",")");
|
||||
PEvalStatement temp = doCreateEvalFunction(fileName,operStatement);
|
||||
result->effectiveTypeStatement = temp->effectiveTypeStatement;
|
||||
result->kind = EvalStatementKind::Variable;
|
||||
} else {
|
||||
result = PEvalStatement();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result = PEvalStatement();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue