Mercurial > hg > octave-lyh
comparison src/pt-fcn-handle.cc @ 8658:73c4516fae10
New evaluator and debugger derived from tree-walker class
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 04 Feb 2009 00:47:53 -0500 |
parents | 24701aa75ecb |
children | ab87d08d9a1b |
comparison
equal
deleted
inserted
replaced
8657:102e05821f93 | 8658:73c4516fae10 |
---|---|
47 { | 47 { |
48 os << ((pr_as_read_syntax || pr_orig_text) ? "@" : "") << nm; | 48 os << ((pr_as_read_syntax || pr_orig_text) ? "@" : "") << nm; |
49 } | 49 } |
50 | 50 |
51 octave_value | 51 octave_value |
52 tree_fcn_handle::rvalue (void) | 52 tree_fcn_handle::rvalue1 (int) |
53 { | 53 { |
54 MAYBE_DO_BREAKPOINT; | |
55 | |
56 return make_fcn_handle (nm); | 54 return make_fcn_handle (nm); |
57 } | 55 } |
58 | |
59 | 56 |
60 octave_value_list | 57 octave_value_list |
61 tree_fcn_handle::rvalue (int nargout) | 58 tree_fcn_handle::rvalue (int nargout) |
62 { | 59 { |
63 octave_value_list retval; | 60 octave_value_list retval; |
64 | 61 |
65 if (nargout > 1) | 62 if (nargout > 1) |
66 error ("invalid number of output arguments for function handle expression"); | 63 error ("invalid number of output arguments for function handle expression"); |
67 else | 64 else |
68 retval = rvalue (); | 65 retval = rvalue1 (nargout); |
69 | 66 |
70 return retval; | 67 return retval; |
71 } | 68 } |
72 | 69 |
73 tree_expression * | 70 tree_expression * |
86 { | 83 { |
87 tw.visit_fcn_handle (*this); | 84 tw.visit_fcn_handle (*this); |
88 } | 85 } |
89 | 86 |
90 octave_value | 87 octave_value |
91 tree_anon_fcn_handle::rvalue (void) | 88 tree_anon_fcn_handle::rvalue1 (int) |
92 { | 89 { |
93 MAYBE_DO_BREAKPOINT; | |
94 | |
95 tree_parameter_list *param_list = parameter_list (); | 90 tree_parameter_list *param_list = parameter_list (); |
96 tree_parameter_list *ret_list = return_list (); | 91 tree_parameter_list *ret_list = return_list (); |
97 tree_statement_list *cmd_list = body (); | 92 tree_statement_list *cmd_list = body (); |
98 symbol_table::scope_id this_scope = scope (); | 93 symbol_table::scope_id this_scope = scope (); |
99 | 94 |
138 octave_value_list retval; | 133 octave_value_list retval; |
139 | 134 |
140 if (nargout > 1) | 135 if (nargout > 1) |
141 error ("invalid number of output arguments for anonymous function handle expression"); | 136 error ("invalid number of output arguments for anonymous function handle expression"); |
142 else | 137 else |
143 retval = rvalue (); | 138 retval = rvalue1 (nargout); |
144 | 139 |
145 return retval; | 140 return retval; |
146 } | 141 } |
147 | 142 |
148 tree_expression * | 143 tree_expression * |