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

IT svnadmin at nemerle.org
Sat Sep 9 18:29:47 CEST 2006


Log:
Fixed ExprFinder.

Author: IT
Date: Sat Sep  9 18:29:44 2006
New Revision: 6634

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.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	Sat Sep  9 18:29:44 2006
@@ -268,6 +268,10 @@
         foreach ((_member, pattern) in args)
           DoPattern(pattern);
 
+      | As(Wildcard, decl) when decl.Location.Line < pattern.Location.Line =>
+
+        CheckObject(pattern.Location, decl)
+
       | As(pat, decl)      => // { pat : Pattern; decl : LocalValue; }
 
         Check(

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n	Sat Sep  9 18:29:44 2006
@@ -175,12 +175,18 @@
 
     private ParseMethodBody(method : MethodBuilder, lexer : LexerBase) : FunBody.Parsed
     {
+      if (method.ParsedFunction != null)
+      {
       def env = method.DeclaringType.GlobalEnv;
       def header = method.GetHeader();
       def body = FunBody.Parsed(MainParser.ParseExpr(env, lexer, method.ParsedFunction.header));
+
       header.body = body;
       body
     }
+      else
+        null
+    }
 
     public CompileMethod(
       /*[NotNull]*/ method   : MethodBuilder,
@@ -191,13 +197,12 @@
         ClearCompilerMessages();
         _isInCompletionMode = true;
 
-        mutable tBody : FunBody.Typed  = null;
-        mutable ex    : Exception      = null;
+        mutable tBody, ex;
 
         def lexer = LexerString(this, content, location);
         def pBody = ParseMethodBody(method, lexer);
 
-        when (pBody.expr != null)
+        when (pBody != null && pBody.expr != null)
         {
           try
           {



More information about the svn mailing list