Mercurial > octave-nkf
comparison src/ov-fcn-inline.cc @ 8045:24701aa75ecb
scope fixes for anonymous and inline functions that appear inside subfunctions
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 20 Aug 2008 15:57:14 -0400 |
parents | 2fd4a5ef6b59 |
children | 25bc2d31e1bf |
comparison
equal
deleted
inserted
replaced
8044:faf0abc5fd51 | 8045:24701aa75ecb |
---|---|
89 fcn = fh->fcn_val (); | 89 fcn = fh->fcn_val (); |
90 | 90 |
91 octave_user_function *uf = fcn.user_function_value (); | 91 octave_user_function *uf = fcn.user_function_value (); |
92 | 92 |
93 if (uf) | 93 if (uf) |
94 uf->stash_parent_fcn_scope (octave_call_stack::current_scope ()); | 94 { |
95 octave_function *curr_fcn = octave_call_stack::current (); | |
96 | |
97 if (curr_fcn) | |
98 { | |
99 symbol_table::scope_id parent_scope | |
100 = curr_fcn->parent_fcn_scope (); | |
101 | |
102 if (parent_scope < 0) | |
103 parent_scope = curr_fcn->scope (); | |
104 | |
105 uf->stash_parent_fcn_scope (parent_scope); | |
106 } | |
107 } | |
95 } | 108 } |
96 } | 109 } |
97 | 110 |
98 if (fcn.is_undefined ()) | 111 if (fcn.is_undefined ()) |
99 error ("inline: unable to define function"); | 112 error ("inline: unable to define function"); |