Mercurial > octave
diff libinterp/parse-tree/pt-idx.cc @ 30144:3c2dee80b542
attempt more uniform handling of list concatenation in the parser
* parse.h, oct-parse.yy (append_if_clause, append_switch_case,
append_function_body, append_classdef_property, append_classdef_event,
append_classdef_enum, append_classdef_superclass,
append_classdef_attribute, append_classdef_properties_block,
append_classdef_methods_block, append_classdef_events_block,
append_classdef_enum_block, append_classdef_method,
append_decl_init_list, append_argument_list): New base_parser methods.
Use them to simplify actions in parser grammar.
* pt-idx.h, pt-idx.cc (tree_index_expression::append):
Return pointer to this. Change uses where needed.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 09 Sep 2021 13:27:49 -0400 |
parents | 7854d5752dd2 |
children | 796f54d4ddbf |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-idx.cc Thu Sep 09 08:18:52 2021 -0700 +++ b/libinterp/parse-tree/pt-idx.cc Thu Sep 09 13:27:49 2021 -0400 @@ -77,7 +77,7 @@ append (df); } - void + tree_index_expression * tree_index_expression::append (tree_argument_list *lst, char t) { m_args.push_back (lst); @@ -87,24 +87,30 @@ if (lst && lst->has_magic_tilde ()) error ("invalid use of empty argument (~) in index expression"); + + return this; } - void + tree_index_expression * tree_index_expression::append (const std::string& n) { m_args.push_back (static_cast<tree_argument_list *> (nullptr)); m_type += '.'; m_arg_nm.push_back (n); m_dyn_field.push_back (static_cast<tree_expression *> (nullptr)); + + return this; } - void + tree_index_expression * tree_index_expression::append (tree_expression *df) { m_args.push_back (static_cast<tree_argument_list *> (nullptr)); m_type += '.'; m_arg_nm.push_back (""); m_dyn_field.push_back (df); + + return this; } tree_index_expression::~tree_index_expression (void)