[svn] r7440: nemerle/trunk/ncc/parsing/MainParser.n vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Complet...

IT svnadmin at nemerle.org
Sun Feb 18 01:48:19 CET 2007


Log:
Working on ExprFinder.

Author: IT
Date: Sun Feb 18 01:48:14 2007
New Revision: 7440

Modified:
   nemerle/trunk/ncc/parsing/MainParser.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
   vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n

Modified: nemerle/trunk/ncc/parsing/MainParser.n
==============================================================================
--- nemerle/trunk/ncc/parsing/MainParser.n	(original)
+++ nemerle/trunk/ncc/parsing/MainParser.n	Sun Feb 18 01:48:14 2007
@@ -1946,7 +1946,10 @@
         match (parse_expr_sequence (TokenStoppers.Pipe)) {
           | [x] => x
           | [] => fatal_error (last_tok, "match case body cannot be empty")
-          | l => PExpr.Sequence (case_group.Child.Location, l)
+          | l =>
+            mutable loc = l.Head.Location;
+            l.Tail.Iter(e => loc = loc.Combine(e.Location));
+            PExpr.Sequence (loc, l)
         };
 
       MatchCase (pats, expr)

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

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	Sun Feb 18 01:48:14 2007
@@ -4,28 +4,24 @@
 {
   variant MyVar
   {
-  | Op1
-  | Op2
+  | Op1 { parms : string    }
+  | Op2 { lst   : list[int] }
   }
 
   public class Class1
   {
-    DoTest()
-    {
-      def s = "";
-      s. Substring /*018:-2*/(0);
-
-      mutable foo = 0;
-      do {
-        foo /*017:-2*/+= 100;
-      } while (foo < 1000);
-    }
-
     MatchTest(sss : string, myvar : MyVar) : void
     {
       match (myvar)
       {
-      | Op1 /*016:-2*/=> ()
+      | Op2 as op2 => _ = op2.lst. Map /*020:-2*/(_.ToString());
+      | Op1 /*016:-2*/(parms) =>
+        def res = match ( parms /*019:-2*/)
+        {
+        | "123" => 1
+        | _     => 2
+        }
+        ()
       | Op2 => ()
       }
 
@@ -45,6 +41,17 @@
       foo(sss);
     }
 
+    DoTest()
+    {
+      def s = "";
+      s. Substring /*018:-2*/(0);
+
+      mutable foo = 0;
+      do {
+        foo /*017:-2*/+= 100;
+      } while (foo < 1000);
+    }
+
     ParamTest(arr : array[int]) : void
     {
       def foo( ppp /*012:-2*/) {}

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	Sun Feb 18 01:48:14 2007
@@ -38,6 +38,8 @@
           Assert.AreEqual(len, result.ColEnd - result.ColStart);
       }
 
+      test("020", 3, "Map");
+      test("019", 5, "parms");
       test("018", 9, "Substring");
       test("017", 3, "foo");
       test("016", 3, "Op1");

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



More information about the svn mailing list