Mercurial > hg > octave-terminal
changeset 1510:fe9c39fd89c7
[project @ 1995-10-03 10:43:11 by jwe]
author | jwe |
---|---|
date | Tue, 03 Oct 1995 10:43:40 +0000 |
parents | 36477a20e8c8 |
children | 74f9e88a2c12 |
files | src/pt-exp-base.cc src/pt-misc.h src/variables.cc |
diffstat | 3 files changed, 29 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pt-exp-base.cc +++ b/src/pt-exp-base.cc @@ -197,10 +197,12 @@ t1 = 0.0; int flag = user_pref.propagate_empty_matrices; if (flag < 0) - warning ("%s: empty matrix used in conditional expression"); + warning ("%s: empty matrix used in conditional expression", + warn_for); else if (flag == 0) { - ::error ("%s: empty matrix used in conditional expression"); + ::error ("%s: empty matrix used in conditional expression", + warn_for); return expr_value; } } @@ -221,13 +223,14 @@ panic_impossible (); } else - ::error ("%s: invalid type in conditional expression"); + ::error ("%s: invalid type in conditional expression", warn_for); } else - ::error ("%s: undefined value used in conditional expression"); + ::error ("%s: undefined value used in conditional expression", + warn_for); } else - ::error ("%s: error evaluating conditional expression"); + ::error ("%s: error evaluating conditional expression", warn_for); return expr_value; }
--- a/src/pt-misc.h +++ b/src/pt-misc.h @@ -88,6 +88,26 @@ void set_print_flag (int print) { print_flag = print; } + int is_command (void) + { return command != 0; } + + int is_expression (void) + { return expression != 0; } + + int line (void) + { + return command + ? command->line () + : (expression ? expression->line () : -1); + } + + int column (void) + { + return command + ? command->column () + : (expression ? expression->column () : -1); + } + void print_code (ostream& os); private:
--- a/src/variables.cc +++ b/src/variables.cc @@ -1830,7 +1830,7 @@ DEFVAR ("warn_missing_semicolon", SBV_warn_missing_semicolon, 0.0, 0, warn_missing_semicolon, "produce a warning if a statement in a script or function file is -not terminated with a semicolon") +not terminated with a semicolon"); DEFVAR ("whitespace_in_literal_matrix", SBV_whitespace_in_literal_matrix, "", 0,