From 0c0b5899fd51f87a305ff27c31f9b5dd3be0c560 Mon Sep 17 00:00:00 2001 From: Martin Nilsson <mani@lysator.liu.se> Date: Sun, 29 Jun 2008 13:04:49 +0200 Subject: [PATCH] nomaks warning only complains onece, and not in compat <= 7.6 Rev: src/language.yacc:1.439 Rev: src/lexer.h:1.81 --- src/language.yacc | 11 +++++++++-- src/lexer.h | 8 ++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/language.yacc b/src/language.yacc index 2bc3e77470..9dbd056dce 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 c1de82d4f5..ad5cce42ac 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; -- GitLab