diff --git a/src/language.yacc b/src/language.yacc index 270a914c6a8618521409a29733135b41afd710d6..bd419f178cb392c0f0746fe68f52655aa8f7e02d 100644 --- a/src/language.yacc +++ b/src/language.yacc @@ -188,7 +188,7 @@ /* This is the grammar definition of Pike. */ #include "global.h" -RCSID("$Id: language.yacc,v 1.163 2000/02/15 22:06:17 hubbe Exp $"); +RCSID("$Id: language.yacc,v 1.164 2000/02/17 01:15:22 grubba Exp $"); #ifdef HAVE_MEMORY_H #include <memory.h> #endif @@ -667,6 +667,9 @@ def: modifiers type_or_error optional_stars F_IDENTIFIER push_compiler_frame0 int e; /* construct the function type */ push_finished_type(compiler_frame->current_type); + if ($3) { + yywarning("The *-syntax in types is obsolete. Use array instead."); + } while(--$3>=0) push_type(T_ARRAY); if(compiler_frame->current_return_type) @@ -995,11 +998,19 @@ soft_cast: '[' type ']' type6: type | identifier_type ; -type: type '*' { push_type(T_ARRAY); } +type: type '*' + { + yywarning("The *-syntax in types is obsolete. Use array instead."); + push_type(T_ARRAY); + } | type2 ; -type7: type7 '*' { push_type(T_ARRAY); } +type7: type7 '*' + { + yywarning("The *-syntax in types is obsolete. Use array instead."); + push_type(T_ARRAY); + } | type4 ; @@ -1296,6 +1307,9 @@ new_name: optional_stars F_IDENTIFIER { struct pike_string *type; push_finished_type(compiler_frame->current_type); + if ($1) { + yywarning("The *-syntax in types is obsolete. Use array instead."); + } while($1--) push_type(T_ARRAY); type=compiler_pop_type(); define_variable($2->u.sval.u.string, type, current_modifiers); @@ -1307,6 +1321,9 @@ new_name: optional_stars F_IDENTIFIER { struct pike_string *type; push_finished_type(compiler_frame->current_type); + if ($1) { + yywarning("The *-syntax in types is obsolete. Use array instead."); + } while($1--) push_type(T_ARRAY); type=compiler_pop_type(); if ((current_modifiers & ID_EXTERN) && (compiler_pass == 1)) { @@ -1343,6 +1360,9 @@ new_name: optional_stars F_IDENTIFIER new_local_name: optional_stars F_IDENTIFIER { push_finished_type($<n>0->u.sval.u.string); + if ($1) { + yywarning("The *-syntax in types is obsolete. Use array instead."); + } while($1--) push_type(T_ARRAY); add_local_name($2->u.sval.u.string, compiler_pop_type(),0); $$=mknode(F_ASSIGN,mkintnode(0),mklocalnode(islocal($2->u.sval.u.string),0)); @@ -1352,6 +1372,9 @@ new_local_name: optional_stars F_IDENTIFIER | optional_stars F_IDENTIFIER '=' expr0 { push_finished_type($<n>0->u.sval.u.string); + if ($1) { + yywarning("The *-syntax in types is obsolete. Use array instead."); + } while($1--) push_type(T_ARRAY); add_local_name($2->u.sval.u.string, compiler_pop_type(),0); $$=mknode(F_ASSIGN,$4,mklocalnode(islocal($2->u.sval.u.string),0)); @@ -1632,6 +1655,9 @@ local_function2: optional_stars F_IDENTIFIER push_compiler_frame1 debug_malloc_touch(compiler_frame->current_return_type); push_finished_type($<n>0->u.sval.u.string); + if ($1) { + yywarning("The *-syntax in types is obsolete. Use array instead."); + } while($1--) push_type(T_ARRAY); if(compiler_frame->current_return_type)