# HG changeset patch # User address@hidden # Date 1218054234 -7200 # Node ID 7c7c0431d79742154193978116b19b810526fc76 # Parent 3100283874d789a9369b91912946e7a99663a062 Update the manual to reflect the changes in error output diff --git a/doc/interpreter/basics.txi b/doc/interpreter/basics.txi --- a/doc/interpreter/basics.txi +++ b/doc/interpreter/basics.txi @@ -737,8 +737,10 @@ @example parse error: - functon y = f (x) y = x^2; endfunction - ^ + syntax error + +>>> functon y = f (x) y = x^2; endfunction + ^ @end example @noindent @@ -767,9 +769,8 @@ @smallexample @group error: `x' undefined near line 1 column 24 -error: evaluating expression near line 1, column 24 -error: evaluating assignment expression near line 1, column 22 -error: called from `f' +error: called from: +error: f at line 1, column 22 @end group @end smallexample @@ -787,15 +788,13 @@ indicates the input line number, which is usually displayed in the prompt string. -The second and third lines in the example indicate that the error -occurred within an assignment expression, and the last line of the error -message indicates that the error occurred within the function @code{f}. -If the function @code{f} had been called from another function, for -example, @code{g}, the list of errors would have ended with one more -line: +The second and third lines in the error message indicates that the error occurred +within the function @code{f}. If the function @code{f} had been called from +another function, for example, @code{g}, the list of errors would have ended with +one more line: @example -error: called from `g' +error: g at line 1, column 17 @end example These lists of function calls usually make it fairly easy to trace the diff --git a/doc/interpreter/errors.txi b/doc/interpreter/errors.txi --- a/doc/interpreter/errors.txi +++ b/doc/interpreter/errors.txi @@ -101,14 +101,17 @@ @example f () - @print{} Invalid call to f. Correct usage is: + +Invalid call to f. Correct usage is: + + @print{} -- Function File: f (ARG1) + @print{} Function help text goes here... @print{} - @print{} -- Function File: f (ARG1) @print{} @print{} - @print{} - @print{} error: evaluating if command near line 6, column 3 - @print{} error: called from `f' in file `/home/jwe/octave/f.m' + @print{} error: called from: + @print{} error: print_usage at line -1, column -1 + @print{} error: /home/jwe/octave/f.m at line 7, column 5 @end example @DOCSTRING(print_usage) diff --git a/doc/interpreter/expr.txi b/doc/interpreter/expr.txi --- a/doc/interpreter/expr.txi +++ b/doc/interpreter/expr.txi @@ -943,9 +943,8 @@ @c Using 'smallexample' to make text fit on page when creating smallbook. @smallexample -[a, b, c, d] = [u, s, v] = svd (a) +[a, b, c, d] = [u, s, v] = svd (a); @print{} error: element number 4 undefined in return list address@hidden error: evaluating assignment expression near line 8, column 15 @end smallexample @opindex += diff --git a/doc/interpreter/func.txi b/doc/interpreter/func.txi --- a/doc/interpreter/func.txi +++ b/doc/interpreter/func.txi @@ -176,8 +176,7 @@ @example @group -error: `retval' undefined near line 1 column 10 -error: evaluating index expression near line 7, column 1 +error: value on right hand side of assignment is undefined @end group @end example diff --git a/doc/interpreter/numbers.txi b/doc/interpreter/numbers.txi --- a/doc/interpreter/numbers.txi +++ b/doc/interpreter/numbers.txi @@ -73,8 +73,10 @@ parse error: - 3 + 4 i - ^ + syntax error + +>>> 3 + 4 i + ^ @end group @end example @@ -167,7 +169,7 @@ produces the error @example -error: number of rows must match near line 13, column 6 +error: number of rows must match (1 != 2) near line 13, column 6 @end example @noindent @@ -248,7 +250,12 @@ produces the error message @example -error: unterminated string constant +parse error: + + syntax error + +>>> [ 1 a ' ] + ^ @end example @noindent diff --git a/src/error.cc b/src/error.cc --- a/src/error.cc +++ b/src/error.cc @@ -977,11 +977,11 @@ @group\n\ f ()\n\ error: nargin != 1\n\ -error: evaluating index expression near line 1, column 30\n\ -error: evaluating binary operator `||' near line 1, column 27\n\ -error: called from `h'\n\ -error: called from `g'\n\ -error: called from `f'\n\ +error: called from:\n\ +error: error at line -1, column -1\n\ +error: h at line 1, column 27\n\ +error: g at line 1, column 15\n\ +error: f at line 1, column 15\n\ @end group\n\ @end smallexample\n\ \n\ diff --git a/src/parse.y b/src/parse.y --- a/src/parse.y +++ b/src/parse.y @@ -3829,7 +3829,7 @@ eval ('error (\"This is a bad example\");',\n\ 'printf (\"This error occurred:\\n%s\", lasterr ());');\n\ @print{} This error occurred:\n\ - error: This is a bad example\n\ + This is a bad example\n\ @end example\n\ @end deftypefn") {