From ddc460cb8a5832ce84741b3d2e24ee70d64ef192 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 12 Oct 2008 23:28:12 +0000 Subject: [PATCH] A++ fixes again... git-svn-id: svn://ultimatepp.org/upp/trunk@523 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/Browser/Move.cpp | 1 + uppsrc/ide/Browser/TopicWin.cpp | 1 - uppsrc/ide/Cpp.cpp | 33 ++++++++++++++++++--------------- uppsrc/ide/ide.h | 5 +++-- uppsrc/ide/version.h | 2 +- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/uppsrc/ide/Browser/Move.cpp b/uppsrc/ide/Browser/Move.cpp index a4e646056..df2be2202 100644 --- a/uppsrc/ide/Browser/Move.cpp +++ b/uppsrc/ide/Browser/Move.cpp @@ -4,6 +4,7 @@ struct MoveTopicDlg : public WithMoveTopicLayout { typedef MoveTopicDlg CLASSNAME; public: + void Package(); MoveTopicDlg(); diff --git a/uppsrc/ide/Browser/TopicWin.cpp b/uppsrc/ide/Browser/TopicWin.cpp index dd2abd911..4ec57a07d 100644 --- a/uppsrc/ide/Browser/TopicWin.cpp +++ b/uppsrc/ide/Browser/TopicWin.cpp @@ -206,7 +206,6 @@ void CreateTopic(const char *fn, int lang, const String& ss) void TopicEditor::NewTopic() { TopicDlg > d("New topic"); - d.lang <<= lastlang; Vector path, name; diff --git a/uppsrc/ide/Cpp.cpp b/uppsrc/ide/Cpp.cpp index 660eeeda7..eebf76724 100644 --- a/uppsrc/ide/Cpp.cpp +++ b/uppsrc/ide/Cpp.cpp @@ -1,8 +1,8 @@ #include "ide.h" -#define LDUMP(x) //DDUMP(x) -#define LDUMPC(x) //DDUMPC(x) -#define LLOG(x) //DLOG(x) +#define LDUMP(x) // DDUMP(x) +#define LDUMPC(x) // DDUMPC(x) +#define LLOG(x) // DLOG(x) static Array sEmpty; @@ -126,7 +126,7 @@ String Qualify(const String& scope, const String& type) } void AssistEditor::ExpressionType(const String& ttype, const Vector& xp, int ii, - Index& typeset, const Vector& tparam_, + Index& typeset, bool variable, bool can_shortcut_operator, Index& visited_bases) { if(ii >= xp.GetCount()) { @@ -134,6 +134,7 @@ void AssistEditor::ExpressionType(const String& ttype, const Vector& xp, typeset.FindAdd(ttype); return; } + LDUMP(xp[ii]); Vector tparam; String type = ParseTemplatedType(ttype, tparam); int c0 = typeset.GetCount(); @@ -146,8 +147,8 @@ void AssistEditor::ExpressionType(const String& ttype, const Vector& xp, return; } LLOG("ExpressionType " << type << " ii: " << ii << " id:" << id); - if(*id == '.') { - ExpressionType(ttype, xp, ii + 1, typeset, tparam); + if(*id == '.' || (!variable && !iscid(*id))) { + ExpressionType(ttype, xp, ii + 1, typeset, false); return; } bool shortcut_oper = false; @@ -157,8 +158,10 @@ void AssistEditor::ExpressionType(const String& ttype, const Vector& xp, } for(int i = 0; i < n.GetCount(); i = FindNext(n, i)) { const CppItem& m = n[i]; - if(m.name == id) + if(m.name == id) { + LLOG("Member " << m.name << ": " << m.qtype); ExpressionType(ResolveTParam(m.qtype, tparam), xp, ii + 1, typeset); + } } if(typeset.GetCount() != c0 || IsNull(type)) return; @@ -172,20 +175,20 @@ void AssistEditor::ExpressionType(const String& ttype, const Vector& xp, return; } if(shortcut_oper) - ExpressionType(ttype, xp, ii + 1, typeset, tparam); + ExpressionType(ttype, xp, ii + 1, typeset, false); } void AssistEditor::ExpressionType(const String& type, const Vector& xp, int ii, - Index& typeset, const Vector& tparam) + Index& typeset, bool variable) { Index visited_bases; - ExpressionType(type, xp, ii, typeset, tparam, true, visited_bases); + ExpressionType(type, xp, ii, typeset, variable, true, visited_bases); } void AssistEditor::ExpressionType(const String& type, const Vector& xp, int ii, Index& typeset) { - ExpressionType(type, xp, ii, typeset, Vector()); + ExpressionType(type, xp, ii, typeset, false); } Index AssistEditor::ExpressionType(const Parser& parser, const Vector& xp) @@ -203,10 +206,10 @@ Index AssistEditor::ExpressionType(const Parser& parser, const Vector= 0) { String type = Qualify(parser.current_scope, parser.local[q]); LLOG("Found type local: " << type); - ExpressionType(type, xp, 1, typeset); + ExpressionType(type, xp, 1, typeset, true); return typeset; } - ExpressionType(parser.current_scope, xp, 0, typeset); + ExpressionType(parser.current_scope, xp, 0, typeset, false); if(typeset.GetCount()) return typeset; if(xp.GetCount() >= 2 && xp[1] == "()") { @@ -214,11 +217,11 @@ Index AssistEditor::ExpressionType(const Parser& parser, const Vector tparam; if(CodeBase().Find(ParseTemplatedType(qtype, tparam)) >= 0) { LLOG("Is constructor " << qtype); - ExpressionType(qtype, xp, 2, typeset); + ExpressionType(qtype, xp, 2, typeset, false); return typeset; } } - ExpressionType("", xp, 0, typeset); + ExpressionType("", xp, 0, typeset, false); return typeset; } diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index 5a34c64cb..a4abbbe20 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -413,9 +413,10 @@ struct AssistEditor : CodeEditor { void Context(Parser& parser, int pos); void ExpressionType(const String& type, const Vector& xp, int ii, - Index& typeset, const Vector& tparam, + Index& typeset, bool variable, bool can_shortcut_operator, Index& visited_bases); - void ExpressionType(const String& type, const Vector& xp, int ii,Index& typeset, const Vector& tparam); + void ExpressionType(const String& type, const Vector& xp, int ii, + Index& typeset, bool variable); void ExpressionType(const String& type, const Vector& xp, int ii, Index& typeset); Index ExpressionType(const Parser& parser, const Vector& xp); diff --git a/uppsrc/ide/version.h b/uppsrc/ide/version.h index d791eb164..4f660746a 100644 --- a/uppsrc/ide/version.h +++ b/uppsrc/ide/version.h @@ -1 +1 @@ -#define IDE_VERSION "810.r162" +#define IDE_VERSION "810.r163"