Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

ParserTester for codecompletion plugin

<< < (6/6)

ollydbg:

--- Quote from: Loaden on February 27, 2010, 11:45:43 am ---Refactoring code, and add two methods: PrintTree and PrintList.
It should work better.

--- End quote ---
Great! It works better now! Thanks for your work!

Loaden:
Hi,all, I created a unix project for ptest, and after testing, it works well.
Another change: I changed test.cpp TO test.h, so that it can be added to the project, for easy testing.

[attachment deleted by admin]

code robot:
THANK YOU!!!

I can now code again using the VC++ compiler :)

Please add this to the main repo a.s.a.p.
(In case anyone else needs this fix right away, I manually copy/pasted the .cpp/.h files from 'parserTesterV1.zip' , into my local SVN checkout folder, and recompiled Code::Blocks)

Loaden:

--- Quote from: ollydbg on February 27, 2010, 04:50:16 am ---By the way, I don't change these code snippet in tokenizer.cpp ,but the TortoiseSVN always thought I was changing that...

--- Code: ---#ifdef __WXMSW__ // This is a Windows only bug!
    else if (c == 178 || c == 179 || c == 185) // fetch ² and ³
    {
        str = c;
        MoveToNextChar();
    }
#endif


--- End code ---


--- End quote ---
I find the reason: don't use TortoiseSVN , you can use patch in MSYS.

ollydbg:
This is a pure patch to let the parserthread.cpp and tokenizer.cpp supporting ParserTester project.


--- Code: ---Index: parserthread.cpp
===================================================================
--- parserthread.cpp (revision 6218)
+++ parserthread.cpp (working copy)
@@ -21,12 +21,18 @@
 
 #define PARSERTHREAD_DEBUG_OUTPUT 0
 
+#ifdef PARSER_TEST
+  extern void ParserTrace(const wxChar* format, ...);
+  #define TRACE(format, args...)\
+  ParserTrace(format , ## args)
+#else
 #if PARSERTHREAD_DEBUG_OUTPUT
-    #define TRACE(format, args...)\
-    Manager::Get()->GetLogManager()->DebugLog(F( format , ## args))
+   #define TRACE(format, args...)\
+   Manager::Get()->GetLogManager()->DebugLog(F( format , ## args))
 #else
-    #define TRACE(format, args...)
+   #define TRACE(format, args...)
 #endif
+#endif
 
 int THREAD_START       = wxNewId();
 int THREAD_END         = wxNewId();
@@ -1184,11 +1190,13 @@
         while (!token.IsEmpty() && token != ParserConsts::kw_endif)
             token = m_Tokenizer.GetToken();
         --m_PreprocessorIfCount;
-#if PARSERTHREAD_DEBUG_OUTPUT
+#if PARSERTHREAD_DEBUG_OUTPUT || defined PARSER_TEST
         int l = m_Tokenizer.GetNestingLevel();
 #endif
         m_Tokenizer.RestoreNestingLevel();
+#if PARSERTHREAD_DEBUG_OUTPUT || defined PARSER_TEST
         TRACE(_T("HandlePreprocessorBlocks() : Restoring nesting level: %d (was %d)"), m_Tokenizer.GetNestingLevel(), l);
+#endif
     }
     else if (preproc==ParserConsts::kw_endif) // #endif
         --m_PreprocessorIfCount;
Index: tokenizer.cpp
===================================================================
--- tokenizer.cpp (revision 6218)
+++ tokenizer.cpp (working copy)
@@ -15,15 +15,22 @@
 #include "manager.h"
 #include <cctype>
 #include <globals.h>
+#include "logmanager.h"
 
 #define TOKENIZER_DEBUG_OUTPUT 0
 
+#ifdef PARSER_TEST
+    extern void ParserTrace(const wxChar* format, ...);
+    #define TRACE(format, args...)\
+    ParserTrace(format , ## args)
+#else
 #if TOKENIZER_DEBUG_OUTPUT
     #define TRACE(format, args...)\
     Manager::Get()->GetLogManager()->DebugLog(F( format , ## args))
 #else
     #define TRACE(format, args...)
 #endif
+#endif
 
 namespace TokenizerConsts
 {

--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version