From 53330715e44be231cdb070e5d1d2c6272023bc25 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 5 Jun 2016 18:34:13 -0700 Subject: Allow empty @(catch) and @(finally). * parser.y (catch_clauses_opt): Don't diagnose empty catch and finally. There is no benefit in doing so; moreover, it contravenes the documentation, which explicitly says these may be empty. I.e. this fixes a regression. --- parser.y | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/parser.y b/parser.y index 2062669a..181980ba 100644 --- a/parser.y +++ b/parser.y @@ -562,25 +562,16 @@ try_clause : TRY newl catch_clauses_opt : CATCH ')' newl clauses_opt - catch_clauses_opt { if ((!opt_compat || opt_compat > 139) - && nilp($4)) - yyerr("empty catch clause"); - $$ = cons(list(catch_s, cons(t, nil), + catch_clauses_opt { $$ = cons(list(catch_s, cons(t, nil), $4, nao), $5); rl($$, num($1)); } | CATCH exprs ')' newl clauses_opt - catch_clauses_opt { if ((!opt_compat || opt_compat > 139) - && nilp($5)) - yyerr("empty catch clause"); - $$ = cons(list(catch_s, $2, $5, nao), + catch_clauses_opt { $$ = cons(list(catch_s, $2, $5, nao), $6); rl($$, num($1)); } | FINALLY newl - clauses_opt { if ((!opt_compat || opt_compat > 139) - && nilp($3)) - yyerr("empty finally clause"); - $$ = cons(list(finally_s, nil, + clauses_opt { $$ = cons(list(finally_s, nil, $3, nao), nil); rl($$, num($1)); } -- cgit v1.2.3