Author: mkrueger
Date: 2007-10-09 04:40:34 -0400 (Tue, 09 Oct 2007)
New Revision: 87150

Modified:
   trunk/monodevelop/Core/src/NRefactory/ChangeLog
   trunk/monodevelop/Core/src/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs
   trunk/monodevelop/Core/src/NRefactory/Project/Src/Lexer/LookupTable.cs
Log:
* Project/Src/Lexer/CSharp/Lexer.cs: Fixed "Bug 331772 - Unable to
  handle conditional class definition".

Modified: trunk/monodevelop/Core/src/NRefactory/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/NRefactory/ChangeLog     2007-10-09 08:07:58 UTC 
(rev 87149)
+++ trunk/monodevelop/Core/src/NRefactory/ChangeLog     2007-10-09 08:40:34 UTC 
(rev 87150)
@@ -1,5 +1,10 @@
 2007-10-09  Mike Krüger <[EMAIL PROTECTED]> 
 
+       * Project/Src/Lexer/CSharp/Lexer.cs: Fixed "Bug 331772 - Unable to 
handle
+         conditional class definition".
+
+2007-10-09  Mike Krüger <[EMAIL PROTECTED]> 
+
        * Project/Src/Lexer/CSharp/Lexer.cs: C# lexer can now handle #if ... 
#else
          ... #endif pre processing directives.
        

Modified: 
trunk/monodevelop/Core/src/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs
===================================================================
--- trunk/monodevelop/Core/src/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs     
2007-10-09 08:07:58 UTC (rev 87149)
+++ trunk/monodevelop/Core/src/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs     
2007-10-09 08:40:34 UTC (rev 87150)
@@ -13,7 +13,7 @@
 
 namespace ICSharpCode.NRefactory.Parser.CSharp
 {
-       internal sealed class Lexer : AbstractLexer
+       public sealed class Lexer : AbstractLexer
        {
                bool skipToken = false;
                bool readIf    = false;
@@ -58,6 +58,15 @@
                                        define = define.Substring (0, idx);
                                skipToken = !IsDefined (define);
                                break;
+                       case "#elif":
+                               if (!readIf)
+                                       break;
+                               string define = argument.Trim ();
+                               int idx = define.IndexOfAny (new char [] { ' ', 
'\t' });
+                               if (idx > 0)
+                                       define = define.Substring (0, idx);
+                               skipToken = !IsDefined (define);
+                               break;
                        case "#endif":
                                skipToken = false;
                                readIf    = false;

Modified: trunk/monodevelop/Core/src/NRefactory/Project/Src/Lexer/LookupTable.cs
===================================================================
--- trunk/monodevelop/Core/src/NRefactory/Project/Src/Lexer/LookupTable.cs      
2007-10-09 08:07:58 UTC (rev 87149)
+++ trunk/monodevelop/Core/src/NRefactory/Project/Src/Lexer/LookupTable.cs      
2007-10-09 08:40:34 UTC (rev 87150)
@@ -67,7 +67,7 @@
                                // insert word into the tree
                                for (int i = 0; i < keyword.Length; ++i) {
                                        int index = ((int)keyword[i]) % 256; // 
index of curchar
-                                       bool d = keyword[i] == '\\';
+//                                     bool d = keyword[i] == '\\';
                                        
                                        next = next.leaf[index];             // 
get node to this index
                                        

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to