diff src/parse.y @ 1489:3e705c864019

[project @ 1995-09-28 05:38:26 by jwe]
author jwe
date Thu, 28 Sep 1995 05:38:26 +0000
parents 766af9ca8edb
children 893b416bb919
line wrap: on
line diff
--- a/src/parse.y	Tue Sep 26 22:49:48 1995 +0000
+++ b/src/parse.y	Thu Sep 28 05:38:26 1995 +0000
@@ -223,6 +223,7 @@
 %token <tok_val> TEXT STYLE
 %token <tok_val> FOR WHILE IF ELSEIF ELSE BREAK CONTINUE FUNC_RET
 %token <tok_val> UNWIND CLEANUP
+%token <tok_val> TRY CATCH
 %token <tok_val> GLOBAL
 %token <tok_val> TEXT_ID
 
@@ -612,6 +613,14 @@
 		    $$ = new tree_unwind_protect_command ($3, $6, $1->line (),
 							  $1->column ());
 		  }
+		| TRY optsep opt_list CATCH optsep opt_list END
+		  {
+		    if (check_end ($7, token::try_catch_end))
+		      ABORT_PARSE;
+
+		    $$ = new tree_try_catch_command ($3, $6, $1->line (),
+						     $1->column ());
+		  }
 		| WHILE expression optsep opt_list END
 		  {
 		    maybe_warn_assign_as_truth_value ($2);
@@ -1318,6 +1327,14 @@
 	  end_error ("if", ettype, l, c);
 	  break;
 
+	case token::try_catch_end:
+	  end_error ("try", ettype, l, c);
+	  break;
+
+	case token::unwind_protect_end:
+	  end_error ("unwind_protect", ettype, l, c);
+	  break;
+
 	case token::while_end:
 	  end_error ("while", ettype, l, c);
 	  break;