comparison src/oct-parse.yy @ 10570:a61d7248627c

When loading a mex-file temporarily load the m-file version to get the help string (bug #29427)
author David Bateman <dbateman@free.fr>
date Sun, 25 Apr 2010 23:18:48 +0200
parents 4d1fc073fbb7
children cb0883127251
comparison
equal deleted inserted replaced
10569:4f2e46473153 10570:a61d7248627c
3719 nm = fcn_name; 3719 nm = fcn_name;
3720 3720
3721 retval = octave_dynamic_loader::load_oct (nm, file, fcn_file_from_relative_lookup); 3721 retval = octave_dynamic_loader::load_oct (nm, file, fcn_file_from_relative_lookup);
3722 } 3722 }
3723 else if (len > 4 && file.substr (len-4, len-1) == ".mex") 3723 else if (len > 4 && file.substr (len-4, len-1) == ".mex")
3724 retval = octave_dynamic_loader::load_mex (nm, file, fcn_file_from_relative_lookup); 3724 {
3725 // Temporarily load m-file version of mex-file, if it exists,
3726 // to get the help-string to use.
3727 frame.protect_var (curr_fcn_file_name);
3728 frame.protect_var (curr_fcn_file_full_name);
3729
3730 curr_fcn_file_name = nm;
3731 curr_fcn_file_full_name = file.substr (0, len - 2);
3732
3733 octave_function *tmpfcn = parse_fcn_file (file.substr (0, len - 2),
3734 dispatch_type, autoloading,
3735 false);
3736
3737 retval = octave_dynamic_loader::load_mex (nm, file, fcn_file_from_relative_lookup);
3738
3739 if (tmpfcn)
3740 retval->document (tmpfcn->doc_string ());
3741 delete tmpfcn;
3742 }
3725 else if (len > 2) 3743 else if (len > 2)
3726 { 3744 {
3727 // These are needed by yyparse. 3745 // These are needed by yyparse.
3728 3746
3729 frame.protect_var (curr_fcn_file_name); 3747 frame.protect_var (curr_fcn_file_name);