diff -r 1322308fa83a src/oct-parse.yy --- a/src/oct-parse.yy Thu Aug 04 23:35:13 2011 -0500 +++ b/src/oct-parse.yy Fri Aug 05 19:05:10 2011 +0200 @@ -2072,8 +2072,9 @@ make_anon_fcn_handle (tree_parameter_lis { // FIXME -- need to get these from the location of the @ symbol. - int l = -1; - int c = -1; + /* XXX */ + int l = input_line_number; + int c = current_input_column; tree_parameter_list *ret_list = 0; @@ -2094,6 +2095,7 @@ make_anon_fcn_handle (tree_parameter_lis tree_anon_fcn_handle *retval = new tree_anon_fcn_handle (param_list, ret_list, body, fcn_scope, l, c); + //retval->stash_file_name (curr_fcn_file_name); return retval; } diff -r 1322308fa83a src/pt-fcn-handle.cc --- a/src/pt-fcn-handle.cc Thu Aug 04 23:35:13 2011 -0500 +++ b/src/pt-fcn-handle.cc Fri Aug 05 19:05:10 2011 +0200 @@ -127,6 +127,7 @@ tree_anon_fcn_handle::rvalue1 (int) } uf->mark_as_inline_function (); + uf->stash_fcn_file_name (file_name); uf->stash_fcn_location (line (), column ()); octave_value ov_fcn (uf); diff -r 1322308fa83a src/pt-fcn-handle.h --- a/src/pt-fcn-handle.h Thu Aug 04 23:35:13 2011 -0500 +++ b/src/pt-fcn-handle.h Fri Aug 05 19:05:10 2011 +0200 @@ -92,13 +92,14 @@ tree_anon_fcn_handle : public tree_expre public: tree_anon_fcn_handle (int l = -1, int c = -1) - : tree_expression (l, c), fcn (0) { } + : tree_expression (l, c), fcn (0), file_name () { } tree_anon_fcn_handle (tree_parameter_list *pl, tree_parameter_list *rl, tree_statement_list *cl, symbol_table::scope_id sid, int l = -1, int c = -1) : tree_expression (l, c), - fcn (new octave_user_function (sid, pl, rl, cl)) { } + fcn (new octave_user_function (sid, pl, rl, cl)), + file_name () { } ~tree_anon_fcn_handle (void) { delete fcn; } @@ -135,11 +136,16 @@ public: void accept (tree_walker& tw); + void stash_file_name (const std::string& file) { file_name = file; } + private: // The function. octave_user_function *fcn; + // Filename where the handle was defined. + std::string file_name; + // No copying! tree_anon_fcn_handle (const tree_anon_fcn_handle&);