Mercurial > octave
diff libinterp/corefcn/symtab.cc @ 17856:97e49b588f5d classdef
maint: periodic merge of default to classdef
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 05 Nov 2013 12:27:42 -0500 |
parents | 93b3d03b05e7 86e8dbccf7c7 |
children | 6762a6d23010 |
line wrap: on
line diff
--- a/libinterp/corefcn/symtab.cc Wed Oct 23 22:48:29 2013 -0400 +++ b/libinterp/corefcn/symtab.cc Tue Nov 05 12:27:42 2013 -0500 @@ -56,7 +56,8 @@ std::map<std::string, symbol_table::fcn_info> symbol_table::fcn_table; -std::map<std::string, std::set<std::string> > symbol_table::class_precedence_table; +std::map<std::string, std::set<std::string> > + symbol_table::class_precedence_table; std::map<std::string, std::list<std::string> > symbol_table::parent_map; @@ -84,13 +85,13 @@ { octave_user_function *fcn = curr_fcn; - // FIXME -- If active_context () == -1, then it does not make much + // FIXME: If active_context () == -1, then it does not make much // sense to use this symbol_record. This means an attempt at accessing // a variable from a function that has not been called yet is // happening. This should be cleared up when an implementing closures. return fcn && fcn->active_context () != static_cast<context_id> (-1) - ? fcn->active_context () : xcurrent_context; + ? fcn->active_context () : xcurrent_context; } void @@ -156,7 +157,7 @@ // elements, we also check if the working directory has changed // since the last time the function was loaded/parsed). // -// FIXME -- perhaps this should be done for all loaded functions when +// FIXME: perhaps this should be done for all loaded functions when // the prompt is printed or the directory has changed, and then we // would not check for it when finding symbol definitions. @@ -192,7 +193,7 @@ if (fcn) { - // FIXME -- we need to handle subfunctions properly here. + // FIXME: we need to handle subfunctions properly here. if (! fcn->is_subfunction ()) { @@ -219,10 +220,10 @@ { int nm_len = nm.length (); - if (octave_env::absolute_pathname (nm) - && ((nm_len > 4 && (nm.substr (nm_len-4) == ".oct" - || nm.substr (nm_len-4) == ".mex")) - || (nm_len > 2 && nm.substr (nm_len-2) == ".m"))) + if (octave_env::absolute_pathname (nm) && + ((nm_len > 4 && (nm.substr (nm_len-4) == ".oct" + || nm.substr (nm_len-4) == ".mex")) + || (nm_len > 2 && nm.substr (nm_len-2) == ".m"))) file = nm; else { @@ -244,7 +245,8 @@ while (it != plist.end ()) { - file = load_path::find_method (*it, nm, dir_name); + file = load_path::find_method (*it, nm, + dir_name); if (! file.empty ()) break; @@ -489,7 +491,7 @@ } void -symbol_table::fcn_info::fcn_info_rep:: mark_subfunction_in_scope_as_private +symbol_table::fcn_info::fcn_info_rep::mark_subfunction_in_scope_as_private (scope_id scope, const std::string& class_name) { scope_val_iterator p = subfunctions.find (scope); @@ -556,8 +558,10 @@ || (btyp_isarray (ityp) && (! btyp_isarray (jtyp) || (btyp_isinteger (jtyp) && ! btyp_isinteger (ityp)) - || ((ityp == btyp_double || ityp == btyp_complex || ityp == btyp_char) - && (jtyp == btyp_float || jtyp == btyp_float_complex))))); + || ((ityp == btyp_double || ityp == btyp_complex + || ityp == btyp_char) + && (jtyp == btyp_float + || jtyp == btyp_float_complex))))); sup_table[i][j] = use_j ? jtyp : ityp; } @@ -684,7 +688,7 @@ scope_val_iterator r = subfunctions.find (scope); if (r != subfunctions.end ()) { - // FIXME -- out-of-date check here. + // FIXME: out-of-date check here. return r->second; } @@ -943,7 +947,7 @@ scope_val_iterator r = subfunctions.find (scope); if (r != subfunctions.end ()) { - // FIXME -- out-of-date check here. + // FIXME: out-of-date check here. return r->second; } @@ -959,7 +963,8 @@ } octave_value -symbol_table::fcn_info::fcn_info_rep::find_method (const std::string& dispatch_type) +symbol_table::fcn_info::fcn_info_rep::find_method + (const std::string& dispatch_type) { octave_value retval; @@ -1125,8 +1130,8 @@ } void -symbol_table::fcn_info::fcn_info_rep::dump - (std::ostream& os, const std::string& prefix) const +symbol_table::fcn_info::fcn_info_rep::dump (std::ostream& os, + const std::string& prefix) const { os << prefix << full_name () << " [" @@ -1212,8 +1217,8 @@ symbol_table *inst = get_instance (xcurrent_scope); return inst - ? inst->do_find (name, args, skip_variables, local_funcs) - : octave_value (); + ? inst->do_find (name, args, skip_variables, local_funcs) + : octave_value (); } octave_value @@ -1298,7 +1303,8 @@ { os << " subfunctions defined in this scope:\n"; - for (std::map<std::string, octave_value>::const_iterator p = sfuns.begin (); + for (std::map<std::string, + octave_value>::const_iterator p = sfuns.begin (); p != sfuns.end (); p++) os << " " << p->first << "\n"; @@ -1350,7 +1356,7 @@ symbol_table::stash_dir_name_for_subfunctions (scope_id scope, const std::string& dir_name) { - // FIXME -- is this the best way to do this? Maybe it would be + // FIXME: is this the best way to do this? Maybe it would be // better if we had a map from scope to list of subfunctions // stored with the function. Do we? @@ -1480,7 +1486,8 @@ storage = 'i'; workspace_element elt (storage, nm, val.class_name (), - val.short_disp (), dv.str ()); + val.short_disp (), dv.str (), + val.is_complex_type ()); retval.push_back (elt); } @@ -1589,7 +1596,7 @@ } DEFUN (ignore_function_time_stamp, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} ignore_function_time_stamp ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} ignore_function_time_stamp (@var{new_val})\n\ Query or set the internal variable that controls whether Octave checks\n\ @@ -1670,7 +1677,7 @@ */ DEFUN (__current_scope__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{scope}, @var{context}]} __dump_symtab_info__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -1684,7 +1691,7 @@ } DEFUN (__dump_symtab_info__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __dump_symtab_info__ ()\n\ @deftypefnx {Built-in Function} {} __dump_symtab_info__ (@var{scope})\n\ @deftypefnx {Built-in Function} {} __dump_symtab_info__ (\"scopes\")\n\ @@ -1724,8 +1731,8 @@ octave_idx_type k = 0; - for (std::list<symbol_table::scope_id>::const_iterator p = lst.begin (); - p != lst.end (); p++) + for (std::list<symbol_table::scope_id>::const_iterator + p = lst.begin (); p != lst.end (); p++) v.xelem (k++) = *p; retval = v; @@ -1755,7 +1762,7 @@ #if 0 -// FIXME -- should we have functions like this in Octave? +// FIXME: should we have functions like this in Octave? DEFUN (set_variable, args, , "set_variable (NAME, VALUE)") {