[svn] r7110: nemerle/trunk/ncc/parsing/MainParser.n

VladD2 svnadmin at nemerle.org
Sun Dec 17 14:57:49 CET 2006


Log:
Workaround for compleate using directove.

Author: VladD2
Date: Sun Dec 17 14:57:48 2006
New Revision: 7110

Modified:
   nemerle/trunk/ncc/parsing/MainParser.n

Modified: nemerle/trunk/ncc/parsing/MainParser.n
==============================================================================
--- nemerle/trunk/ncc/parsing/MainParser.n	(original)
+++ nemerle/trunk/ncc/parsing/MainParser.n	Sun Dec 17 14:57:48 2006
@@ -243,7 +243,8 @@
 
     static IsTopLevel (tok : Token.LooseGroup) : bool
     {
-      match (tok.Child) {
+      def testToken (_tok)
+      {
         | Token.Keyword (k) =>
           match (k) {
             | "public" | "private" | "static" | "internal"
@@ -253,11 +254,17 @@
             | _ => false
           }
           
+        // This is workaround for compleate using directove. Without it compiler 
+        // parse "u" (which user type for complete "using") as expression and 
+        // wrap it in auto-module.
+        | Token.Identifier (_)
+        | Token.IdentifierToComplete (_)       => testToken (tok.Child.Next)
         | Token.SquareGroup
         | Token.Namespace | Token.Using | null => true
-          
         | _ => false
       }
+
+      testToken (tok.Child)
     }
     
     #region Utility functions operating on current token stream



More information about the svn mailing list