changeset 5344:b427cca320b8

[project @ 2005-05-09 19:03:02 by jwe]
author jwe
date Mon, 09 May 2005 19:03:03 +0000
parents be0bd7a760c9
children 2781568bf951
files src/ChangeLog src/parse.y src/pt-except.cc
diffstat 3 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri May 06 18:04:16 2005 +0000
+++ b/src/ChangeLog	Mon May 09 19:03:03 2005 +0000
@@ -1,3 +1,10 @@
+2005-05-09  John W. Eaton  <jwe@octave.org>
+
+	* parse.y (except_command): Make catch clause optional in try
+	statements.
+	* pt-except.cc (tree_try_catch_command::eval):
+	Always buffer error messages.
+
 2005-05-06  John W. Eaton  <jwe@octave.org>
 
 	* ov-struct.cc (octave_struct::save_ascii,
--- a/src/parse.y	Fri May 06 18:04:16 2005 +0000
+++ b/src/parse.y	Mon May 09 19:03:03 2005 +0000
@@ -1116,6 +1116,11 @@
 		    if (! ($$ = make_try_command ($1, $4, $8, $9, $2, $6)))
 		      ABORT_PARSE;
 		  }
+		| TRY stash_comment opt_sep opt_list END
+		  {
+		    if (! ($$ = make_try_command ($1, $4, 0, $5, $2, 0)))
+		      ABORT_PARSE;
+		  }
 		;
 
 // ===========================================
--- a/src/pt-except.cc	Fri May 06 18:04:16 2005 +0000
+++ b/src/pt-except.cc	Mon May 09 19:03:03 2005 +0000
@@ -95,11 +95,8 @@
   
   MAYBE_DO_BREAKPOINT;
 
-  if (catch_code)
-    {
-      unwind_protect_int (buffer_error_messages);
-      buffer_error_messages++;
-    }
+  unwind_protect_int (buffer_error_messages);
+  buffer_error_messages++;
 
   unwind_protect::add (do_catch_code, catch_code);
 
@@ -122,8 +119,7 @@
       unwind_protect::discard ();
 
       // For restoring buffer_error_messages.
-      if (catch_code)
-	unwind_protect::run ();
+      unwind_protect::run ();
 
       // Also clear the frame marker.
       unwind_protect::discard ();