Mercurial > hg > octave-nkf
changeset 17317:56fe31b248de
disallow ~ in global and persistent declaration lists
* oct-pasre.in.yy (decl2): Omit magic_tilde.
(param_list2): Use param_list_elt instead of decl2
(param_list_elt): New non-terminal constructed from decl2 and
magic_tilde.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 22 Aug 2013 19:23:08 -0400 |
parents | 8e2906e2fb26 |
children | accafe1aee7c |
files | libinterp/parse-tree/oct-parse.in.yy |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy +++ b/libinterp/parse-tree/oct-parse.in.yy @@ -259,7 +259,7 @@ %type <tree_switch_command_type> switch_command %type <tree_switch_case_type> switch_case default_case %type <tree_switch_case_list_type> case_list1 case_list -%type <tree_decl_elt_type> decl2 +%type <tree_decl_elt_type> decl2 param_list_elt %type <tree_decl_init_list_type> decl1 %type <tree_decl_command_type> declaration %type <tree_statement_type> statement function_end classdef_end @@ -798,10 +798,6 @@ lexer.looking_at_initializer_expression = false; $$ = new tree_decl_elt ($1, $4); } - | magic_tilde - { - $$ = new tree_decl_elt ($1); - } ; // ==================== @@ -1070,15 +1066,21 @@ } ; -param_list2 : decl2 +param_list2 : param_list_elt { $$ = new tree_parameter_list ($1); } - | param_list2 ',' decl2 + | param_list2 ',' param_list_elt { $1->append ($3); $$ = $1; } ; +param_list_elt : decl2 + { $$ = $1; } + | magic_tilde + { $$ = new tree_decl_elt ($1); } + ; + // =================================== // List of function return value names // ===================================