# HG changeset patch # User John W. Eaton # Date 1377213788 14400 # Node ID 56fe31b248debaee1d5a835eb72ffe0cd674204c # Parent 8e2906e2fb2660c00ccfa66e6f367c5e6a093f92 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. diff -r 8e2906e2fb26 -r 56fe31b248de libinterp/parse-tree/oct-parse.in.yy --- a/libinterp/parse-tree/oct-parse.in.yy Thu Aug 22 14:48:09 2013 -0400 +++ b/libinterp/parse-tree/oct-parse.in.yy Thu Aug 22 19:23:08 2013 -0400 @@ -259,7 +259,7 @@ %type switch_command %type switch_case default_case %type case_list1 case_list -%type decl2 +%type decl2 param_list_elt %type decl1 %type declaration %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 // ===================================