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

IT svnadmin at nemerle.org
Tue Nov 21 02:54:31 CET 2006


Log:
Fixed location of local function closing bracket.

Author: IT
Date: Tue Nov 21 02:54:28 2006
New Revision: 6970

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n

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	Tue Nov 21 02:54:28 2006
@@ -255,10 +255,18 @@
           {
           | PExpr.DefFunctions(funs) => // { funs : list [Function_decl]; }
 
-            funs.Iter(f => AddRegion(
-              Utils.Combine(f.header.Location, f.body.Location).
-                TrimStart(f.header.Location, false),
-                false));
+            funs.Iter(f =>
+            {
+              mutable loc = Utils.Combine(f.header.Location, f.body.Location).TrimStart(f.header.Location, false);
+
+              when (IsNext(loc.Line, loc.Column, ' ') && IsNext(loc.Line, loc.Column + 1, ')'))
+                loc = Location(loc.FileIndex, loc.Line, loc.Column + 1, loc.EndLine, loc.EndColumn);
+
+              when (IsNext(loc.Line, loc.Column, ')'))
+                loc = Location(loc.FileIndex, loc.Line, loc.Column + 1, loc.EndLine, loc.EndColumn);
+
+              AddRegion(loc, false);
+            });
 
           | PExpr.Match(_, cases) => ProcessMatch(cases);
           | _ => ()

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n	Tue Nov 21 02:54:28 2006
@@ -201,7 +201,7 @@
       | None    => expression : object
       }
 
-    | Literal(Enum(_, _, field))       => _debug(field); field
+    | Literal(Enum(_, _, field))       => field
 
     | ConstantObjectRef(_, o : object)         // { from : MType.Class; mem : IField; }
     | StaticPropertyRef(_, o : object)         // { from : MType.Class; prop : IProperty; }

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	Tue Nov 21 02:54:28 2006
@@ -149,6 +149,8 @@
 
         def ast = method.Ast;
 
+        // Body must be processed first.
+        //
         if (method.BodyLocation.Contains(line, col))
         {
           //method.ResetBody(); //HACK!!!



More information about the svn mailing list