[svn] r6953: vs-plugin/trunk: Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n Nemerle.Compi...

IT svnadmin at nemerle.org
Sun Nov 19 07:58:04 CET 2006


Log:
Fixed local function outlining.

Author: IT
Date: Sun Nov 19 07:58:00 2006
New Revision: 6953

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/XmlDocInfo.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/XmlDocReader.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n	Sun Nov 19 07:58:00 2006
@@ -257,7 +257,7 @@
 
             funs.Iter(f => AddRegion(
               Utils.Combine(f.header.Location, f.body.Location).
-                TrimStart(f.header.Location, true),
+                TrimStart(f.header.Location, false),
                 false));
 
           | PExpr.Match(_, cases) => ProcessMatch(cases);
@@ -334,7 +334,6 @@
 
       def isProcessed(m) 
       {
-        _debug(m);
         !(m.Attributes %&& (NemerleAttributes.SpecialName | NemerleAttributes.Abstract))
           && m.Location.FileIndex == _fileIndex
       }

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n	Sun Nov 19 07:58:00 2006
@@ -87,17 +87,23 @@
       def member      = 
         if (typeBuilder.IsDelegate) typeBuilder : IMember
         else typeBuilder.GetActiveMember(fileIndex, line, col,
-          fun(m1, m2)
+          fun(m1 : IMember, m2 : IMember) : IMember
+          {
+            def doIgnore(m)
+            {
+            | m is MethodBuilder => m.IsCompilerGenerated()
+            | _                  => false
+            }
+
+            if (doIgnore(m1))
+              if (doIgnore(m2)) null else m2
+            else if (doIgnore(m2))
+              m1
+            else
           {
             def loc1 = m1.Location;
             def loc2 = m2.Location;
 
-            match (m1)
-            {
-              | m is MethodBuilder when m.IsCompilerGenerated() => 
-                assert(true);
-                m2 // m2 òîæå ìîæåò áûòü IsCompilerGenerated(). Íàäî êàê-òî åãî èãíîðèðîâàòü òîæå.
-              | _ => 
                 if (loc1 == loc2)
                   if (m2 is PropertyBuilder) m2 else m1
                 else

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n	Sun Nov 19 07:58:00 2006
@@ -348,10 +348,7 @@
       | "if" | "elif" | "else" | "endif"
       | "error"  | "warning"
       | "region" | "endregion"
-      | "define" | "undef" =>
-
-        last_col = col;
-
+      | "define" | "undef" => last_col = col;
       | "line"   =>
 
         last_col = col;

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/XmlDocInfo.n
==============================================================================

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/XmlDocReader.n
==============================================================================

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n	Sun Nov 19 07:58:00 2006
@@ -279,7 +279,11 @@
       {
       | [m] => m
       | []  => null
-      | m1 :: m2 :: tail => filter(comparator(m1, m2) :: tail)
+      | m1 :: m2 :: tail =>
+
+        def m = comparator(m1, m2);
+        filter(if (m == null) tail else m :: tail)
+
       }
 
       filter(members)

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs	Sun Nov 19 07:58:00 2006
@@ -303,8 +303,8 @@
 							request.FileName,
 							cm.Message,
 							ts,
-							cm.MessageKind == MessageKind.Error ? Severity.Error :
-							cm.MessageKind == MessageKind.Warning ? Severity.Warning :
+							cm.MessageKind == MessageKind.Error?   Severity.Error :
+							cm.MessageKind == MessageKind.Warning? Severity.Warning :
 																											Severity.Hint);
 
 						return true;



More information about the svn mailing list