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

IT svnadmin at nemerle.org
Fri Oct 27 06:15:55 CEST 2006


Log:
Fixed the 'return started working fine' bug. 

Author: IT
Date: Fri Oct 27 06:15:51 2006
New Revision: 6799

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.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	Fri Oct 27 06:15:51 2006
@@ -16,7 +16,6 @@
   {
     mutable _line          : int;
     mutable _col           : int;
-    mutable _stop          : bool;
     mutable _counter       : int;
     mutable _curLocation   : Location;
     mutable _retObject     : object;
@@ -24,6 +23,17 @@
     mutable _pexprLocation : Location;
     mutable _findLocation  : bool;
 
+    mutable __stop          : bool;
+
+    _stop : bool
+    {
+      get { __stop }
+      set
+      {
+        __stop = value
+      }
+    }
+
     #region Find PExpr
 
     PFinder(info : ExprWalkInfo) : void
@@ -52,7 +62,8 @@
 
         match (sp)
         {
-        | HalfId(name) => CheckObject(sp.Location, name)
+        | HalfId(name) => CheckObject (sp.Location, name)
+        | Name         => CheckLocated(sp)
         | _ => ()
         }
       | _ => ()
@@ -123,15 +134,19 @@
       | ConstantObjectRef(_, o : object)         // { from : MType.Class; mem : IField; }
       | StaticPropertyRef(_, o : object)         // { from : MType.Class; prop : IProperty; }
       | StaticEventRef   (_, o : object)         // { from : MType.Class; ev : IEvent; }
-      | Base                (o : object)         // { base_ctor : IMethod; }
-      | LocalFunRef         (o : object, _)      // { decl : LocalValue; type_parms : list [TyVar]; }
-      | LocalRef            (o : object) =>      // { decl : LocalValue; }
+      | Base                (o : object) =>      // { base_ctor : IMethod; }
 
         CheckObject(expression.Location, o);
 
+      | LocalFunRef         (decl, _)            // { decl : LocalValue; type_parms : list [TyVar]; }
+      | LocalRef            (decl)       =>      // { decl : LocalValue; }
+
+        unless (decl.ExpandedBlockReturn)
+          CheckObject(expression.Location, decl);
+
       | Error
       | ImplicitValueTypeCtor
-      | DefaultValue
+      //| DefaultValue
       | Goto                                     // { target : int; mutable try_block : int; }
       | This
       | OpCode                             =>    // { name : string; }
@@ -155,7 +170,7 @@
       | DefValIn(nm, val, body)            =>    // { name : LocalValue; val : TExpr; mutable body : TExpr; }
 
         Check(
-          nm. Location, () => CheckLocated(nm),
+          nm. Location, () => unless (nm.ExpandedBlockReturn) CheckLocated(nm),
           val.Location, () => info.Walk(val));
 
         unless (body == null)
@@ -168,6 +183,11 @@
 
         info.Walk(e2);
 
+      //| Sequence(e1, e2)                  => // { mutable e1 : TExpr; mutable e2 : TExpr; }
+
+      //  info.Walk(e1);
+      //  info.Walk(e2);
+
       | Delayed(susp)                     => // { susp : Typer.DelayedTyping; }
 
         unless (susp.IsResolved)
@@ -350,13 +370,12 @@
       {
         def loc = l1.Intersect(l2);
 
-        if (loc == l1) { f1(); f2(); }
-        else           { f2(); f1(); }
+        if (loc == l1) { f1(); unless (_stop) f2(); }
+        else           { f2(); unless (_stop) f1(); }
       }
       else
       {
-        f1();
-        f2();
+        f1(); unless (_stop) f2();
       }
     }
 



More information about the svn mailing list