diff --git a/uppsrc/Core/SplitMerge.cpp b/uppsrc/Core/SplitMerge.cpp index 5177ccd62..439b5ff68 100644 --- a/uppsrc/Core/SplitMerge.cpp +++ b/uppsrc/Core/SplitMerge.cpp @@ -193,6 +193,7 @@ static void sMergeWith(String& dest, const char *delim, const String& s) } } +//$- #define E__TL(I) typename COMBINE(T, I) #define E__NFIf(I) COMBINE(p, I) = r[I - 1] #define E__NFValue(I) String& COMBINE(p, I) diff --git a/uppsrc/CppBase/cpp.cpp b/uppsrc/CppBase/cpp.cpp index f9c727766..0da6b2df6 100644 --- a/uppsrc/CppBase/cpp.cpp +++ b/uppsrc/CppBase/cpp.cpp @@ -164,6 +164,7 @@ void Cpp::DoFlatInclude(const String& header_path) segment_id.FindAdd(pp.segment_id[i]); for(int i = 0; i < pp.usings.GetCount(); i++) { namespace_using.FindAdd(pp.usings[i]); + LLOG("Flat usings " << pp.usings[i]); md5.Put('$'); md5.Put(pp.usings[i]); } @@ -253,6 +254,10 @@ void Cpp::Do(const String& sourcefile, Stream& in, const String& currentfile, bo #endif while(!in.IsEof()) { String l = prefix_macro + in.GetLine(); + if(l.StartsWith("//$")) { // Do not remove assist++ parser directives + result.Cat(l + "\n"); + continue; + } prefix_macro.Clear(); lineno++; int el = 0; diff --git a/uppsrc/CppBase/ppfile.cpp b/uppsrc/CppBase/ppfile.cpp index 597bb4610..c243d5227 100644 --- a/uppsrc/CppBase/ppfile.cpp +++ b/uppsrc/CppBase/ppfile.cpp @@ -347,6 +347,7 @@ static String sInclude_Path; void PPSync(const String& include_path) { + LLOG("* PPSync"); sIncludePath.Clear(); sFlatPP.Clear(); sInclude_Path = include_path; @@ -424,6 +425,7 @@ const PPFile& GetPPFile(const char *path) LTIMING("GetPPFile"); Time tm = GetFileTimeCached(path); PPFile& f = sPPfile.GetPut(path); + LLOG("GetPPFile " << path << ", " << f.filetime << ", " << tm); if(f.filetime != tm) { f.filetime = tm; FileIn in(path); @@ -440,9 +442,12 @@ bool IsSameFile(const String& f1, const String& f2) const FlatPP& GetFlatPPFile(const char *path, Index& visited) { LTIMING("GetFlatPPFile"); + LLOG("GetFlatPPFile " << path); int q = sFlatPP.Find(path); - if(q >= 0) + if(q >= 0) { + LLOG("From cache"); return sFlatPP[q]; + } FlatPP& fp = sFlatPP.Add(path); const PPFile& pp = GetPPFile(path); int n = visited.GetCount(); diff --git a/uppsrc/CtrlLib/ArrayCtrl.cpp b/uppsrc/CtrlLib/ArrayCtrl.cpp index a7d9b05a5..60d505bc1 100644 --- a/uppsrc/CtrlLib/ArrayCtrl.cpp +++ b/uppsrc/CtrlLib/ArrayCtrl.cpp @@ -2000,6 +2000,7 @@ void ArrayCtrl::AddSeparator() DisableLine(ii); } +//$- #define E__Addv(I) Set0(q, I - 1, p##I) #define E__AddF(I) \ void ArrayCtrl::Add(__List##I(E__Value)) { \ @@ -2008,6 +2009,7 @@ void ArrayCtrl::Add(__List##I(E__Value)) { \ AfterSet(q); \ } __Expand(E__AddF) +//$+ void ArrayCtrl::Insert(int i, int count) { if(i < array.GetCount()) { diff --git a/uppsrc/DropGrid/DropGrid.cpp b/uppsrc/DropGrid/DropGrid.cpp index b06ccc685..49f683e93 100644 --- a/uppsrc/DropGrid/DropGrid.cpp +++ b/uppsrc/DropGrid/DropGrid.cpp @@ -1047,6 +1047,7 @@ DropGrid& DropGrid::AddSeparator(Color c) return *this; } +//$- #define E__Addv0(I) list.Set(q, I - 1, p##I) #define E__AddF0(I) \ DropGrid& DropGrid::Add(__List##I(E__Value)) { \ diff --git a/uppsrc/GridCtrl/GridCtrl.cpp b/uppsrc/GridCtrl/GridCtrl.cpp index 5b311f63c..c9d01cc31 100644 --- a/uppsrc/GridCtrl/GridCtrl.cpp +++ b/uppsrc/GridCtrl/GridCtrl.cpp @@ -8679,7 +8679,7 @@ template<> void Jsonize(JsonIO& json, GridCtrl& g) { } /* after this assist++ sees nothing */ - +//$- #define E__Addv0(I) Set(q, I - 1, p##I) #define E__AddF0(I) \ GridCtrl& GridCtrl::Add(__List##I(E__Value)) { \ diff --git a/uppsrc/Sql/Sql.cpp b/uppsrc/Sql/Sql.cpp index e187ec796..9ee8de102 100644 --- a/uppsrc/Sql/Sql.cpp +++ b/uppsrc/Sql/Sql.cpp @@ -172,6 +172,8 @@ void Sql::ExecuteX(const String& s) { ExecuteX(); } +//$- + #define E__SetParam(I) SetParam(I - 1, p##I) #define E__RunF(I) \ @@ -204,6 +206,8 @@ void Sql::ExecuteX(const String& s, __List##I(E__Value)) { \ } __Expand(E__ExecuteFX) +//$+ + bool Sql::Fetch() { SqlSession& session = GetSession(); session.SetStatus(SqlSession::START_FETCHING); @@ -232,6 +236,7 @@ bool Sql::Fetch() { return b; } +//$- #define E__GetColumn(I) cn->GetColumn(I - 1, p##I) #define E__FetchF(I) \ @@ -241,6 +246,7 @@ bool Sql::Fetch(__List##I(E__Ref)) { \ return true; \ } __Expand(E__FetchF) +//$+ Vector Sql::GetRow() const { Vector row; @@ -376,6 +382,7 @@ Value Sql::Select(const String& s) { return Select0("select " + s); } +//$- #define E__SelectF(I) \ Value Sql::Select(const String& s, __List##I(E__Value)) { \ __List##I(E__SetParam); \ @@ -408,7 +415,6 @@ bool Sql::Insert(SqlId table, SqlId c0, const Value& v0, __List##I(E__IdVal)) { } __Expand(E__InsertIdF) - static inline void sComma(int I, String& s) { if(I > 1) s.Cat(", "); } @@ -435,6 +441,7 @@ bool Sql::Update(SqlId table, SqlId key, const Value& keyval, __List##I(E__IdVal " set " + list + " where " + key.ToString() + " = ?"); \ } __Expand(E__UpdateIdF) +//$+ bool Sql::Delete(const char *table, const char *key, const Value& keyval) { return Execute("delete from " + String(table) + " where " + key + " = ?", keyval); diff --git a/uppsrc/Sql/SqlSet.cpp b/uppsrc/Sql/SqlSet.cpp index e72a4e2c5..e45c1d74d 100644 --- a/uppsrc/Sql/SqlSet.cpp +++ b/uppsrc/Sql/SqlSet.cpp @@ -86,6 +86,7 @@ SqlSet SqlSetFrom(const ValueArray& va) static inline void sCat(SqlSet& s, SqlVal v) { s.Cat(v); } +//$- #define E__Cat(I) sCat(*this, p##I) #define E__SqlSetF(I) \ @@ -95,6 +96,7 @@ SqlSet::SqlSet(const SqlVal& p0, __List##I(E__SqlVal)) { \ priority = SET; \ } __Expand(E__SqlSetF); +//$+ FieldOperator::FieldOperator() {} FieldOperator::~FieldOperator() {} diff --git a/uppsrc/Sql/SqlStatement.cpp b/uppsrc/Sql/SqlStatement.cpp index 338b43c28..342360abd 100644 --- a/uppsrc/Sql/SqlStatement.cpp +++ b/uppsrc/Sql/SqlStatement.cpp @@ -280,6 +280,7 @@ SqlSelect::SqlSelect(Fields f) text = ~set; } +//$- #define E__SCat(I) set.Cat(p##I) #define E__QSqlSelectF(I) \ @@ -298,6 +299,7 @@ SqlSelect Select(__List##I(E__SqlVal)) { \ return Select(set); \ } __Expand(E__QSelectF); +//$+ // ------------------------------- diff --git a/uppsrc/Sql/Sqlexp.h b/uppsrc/Sql/Sqlexp.h index 7a1d215a0..5a14cf720 100644 --- a/uppsrc/Sql/Sqlexp.h +++ b/uppsrc/Sql/Sqlexp.h @@ -141,7 +141,7 @@ public: SqlId operator()(SqlId p) const; SqlId operator()(const S_info& table) const; -//$ SqlId operator()(SqlId p, SqlId p1, ...); +//$-SqlId operator()(SqlId p, SqlId p1, ...); #define E__PutSqlId(I) PutOf(x, p##I) #define E__SqlId(I) const SqlId& p##I #define E__Of(I) \ @@ -155,7 +155,7 @@ __Expand(E__Of) #undef E__Of #undef E__PutSqlId #undef E__SqlId - +//$+ SqlId() {} SqlId(const char *s) : id(s) {} SqlId(const String& s) : id(s) {} @@ -483,9 +483,10 @@ public: SqlSet() {} explicit SqlSet(const SqlVal& p0); +//$-SqlSet(const SqlVal& p0, ...) #define E__SqlSet(I) SqlSet(const SqlVal& p0, __List##I(E__SqlVal)); __Expand(E__SqlSet); - +//$+ explicit SqlSet(Fields nfields); SqlSet(const String& s, PRIORITY p) { text = s; priority = p; } @@ -618,9 +619,11 @@ public: SqlSelect(Fields f); SqlSelect(const SqlSet& s) { Set(s); } SqlSelect() { on = valid = false; } +//$-SqlSelect(SqlVal v, ...); #define E__QSelect(I) SqlSelect(__List##I(E__SqlVal)); -__Expand(E__QSelect); + __Expand(E__QSelect); #undef E__QSelect +//$+ bool IsEmpty() { return text.IsEmpty(); } @@ -647,9 +650,11 @@ inline SqlSelect SelectAll() { return SqlSelect(SqlAll()); } inline SqlSelect Select(const SqlSet& set) { return SqlSelect(set); } inline SqlSelect Select(Fields f) { return SqlSelect(f); } +//$-SqlSelect Select(SqlVal v, ...); #define E__QSelect(I) SqlSelect Select(__List##I(E__SqlVal)); __Expand(E__QSelect); #undef E__QSelect +//$- class SqlDelete { String text; @@ -913,6 +918,7 @@ public: SqlWith& With(SqlId table); SqlWith& WithRecursive(SqlId table); SqlWith& Arg(SqlId arg); +//$-SqlWith& operator()(SqlId id, ..) #define E__SqlId(I) const SqlId& p##I #define E__Arg(I) Arg(p##I) #define E__Args(I) \ @@ -921,6 +927,7 @@ public: #undef E__Args #undef E__Arg #undef E__SqlId +//$+ SqlWith& As(const SqlSelect& select); diff --git a/uppsrc/XmlRpc/XmlRpc.h b/uppsrc/XmlRpc/XmlRpc.h index 494e71d25..9d5c9f9e1 100644 --- a/uppsrc/XmlRpc/XmlRpc.h +++ b/uppsrc/XmlRpc/XmlRpc.h @@ -36,6 +36,7 @@ public: try { data >> x; } catch(ValueTypeMismatch) { return false; } return true; } XmlRpcCall& operator()(const char *method) { Method(method); return *this; } +//$-template XmlRpcCall& operator()(const char *method, T1 p1, ...) #define E__Templ(I) class COMBINE(T, I) #define E__Decl(I) const COMBINE(T, I)& COMBINE(p, I) #define E__Param(I) *this << COMBINE(p, I) @@ -48,11 +49,11 @@ public: } __Expand20(E__Body) - #undef E__Templ #undef E__Decl #undef E__Param #undef E__Body +//$+ String GetFaultString() const { return faultString; } int GetFaultCode() const { return faultCode; } diff --git a/uppsrc/ide/Browser/Base.cpp b/uppsrc/ide/Browser/Base.cpp index e027975a4..ed4d736fd 100644 --- a/uppsrc/ide/Browser/Base.cpp +++ b/uppsrc/ide/Browser/Base.cpp @@ -105,6 +105,7 @@ void SaveCodeBase() bool TryLoadCodeBase(const char *pattern) { + CLOG("+++ Trying to load " << pattern); FindFile ff(pattern); String path; int64 len = -1; @@ -242,7 +243,7 @@ bool CheckFile(SourceFileInfo& f, const String& path) pp.Preprocess(npath, in, GetMasterFile(npath), true); String md5 = pp.GetDependeciesMd5(GetPPFile(path).keywords); bool r = f.dependencies_md5sum == md5 && tmok; - if(!r) CLOG(path << " " << f.dependencies_md5sum << " != " << md5); + if(!r) CLOG(path << " " << f.dependencies_md5sum << " " << md5); f.depends.Clear(); f.dependencies_md5sum = md5; for(int i = 0; i < pp.visited.GetCount(); i++) @@ -317,7 +318,7 @@ void UpdateCodeBase(Progress& pi) void ParseSrc(Stream& in, int file, Callback2 error) { String path = GetSourceFilePath(file); - LLOG("====== Parse " << file << ": " << path); + CLOG("====== Parse " << file << ": " << path); Vector pp; String ext = ToLower(GetFileExt(path)); int filetype = FILE_OTHER; @@ -354,7 +355,7 @@ void CodeBaseScanFile0(Stream& in, const String& fn) { LLOG("===== CodeBaseScanFile " << fn); - InvalidateFileTimeCache(fn); + InvalidateFileTimeCache(NormalizeSourcePath(fn)); PPSync(TheIde()->IdeGetIncludePath()); LTIMING("CodeBaseScan"); @@ -379,6 +380,7 @@ void CodeBaseScanFile(const String& fn) int file = GetSourceFileIndex(fn); SourceFileInfo& f = source_file[file]; String md5sum = GetPPFile(fn).md5sum; + CLOG("CodeBaseScanFile " << fn << ", " << md5sum << " " << f.md5sum); if(md5sum != f.md5sum) { SyncCodeBase(); f.md5sum = md5sum; diff --git a/uppsrc/ide/Cpp.cpp b/uppsrc/ide/Cpp.cpp index 22479feb1..a57cf2789 100644 --- a/uppsrc/ide/Cpp.cpp +++ b/uppsrc/ide/Cpp.cpp @@ -120,13 +120,16 @@ void AssistScanError(int line, const String& text) void AssistEditor::Context(Parser& parser, int pos) { LTIMING("Context"); - + + theide->ScanFile(); String s = Get(0, pos); StringStream ss(s); - Cpp cpp; String path = NormalizeSourcePath(theide->editfile); + LLOG("---------- Context " << path); + + Cpp cpp; cpp.Preprocess(path, ss, GetMasterFile(path)); parser.dobody = true;