# HG changeset patch # User jwe # Date 1115665383 0 # Node ID b427cca320b812596321fe6d34b4ca064e7ab018 # Parent be0bd7a760c9322bd44c5cf1a835dc5457cc620f [project @ 2005-05-09 19:03:02 by jwe] diff -r be0bd7a760c9 -r b427cca320b8 src/ChangeLog --- 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 + + * 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 * ov-struct.cc (octave_struct::save_ascii, diff -r be0bd7a760c9 -r b427cca320b8 src/parse.y --- 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; + } ; // =========================================== diff -r be0bd7a760c9 -r b427cca320b8 src/pt-except.cc --- 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 ();