Mercurial > hg > octave-lyh
comparison src/symtab.cc @ 7942:db6478d9c669
out_of_date_check_internal: make it work for class methods
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 17 Jul 2008 14:25:11 -0400 |
parents | 3e4c9b69069d |
children | 0d607e8dbbfa |
comparison
equal
deleted
inserted
replaced
7941:f8cab9eeb128 | 7942:db6478d9c669 |
---|---|
147 | 147 |
148 return retval; | 148 return retval; |
149 } | 149 } |
150 | 150 |
151 static inline bool | 151 static inline bool |
152 out_of_date_check_internal (octave_value& function) | 152 out_of_date_check_internal (octave_value& function, |
153 const std::string& dispatch_type = std::string ()) | |
153 { | 154 { |
154 bool retval = false; | 155 bool retval = false; |
155 | 156 |
156 octave_function *fcn = function.function_value (true); | 157 octave_function *fcn = function.function_value (true); |
157 | 158 |
184 || nm.substr (nm_len-4) == ".mex")) | 185 || nm.substr (nm_len-4) == ".mex")) |
185 || (nm_len > 2 && nm.substr (nm_len-4) == ".m"))) | 186 || (nm_len > 2 && nm.substr (nm_len-4) == ".m"))) |
186 file = nm; | 187 file = nm; |
187 else | 188 else |
188 { | 189 { |
189 // FIXME -- this lookup is not right since it doesn't | |
190 // account for dispatch type. | |
191 | |
192 // We don't want to make this an absolute name, | 190 // We don't want to make this an absolute name, |
193 // because load_fcn_file looks at the name to | 191 // because load_fcn_file looks at the name to |
194 // decide whether it came from a relative lookup. | 192 // decide whether it came from a relative lookup. |
195 | 193 |
196 file = load_path::find_fcn (nm, dir_name); | 194 if (dispatch_type.empty ()) |
195 file = load_path::find_fcn (nm, dir_name); | |
196 else | |
197 file = load_path::find_method (nm, dispatch_type, | |
198 dir_name); | |
197 } | 199 } |
198 | 200 |
199 if (file.empty ()) | 201 if (file.empty ()) |
200 { | 202 { |
201 // Can't see this function from current | 203 // Can't see this function from current |
475 else | 477 else |
476 { | 478 { |
477 octave_value& fval = q->second; | 479 octave_value& fval = q->second; |
478 | 480 |
479 if (fval.is_defined ()) | 481 if (fval.is_defined ()) |
480 out_of_date_check_internal (fval); | 482 out_of_date_check_internal (fval, name); |
481 | 483 |
482 if (fval.is_defined ()) | 484 if (fval.is_defined ()) |
483 return fval; | 485 return fval; |
484 else | 486 else |
485 { | 487 { |
618 else | 620 else |
619 { | 621 { |
620 octave_value& fval = q->second; | 622 octave_value& fval = q->second; |
621 | 623 |
622 if (fval.is_defined ()) | 624 if (fval.is_defined ()) |
623 out_of_date_check_internal (fval); | 625 out_of_date_check_internal (fval, dispatch_type); |
624 | 626 |
625 if (fval.is_defined ()) | 627 if (fval.is_defined ()) |
626 return fval; | 628 return fval; |
627 else | 629 else |
628 { | 630 { |