[svn] r7453: nemerle/trunk/ncc/parsing/MainParser.n nemerle/trunk/ncc/typing/Typer.n vs-plugin/trunk/Nemer...

IT svnadmin at nemerle.org
Tue Feb 20 05:51:39 CET 2007


Log:
Working on ExprFinder.

Author: IT
Date: Tue Feb 20 05:51:35 2007
New Revision: 7453

Modified:
   nemerle/trunk/ncc/parsing/MainParser.n
   nemerle/trunk/ncc/typing/Typer.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/QuickTip2.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n

Modified: nemerle/trunk/ncc/parsing/MainParser.n
==============================================================================
--- nemerle/trunk/ncc/parsing/MainParser.n	(original)
+++ nemerle/trunk/ncc/parsing/MainParser.n	Tue Feb 20 05:51:35 2007
@@ -1494,7 +1494,7 @@
       def t =
         match (peek_token ()) {
           | Token.Operator (":") => shift (); parse_expr (TokenStoppers.Equal)
-          | _ => PExpr.Wildcard (id.Location)
+          | _ => PExpr.Wildcard (id.Location.AsGenerated())
         }
 
       match (peek_token ()) {
@@ -1506,7 +1506,7 @@
         | _ => ()
       }
       
-      Fun_parm (loc = id.loc, name = id, ty = t,
+      Fun_parm (loc = id.loc.Combine(t.Location), name = id, ty = t,
                 modifiers = mods, pattern_hack = pattern)
     }
 

Modified: nemerle/trunk/ncc/typing/Typer.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer.n	(original)
+++ nemerle/trunk/ncc/typing/Typer.n	Tue Feb 20 05:51:35 2007
@@ -1827,6 +1827,7 @@
                         modifiers = p.modifiers);
             fp.GetLocalDefaultValueFromModifiers (this);
             p.typed_object = fp;
+            p.ty.typed_object = fp.ty;
             fp
           });
         def name_obj = fn.header.name.GetName ();

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 Feb 20 05:51:35 2007
@@ -107,6 +107,8 @@
             r;
 
           | PExpr.Call(Ref as r, _) when _texprObject is TExpr.MacroEnvelope && IsIn(r.Location) => setobj(r);
+          | PExpr.MacroCall(name, _, _) when !IsIn(name.Location) => _texprObject = null; null;
+
           | o => o;
           }
 

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/QuickTip2.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/QuickTip2.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/QuickTip2.n	Tue Feb 20 05:51:35 2007
@@ -10,6 +10,29 @@
 
   public class Class1
   {
+    Operators(val : string)
+    {
+      _ = System.Reflection.BindingFlags.Static %| /*028:-2*/ System.Reflection.BindingFlags.Instance;
+
+      mutable ss = "";
+      foreach (s in [""])
+        ss += /*025:-2*/s;
+
+      _ = "1" + /*022:-1*/ val;
+    }
+
+    ParamTest(arr : array[int]) : void
+    {
+      def bar(bbb : array[int] /*027:-2*/) {}
+      bar(arr);
+
+      def foo( ppp /*012:-2*/) {}
+      foo(1);
+
+      mutable iii/*010:-1*/ : int/*009:-1*/;
+      _ = arr/*008:-1*/[0];
+    }
+
     public static TestMType(t : Nemerle.Compiler.MType) : string
     {
     | Fun as f =>
@@ -21,15 +44,6 @@
         ""
     }
 
-    Operators(val : string)
-    {
-      mutable ss = "";
-      foreach (s in [""])
-        ss += /*025:-2*/s;
-
-      _ = "1" + /*022:-1*/ val;
-    }
-
     MatchTest(sss : string, myvar : MyVar, o : object) : void
     {
       match (o)
@@ -79,16 +93,6 @@
       } while (foo < 1000);
     }
 
-    ParamTest(arr : array[int]) : void
-    {
-      def foo( ppp /*012:-2*/) {}
-
-      foo(1);
-
-      mutable iii/*010:-1*/ : int/*009:-1*/;
-      _ = arr/*008:-1*/[0];
-    }
-
     MacroTest() : void
     {
       foreach (ch/*011:-1*/ in "123")

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n	Tue Feb 20 05:51:35 2007
@@ -38,6 +38,7 @@
           Assert.AreEqual(len, result.ColEnd - result.ColStart);
       }
 
+      test("027", 10, "array [int]");
       test("026", 6, "fromTy");
       test("025", 2, "+=");
       test("024", 3, "Op1");



More information about the svn mailing list