Mercurial > octave
comparison src/symtab.cc @ 8819:96d87674b818
also stash directory name for subfunctions
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 20 Feb 2009 01:00:25 -0500 |
parents | 70f5a0375afd |
children | eb63fbe60fab |
comparison
equal
deleted
inserted
replaced
8818:8dee145c777d | 8819:96d87674b818 |
---|---|
34 #include "dirfns.h" | 34 #include "dirfns.h" |
35 #include "input.h" | 35 #include "input.h" |
36 #include "load-path.h" | 36 #include "load-path.h" |
37 #include "symtab.h" | 37 #include "symtab.h" |
38 #include "ov-fcn.h" | 38 #include "ov-fcn.h" |
39 #include "ov-usr-fcn.h" | |
39 #include "pager.h" | 40 #include "pager.h" |
40 #include "parse.h" | 41 #include "parse.h" |
41 #include "pt-arg-list.h" | 42 #include "pt-arg-list.h" |
42 #include "toplev.h" | 43 #include "toplev.h" |
43 #include "unwind-prot.h" | 44 #include "unwind-prot.h" |
1076 | 1077 |
1077 os << "\n"; | 1078 os << "\n"; |
1078 } | 1079 } |
1079 } | 1080 } |
1080 | 1081 |
1082 void | |
1083 symbol_table::stash_dir_name_for_subfunctions (scope_id scope, | |
1084 const std::string& dir_name) | |
1085 { | |
1086 // FIXME -- is this the best way to do this? Maybe it would be | |
1087 // better if we had a map from scope to list of subfunctions | |
1088 // stored with the function. Do we? | |
1089 | |
1090 for (fcn_table_const_iterator p = fcn_table.begin (); | |
1091 p != fcn_table.end (); p++) | |
1092 { | |
1093 std::pair<std::string, octave_value> tmp | |
1094 = p->second.subfunction_defined_in_scope (scope); | |
1095 | |
1096 std::string nm = tmp.first; | |
1097 | |
1098 if (! nm.empty ()) | |
1099 { | |
1100 octave_value& fcn = tmp.second; | |
1101 | |
1102 octave_user_function *f = fcn.user_function_value (); | |
1103 | |
1104 if (f) | |
1105 f->stash_dir_name (dir_name); | |
1106 } | |
1107 } | |
1108 } | |
1109 | |
1081 octave_value | 1110 octave_value |
1082 symbol_table::do_find (const std::string& name, tree_argument_list *args, | 1111 symbol_table::do_find (const std::string& name, tree_argument_list *args, |
1083 const string_vector& arg_names, | 1112 const string_vector& arg_names, |
1084 octave_value_list& evaluated_args, | 1113 octave_value_list& evaluated_args, |
1085 bool& args_evaluated, bool skip_variables) | 1114 bool& args_evaluated, bool skip_variables) |