# HG changeset patch # User jwe # Date 848427078 0 # Node ID 64f403ef483d95558e9e803204f4cde4f9d6e364 # Parent 90fa35bd021679233303a7bada9a49b225151946 [project @ 1996-11-19 18:06:02 by jwe] diff --git a/src/Makefile.in b/src/Makefile.in --- a/src/Makefile.in +++ b/src/Makefile.in @@ -294,12 +294,7 @@ if [ "$$linkdir" = $(octincludedir) ] ; then \ true ; \ else \ - if [ -d $$linkdir ] ; then \ - true ; \ - else \ - rm -f $$linkdir ; \ - $(LN_S) $(octincludedir) $$linkdir ; \ - fi ; \ + rm -f $$linkdir && $(LN_S) $(octincludedir) $$linkdir ; \ fi .PHONY: install-lib diff --git a/src/pt-exp-base.cc b/src/pt-exp-base.cc --- a/src/pt-exp-base.cc +++ b/src/pt-exp-base.cc @@ -28,6 +28,8 @@ #include #endif +#include + #include #include @@ -72,6 +74,12 @@ return octave_value (); } +string +tree_expression::original_text (void) const +{ + return string (); +} + /* ;;; Local Variables: *** ;;; mode: C++ *** diff --git a/src/pt-exp-base.h b/src/pt-exp-base.h --- a/src/pt-exp-base.h +++ b/src/pt-exp-base.h @@ -27,6 +27,8 @@ #pragma interface #endif +#include + class octave_value; #include "pt-base.h" @@ -59,9 +61,6 @@ virtual bool is_matrix_constant (void) const { return false; } - virtual bool is_range_constant (void) const - { return false; } - virtual bool is_multi_val_ret_expression (void) const { return false; } @@ -92,6 +91,8 @@ virtual char *oper (void) const { return ""; } + virtual string original_text (void) const; + protected: // Nonzero if this expression appears inside parentheses. diff --git a/src/pt-fcn.cc b/src/pt-fcn.cc --- a/src/pt-fcn.cc +++ b/src/pt-fcn.cc @@ -35,6 +35,7 @@ #include "error.h" #include "gripes.h" #include "help.h" +#include "input.h" #include "pager.h" #include "symtab.h" #include "toplev.h" @@ -395,7 +396,7 @@ void tree_function::print_code_function_header (void) { - tree_print_code tpc (octave_stdout); + tree_print_code tpc (octave_stdout, Vps4); tpc.visit_function_header (*this); } @@ -403,7 +404,7 @@ void tree_function::print_code_function_trailer (void) { - tree_print_code tpc (octave_stdout); + tree_print_code tpc (octave_stdout, Vps4); tpc.visit_function_trailer (*this); } diff --git a/src/pt-misc.cc b/src/pt-misc.cc --- a/src/pt-misc.cc +++ b/src/pt-misc.cc @@ -38,6 +38,7 @@ #endif #include "error.h" +#include "input.h" #include "oct-obj.h" #include "pager.h" #include "toplev.h" @@ -87,7 +88,7 @@ if (in_function_body && (Vecho_executing_commands & ECHO_FUNCTIONS)) { - tree_print_code tpc (octave_stdout); + tree_print_code tpc (octave_stdout, Vps4); accept (tpc); } diff --git a/src/pt-pr-code.cc b/src/pt-pr-code.cc --- a/src/pt-pr-code.cc +++ b/src/pt-pr-code.cc @@ -31,7 +31,6 @@ #include #include "error.h" -#include "input.h" #include "pr-output.h" #include "pt-pr-code.h" @@ -569,7 +568,7 @@ if (in_parens) os << "("; - val.print (os, true); + val.print (os, true, print_original_text); if (in_parens) os << ")"; @@ -1080,7 +1079,7 @@ if (beginning_of_line) { - os.form ("%s%*s", Vps4.c_str (), curr_print_indent_level, ""); + os.form ("%s%*s", prefix.c_str (), curr_print_indent_level, ""); beginning_of_line = false; } } diff --git a/src/pt-pr-code.h b/src/pt-pr-code.h --- a/src/pt-pr-code.h +++ b/src/pt-pr-code.h @@ -27,6 +27,8 @@ #pragma interface #endif +#include + #include "pt-walk.h" // How to print the code that the parse trees represent. @@ -36,7 +38,9 @@ { public: - tree_print_code (ostream& os_arg) : os (os_arg) { } + tree_print_code (ostream& os_arg, const string& pfx = string (), + bool pr_orig_txt = true) + : os (os_arg), prefix (pfx), print_original_text (pr_orig_txt) { } ~tree_print_code (void) { } @@ -130,6 +134,10 @@ ostream& os; + string prefix; + + bool print_original_text; + static int curr_print_indent_level; static bool beginning_of_line;