[svn] r6622: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel: ExprFinder.n Project.Ty...

IT svnadmin at nemerle.org
Wed Sep 6 05:43:46 CEST 2006


Log:
Fixed a couple of location issues.

Author: IT
Date: Wed Sep  6 05:43:44 2006
New Revision: 6622

Modified:
   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/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	Wed Sep  6 05:43:44 2006
@@ -355,16 +355,9 @@
       | FieldMember   (obj, mem : IMember)       // { obj : TExpr; fld : IField; }
       | PropertyMember(obj, mem : IMember) =>    // { obj : TExpr; prop : IProperty; }
 
-        def isThis = obj is TExpr.This;
-
-        unless (isThis)
-          Go(obj);
-
-        when (!_stop && IsIn(expression.Location))
-          CheckObject(expression.Location, mem);
-
-        when (isThis)
-          Go(obj);
+        Check(
+          expression.Location, fun() { CheckObject(expression.Location, mem) },
+          obj.Location,        fun() { Go(obj) });
 
       | Block         (_, e)       // { jump_out : LocalValue; body : TExpr; }
       | Throw         (e)          // { exn : TExpr; }
@@ -486,6 +479,7 @@
         {
           foreach ((pattern, pexpr, assigns) in c.patterns)
           {
+            unless (pattern is Pattern.Literal)
             DoPattern(pattern);
 
             unless (_stop)
@@ -494,6 +488,7 @@
                 Go(pexpr);
 
               foreach ((_localValue, aexpr) in assigns)
+                unless (aexpr is TExpr.Literal)
                 Go(aexpr);
             }
 
@@ -501,6 +496,7 @@
               break;
           }
 
+          unless (c.body is TExpr.Literal)
           Go(c.body);
 
           when (_stop)

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	Wed Sep  6 05:43:44 2006
@@ -98,23 +98,23 @@
       {
       | method is MethodBuilder =>
 
-        def location = method.BodyLocation;
+        def loc = method.BodyLocation;
 
-        if (location.Contains(line, col)) // in method body
+        if (loc.Contains(line, col)) // in method body
         {
-          mutable bodyCode = getText(location.Line, location.Column, location.EndLine, location.EndColumn);
+          mutable bodyCode = getText(loc.Line, loc.Column, loc.EndLine, loc.EndColumn);
 
-          def (pBody, tBody, _) = _engine.CompileMethod(method, bodyCode, location);
+          def (pBody, tBody, _) = _engine.CompileMethod(method, bodyCode, loc);
 
           mutable ret          = null;
           mutable findLocation = false;
           mutable pExpr;
-          mutable pLocation;
+          mutable pLoc;
           mutable pObj;
 
           when (pBody != null)
           {
-            (pLocation, pObj) = ExprFinder().Find(pBody.expr, line, col);
+            (pLoc, pObj) = ExprFinder().Find(pBody.expr, line, col);
 
             match (pObj)
             {
@@ -129,9 +129,9 @@
 
           when (ret == null && tBody != null)
           {
-            def (eLocation, obj) = ExprFinder().Find(tBody.expr, line, col, pLocation, findLocation);
+            def (eLoc, obj) = ExprFinder().Find(tBody.expr, line, col, pLoc, findLocation);
 
-            def loc = if (pLocation.Contains(line, col)) pLocation else eLocation;
+            def loc = if (pLoc.Contains(line, col)) pLoc.Intersect(eLoc) else eLoc;
 
             if (findLocation)
             {



More information about the svn mailing list