From 3cc00eaf8f756bd47d753cf6b62ee0df458aeea1 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Tue, 20 Jun 2023 19:26:28 +0800 Subject: [PATCH] improve pointer level calc for [] --- RedPandaIDE/parser/cppparser.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 37537178..edc87632 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -5199,13 +5199,13 @@ PEvalStatement CppParser::doCreateEvalVariable( pointerLevel, templateParams); } - if (!varStatement->args.isEmpty()) { - int j = 0; - while ((j = varStatement->args.indexOf("[", j)) != -1) { - ++j; - pointerLevel++; - } - } +// if (!varStatement->args.isEmpty()) { +// int j = 0; +// while ((j = varStatement->args.indexOf("[", j)) != -1) { +// ++j; +// pointerLevel++; +// } +// } // qDebug()<<"parse ..."<( baseType, @@ -5359,7 +5359,7 @@ PStatement CppParser::doParseEvalTypeInfo( level++; baseType=""; syntaxer.resetState(); - syntaxer.setLine(effectiveTypeStatement->type,0); + syntaxer.setLine(effectiveTypeStatement->type+effectiveTypeStatement->args,0); int bracketLevel = 0; int templateLevel = 0; while(!syntaxer.eol()) {