[svn] r7780: nemerle/trunk/ncc/parsing/Utility.n

nazgul svnadmin at nemerle.org
Thu Aug 30 16:52:16 CEST 2007


Log:
Try to find location if given is Default

Author: nazgul
Date: Thu Aug 30 16:52:16 2007
New Revision: 7780

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

Modified: nemerle/trunk/ncc/parsing/Utility.n
==============================================================================
--- nemerle/trunk/ncc/parsing/Utility.n	(original)
+++ nemerle/trunk/ncc/parsing/Utility.n	Thu Aug 30 16:52:16 2007
@@ -195,10 +195,7 @@
 
     public Warning (code : int, loc : Location, m : string) : void
     {
-      def loc =
-        if (loc == Location.Default) Location_stack.top()
-        else loc;
-
+      def loc = findLoc (loc);
       when (code == -1 || Manager.Options.Warnings.IsEnabledAt (loc, code)) {
         Manager.RunWarningOccured (loc, m);
   
@@ -218,6 +215,11 @@
       Warning (code, Location.Default, m)
     }
 
+    findLoc (loc : Location) : Location
+    {
+      if (loc == Location.Default) Location_stack.top()
+      else loc;
+    }
     
     public Hint (loc : Location, m : string) : void
     {
@@ -246,6 +248,7 @@
 
     public HintOnce (code : int, loc : Location, m : string) : void
     {
+      def loc = findLoc (loc);
       when (Manager.Options.Warnings.IsEnabledAt (loc, code))
         HintOnce (loc, m);
     }



More information about the svn mailing list