changeset 8015:30629059b72d

Update the manual to reflect the changes in error output
author sh@sh-laptop
date Wed, 06 Aug 2008 22:23:54 +0200
parents 44d206ae68c9
children dca99c492134
files doc/ChangeLog doc/interpreter/basics.txi doc/interpreter/errors.txi doc/interpreter/expr.txi doc/interpreter/func.txi doc/interpreter/numbers.txi src/ChangeLog src/error.cc src/parse.y
diffstat 9 files changed, 49 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog	Wed Aug 06 15:50:44 2008 -0400
+++ b/doc/ChangeLog	Wed Aug 06 22:23:54 2008 +0200
@@ -1,3 +1,9 @@
+2008-08-06  Søren Hauberg  <hauberg@gmail.com>
+
+	* 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  <dbateman@free.fr>
 
 	* interpreter/numbers.txi, interpreter/plot.txi,
--- a/doc/interpreter/basics.txi	Wed Aug 06 15:50:44 2008 -0400
+++ b/doc/interpreter/basics.txi	Wed Aug 06 22:23:54 2008 +0200
@@ -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
--- a/doc/interpreter/errors.txi	Wed Aug 06 15:50:44 2008 -0400
+++ b/doc/interpreter/errors.txi	Wed Aug 06 22:23:54 2008 +0200
@@ -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)
--- a/doc/interpreter/expr.txi	Wed Aug 06 15:50:44 2008 -0400
+++ b/doc/interpreter/expr.txi	Wed Aug 06 22:23:54 2008 +0200
@@ -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 +=
--- a/doc/interpreter/func.txi	Wed Aug 06 15:50:44 2008 -0400
+++ b/doc/interpreter/func.txi	Wed Aug 06 22:23:54 2008 +0200
@@ -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
 
--- a/doc/interpreter/numbers.txi	Wed Aug 06 15:50:44 2008 -0400
+++ b/doc/interpreter/numbers.txi	Wed Aug 06 22:23:54 2008 +0200
@@ -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
--- a/src/ChangeLog	Wed Aug 06 15:50:44 2008 -0400
+++ b/src/ChangeLog	Wed Aug 06 22:23:54 2008 +0200
@@ -1,3 +1,8 @@
+2008-08-06  Soren Hauberg  <hauberg@gmail.com>
+
+	* error.cc (Ferror): Update format of error messages in exmple.
+	* parse.y: (Feval): Likewise.
+
 2008-08-06  John W. Eaton  <jwe@octave.org>
 
 	* DLD-FUNCTIONS/fsolve.cc (hybrd_info_to_fsolve_info):
--- a/src/error.cc	Wed Aug 06 15:50:44 2008 -0400
+++ b/src/error.cc	Wed Aug 06 22:23:54 2008 +0200
@@ -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\
--- a/src/parse.y	Wed Aug 06 15:50:44 2008 -0400
+++ b/src/parse.y	Wed Aug 06 22:23:54 2008 +0200
@@ -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")
 {