Mercurial > hg > octave-terminal
changeset 625:9cdb3844008b
[project @ 1994-08-19 02:01:31 by jwe]
author | jwe |
---|---|
date | Fri, 19 Aug 1994 02:02:15 +0000 |
parents | 1a7dea6fa26b |
children | 96be9eae023f |
files | src/help.cc src/pr-output.h |
diffstat | 2 files changed, 37 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/help.cc +++ b/src/help.cc @@ -650,9 +650,29 @@ else if (sym_rec->is_builtin_function ()) output_buf << *argv << " is a builtin function\n"; else if (sym_rec->is_user_variable ()) - output_buf << *argv << " is a user-defined variable\n"; + { + tree_fvc *defn = sym_rec->def (); + + if (nargout == 0 && ! quiet) + output_buf << *argv << " is a user-defined variable\n"; + + defn->print_code (output_buf); + + if (nargout == 0) + output_buf << "\n"; + } else if (sym_rec->is_builtin_variable ()) - output_buf << *argv << " is a builtin variable\n"; + { + tree_fvc *defn = sym_rec->def (); + + if (nargout == 0 && ! quiet) + output_buf << *argv << " is a builtin variable\n"; + + defn->print_code (output_buf); + + if (nargout == 0) + output_buf << "\n"; + } else output_buf << "type: `" << *argv << "' has unknown type!\n"; }
--- a/src/pr-output.h +++ b/src/pr-output.h @@ -24,18 +24,27 @@ #if !defined (octave_pr_output_h) #define octave_pr_output_h 1 -class ostrstream; +class ostream; class Matrix; class Complex; class ComplexMatrix; class Range; -extern void octave_print_internal (ostrstream& os, double d); -extern void octave_print_internal (ostrstream& os, const Matrix& m); -extern void octave_print_internal (ostrstream& os, const Complex& c); -extern void octave_print_internal (ostrstream& os, const ComplexMatrix& cm); -extern void octave_print_internal (ostrstream& os, const Range& r); +extern void octave_print_internal (ostream& os, double d, + int pr_as_read_syntax = 0); + +extern void octave_print_internal (ostream& os, const Matrix& m, + int pr_as_read_syntax = 0); + +extern void octave_print_internal (ostream& os, const Complex& c, + int pr_as_read_syntax = 0); + +extern void octave_print_internal (ostream& os, const ComplexMatrix& cm, + int pr_as_read_syntax = 0); + +extern void octave_print_internal (ostream& os, const Range& r, + int pr_as_read_syntax = 0); extern void set_format_style (int argc, char **argv);