From a1c80cc5629e4e7152ced4f865a7a5a5705f60ad Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 9 Nov 2022 22:26:26 +0800 Subject: [PATCH] - fix: function pointers not correctly handle in code parser; - fix: var assignment not correctly handled in code parser; - fix: function args not correctly handled in code parser; --- RedPandaIDE/parser/cppparser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 85da4cdc..0ee61fdc 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -1281,8 +1281,8 @@ PStatement CppParser::addStatement(const PStatement& parent, PStatement CppParser::addStatement(const PStatement &parent, const QString &fileName, const QString &aType, const QString &command, int argStart, int argEnd, const QString &value, int line, StatementKind kind, const StatementScope &scope, const StatementClassScope &classScope, bool isDefinition, bool isStatic) { Q_ASSERT(mTokenizer[argStart]->text=='('); - QString args("("); - QString noNameArgs("("); + QString args; + QString noNameArgs; int start=argStart+1; bool typeGetted = false; @@ -1336,8 +1336,8 @@ PStatement CppParser::addStatement(const PStatement &parent, const QString &file args+=mTokenizer[i]->text; } - args.push_back(")"); - noNameArgs.push_back(")"); + args="("+args.trimmed()+")"; + noNameArgs="("+noNameArgs.trimmed()+")"; return addStatement( parent, fileName,