# HG changeset patch # User jwe # Date 812717020 0 # Node ID fe9c39fd89c7420ec7bab93bf7af6e5f54be52d0 # Parent 36477a20e8c8e3e7f1c9ec7422a05081cd6b2a88 [project @ 1995-10-03 10:43:11 by jwe] 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 @@ -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; } diff --git a/src/pt-misc.h b/src/pt-misc.h --- 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: diff --git a/src/variables.cc b/src/variables.cc --- 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,