# HG changeset patch # User sh@sh-laptop # Date 1218054234 -7200 # Node ID 30629059b72dcc86a8ea614e7f37de8c462b6165 # Parent 44d206ae68c9b7448bc6bbdaf57da15761d6b2e5 Update the manual to reflect the changes in error output diff --git a/doc/ChangeLog b/doc/ChangeLog --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2008-08-06 Søren Hauberg + + * interpreter/basics.txi, interpreter/errors.txi, + interpreter/expr.txi, interpreter/func.txi, + interpreter/numbers.txi: Update format of error messages in examples. + 2008-07-29 David Bateman * interpreter/numbers.txi, interpreter/plot.txi, 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: - @print{} + +Invalid call to f. Correct usage is: + @print{} -- Function File: f (ARG1) + @print{} Function help text goes here... @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 -@print{} 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/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-08-06 Soren Hauberg + + * error.cc (Ferror): Update format of error messages in exmple. + * parse.y: (Feval): Likewise. + 2008-08-06 John W. Eaton * DLD-FUNCTIONS/fsolve.cc (hybrd_info_to_fsolve_info): 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 @@ -3827,9 +3827,9 @@ \n\ @example\n\ eval ('error (\"This is a bad example\");',\n\ - 'printf (\"This error occurred:\\n%s\", lasterr ());');\n\ + 'printf (\"This error occurred:\\n%s\\n\", 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") {