diff --git a/src/language.yacc b/src/language.yacc
index 2bc3e77470d56ad1e47c57113fbd6c825581a7d9..9dbd056dce4d100ecf71d4c31f63e7c531afd19e 100644
--- a/src/language.yacc
+++ b/src/language.yacc
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: language.yacc,v 1.438 2008/06/28 22:05:04 mast Exp $
+|| $Id: language.yacc,v 1.439 2008/06/29 11:04:49 nilsson Exp $
 */
 
 %pure_parser
@@ -1237,7 +1237,14 @@ arguments2: new_arg_name { $$ = 1; }
   ;
 
 modifier:
-    TOK_NO_MASK    { $$ = ID_FINAL | ID_INLINE; }
+    TOK_NO_MASK
+    {
+      $$ = ID_FINAL | ID_INLINE;
+      if( !(THIS_COMPILATION->lex.pragmas & ID_NO_DEPRECATION_WARNINGS) &&
+          !TEST_COMPAT(7, 6) && Pike_compiler->compiler_pass==1 )
+        yywarning("Keyword nomask is deprecated in favor for 'final'.");
+
+    }
   | TOK_FINAL_ID   { $$ = ID_FINAL | ID_INLINE; }
   | TOK_STATIC     { $$ = ID_STATIC; }
   | TOK_EXTERN     { $$ = ID_EXTERN; }
diff --git a/src/lexer.h b/src/lexer.h
index c1de82d4f57fd4619aec9190843d85422781662e..ad5cce42acd9ef7e4a69bd05655e59e6ef0735b0 100644
--- a/src/lexer.h
+++ b/src/lexer.h
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: lexer.h,v 1.80 2008/06/28 15:07:33 nilsson Exp $
+|| $Id: lexer.h,v 1.81 2008/06/29 11:04:49 nilsson Exp $
 */
 
 /*
@@ -539,11 +539,7 @@ static int low_yylex(struct lex *lex, YYSTYPE *yylval)
 	  if(ISWORD("multiset")) return TOK_MULTISET_ID;
 	  break;
 	case TWO_CHAR('n','o'):
-	  if(ISWORD("nomask")) {
-            if( !(lex->pragmas & ID_NO_DEPRECATION_WARNINGS) )
-              yywarning("Keyword nomask is deprecated in favor for 'final'.");
-            return TOK_NO_MASK;
-          }
+	  if(ISWORD("nomask")) return TOK_NO_MASK;
 	  break;
 	case TWO_CHAR('o','b'):
 	  if(ISWORD("object")) return TOK_OBJECT_ID;