# HG changeset patch # User John W. Eaton # Date 1622809165 14400 # Node ID 05d7b7e64811ce322d1d2083b878b303cfadd2f7 # Parent be335be5c0bc4b49f3c8b1c1430b952876c808c2 eliminate unused lexical feedback flag * lex.h, lex.ll, (lexical_feedback::m_looking_at_initializer_expression): Delete useless member variable. It was set but never used otherwise. * parse.yy (decl_param_init): Delete useless non-terminal. Its only purpose was to set lexer.m_looking_at_initializer_expression. (decl2, attr, class_property): Don't use decl_param_init. Adjust semantic values. Don't set lexer.m_looking_at_initializer_expression. diff -r be335be5c0bc -r 05d7b7e64811 libinterp/parse-tree/lex.h --- a/libinterp/parse-tree/lex.h Fri Jun 04 10:35:32 2021 +0200 +++ b/libinterp/parse-tree/lex.h Fri Jun 04 08:19:25 2021 -0400 @@ -272,7 +272,6 @@ m_looking_at_return_list (false), m_looking_at_parameter_list (false), m_looking_at_decl_list (false), - m_looking_at_initializer_expression (false), m_looking_at_matrix_or_assign_lhs (false), m_looking_for_object_index (false), m_looking_at_indirect_ref (false), @@ -377,10 +376,6 @@ // persistent). bool m_looking_at_decl_list; - // true means we are looking at the initializer expression for a - // parameter list element. - bool m_looking_at_initializer_expression; - // true means we're parsing a matrix or the left hand side of // multi-value assignment statement. bool m_looking_at_matrix_or_assign_lhs; diff -r be335be5c0bc -r 05d7b7e64811 libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Fri Jun 04 10:35:32 2021 +0200 +++ b/libinterp/parse-tree/lex.ll Fri Jun 04 08:19:25 2021 -0400 @@ -2235,7 +2235,6 @@ m_looking_at_return_list = false; m_looking_at_parameter_list = false; m_looking_at_decl_list = false; - m_looking_at_initializer_expression = false; m_looking_at_matrix_or_assign_lhs = false; m_looking_for_object_index = false; m_looking_at_indirect_ref = false; diff -r be335be5c0bc -r 05d7b7e64811 libinterp/parse-tree/oct-parse.yy --- a/libinterp/parse-tree/oct-parse.yy Fri Jun 04 10:35:32 2021 +0200 +++ b/libinterp/parse-tree/oct-parse.yy Fri Jun 04 08:19:25 2021 -0400 @@ -243,7 +243,7 @@ // %token VARARGIN VARARGOUT // Nonterminals we construct. -%type indirect_ref_op decl_param_init +%type indirect_ref_op %type push_fcn_symtab push_script_symtab begin_file %type param_list_beg param_list_end stmt_begin anon_fcn_begin %type parsing_local_fcns parse_error at_first_executable_stmt @@ -1129,20 +1129,13 @@ } ; -decl_param_init : // empty - { - $$ = 0; - lexer.m_looking_at_initializer_expression = true; - } - decl2 : identifier { $$ = new octave::tree_decl_elt ($1); } - | identifier '=' decl_param_init expression + | identifier '=' expression { OCTAVE_YYUSE ($2); - lexer.m_looking_at_initializer_expression = false; - $$ = new octave::tree_decl_elt ($1, $4); + $$ = new octave::tree_decl_elt ($1, $3); } ; @@ -2000,12 +1993,11 @@ attr : identifier { $$ = new octave::tree_classdef_attribute ($1); } - | identifier '=' decl_param_init expression + | identifier '=' expression { OCTAVE_YYUSE ($2); - lexer.m_looking_at_initializer_expression = false; - $$ = new octave::tree_classdef_attribute ($1, $4); + $$ = new octave::tree_classdef_attribute ($1, $3); } | EXPR_NOT identifier { @@ -2168,13 +2160,11 @@ { $$ = new octave::tree_classdef_property ($2, $1); } - | stash_comment identifier '=' decl_param_init expression + | stash_comment identifier '=' expression { OCTAVE_YYUSE ($3); - lexer.m_looking_at_initializer_expression = false; - - $$ = new octave::tree_classdef_property ($2, $5, $1); + $$ = new octave::tree_classdef_property ($2, $4, $1); } ;