Mercurial > octave
diff libinterp/parse-tree/parse.h @ 23600:db947ba52118
explicitly limit anonymous functions to a single expression
* ov-fcn-handle.cc (octave_fcn_handle::print_raw): Handle anonymous
function body as a single expression.
* parse.h, oct-parse.in.yy: Now expect 8 shift/reduce conflicts.
(expr_no_assign): New non-terminal.
(expression): Split into expr_no_assign and assign_expr.
(anon_fcn_handle): Define body as expr_no_assign instead of statement.
(base_parser::make_anon_fcn_handle): Handle body as a single
expression instead of statement.
* pt-eval.cc (tree_evaluator::visit_anon_fcn_handle): Handle body as a
single expression instead of statement.
* pt-fcn-handle.h, pt-fcn-handle.cc (class tree_anon_fcn_handle):
Handle body as a single expression. Eliminate return list.
* pt-pr-code.h, pt-pr-code.cc (tree_print_code::print_fcn_handle_body):
Handle anonymous function handle body as single expression.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 11 Jun 2017 16:37:26 -0400 |
parents | c6714ae1c06c |
children | 214cb58ccc1c |
line wrap: on
line diff
--- a/libinterp/parse-tree/parse.h Fri Jun 09 02:21:28 2017 -0400 +++ b/libinterp/parse-tree/parse.h Sun Jun 11 16:37:26 2017 -0400 @@ -179,7 +179,8 @@ // Build an anonymous function handle. tree_anon_fcn_handle * - make_anon_fcn_handle (tree_parameter_list *param_list, tree_statement *stmt); + make_anon_fcn_handle (tree_parameter_list *param_list, + tree_expression * expr); // Build a binary expression. tree_expression *