From 4147dfb66a584e52032fddef7185a6d625fbf55c Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 16 Jul 2015 18:41:19 +0000 Subject: [PATCH] cpp: Fixed issue with wrong comment detection git-svn-id: svn://ultimatepp.org/upp/trunk@8692 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CppBase/ppfile.cpp | 6 ++++++ uppsrc/ide/Browser/Base.cpp | 2 +- uppsrc/ide/Cpp.cpp | 11 +---------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/uppsrc/CppBase/ppfile.cpp b/uppsrc/CppBase/ppfile.cpp index ec853099a..e440dceb5 100644 --- a/uppsrc/CppBase/ppfile.cpp +++ b/uppsrc/CppBase/ppfile.cpp @@ -47,6 +47,12 @@ void RemoveComments(String& l, bool& incomment) if(*s == '\"') s = SkipString(s); else + if(s[0] == '/' && s[1] == '/') { + q = int(s - ~l); + SetSpaces(l, q, l.GetCount() - q); + return; + } + else if(s[0] == '/' && s[1] == '*') { q = int(s - ~l); break; diff --git a/uppsrc/ide/Browser/Base.cpp b/uppsrc/ide/Browser/Base.cpp index 6124e63ac..52238e867 100644 --- a/uppsrc/ide/Browser/Base.cpp +++ b/uppsrc/ide/Browser/Base.cpp @@ -10,7 +10,7 @@ #define CLOG(x) RLOG(x) -#define CPP_CODEBASE_VERSION 31415 +#define CPP_CODEBASE_VERSION 314159 ArrayMap source_file; diff --git a/uppsrc/ide/Cpp.cpp b/uppsrc/ide/Cpp.cpp index a76f6ee38..7ee7f635d 100644 --- a/uppsrc/ide/Cpp.cpp +++ b/uppsrc/ide/Cpp.cpp @@ -222,16 +222,7 @@ void AssistEditor::ExpressionType(const String& ttype, for(int i = 0; i < tparam.GetCount(); i++) // need to qualify template parameters tparam[i] = Qualify(context_type, tparam[i], usings); -/* - bool tryop = id == "->"; - if(tryop) - id = "operator->"; - else - if(id == "[]") { - tryop = true; - id = "operator[]"; - } -*/ + bool shortcut_oper = false; if(!iscid(*id) && *id != '.') { shortcut_oper = can_shortcut_operator;