diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-06-05 18:34:13 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-06-05 18:34:13 -0700 |
commit | 53330715e44be231cdb070e5d1d2c6272023bc25 (patch) | |
tree | 69c7dc50070f7327840367db1d9597833dc0dc4e | |
parent | 350bec8b65e92e598744e4e821f59517d9804b36 (diff) | |
download | txr-53330715e44be231cdb070e5d1d2c6272023bc25.tar.gz txr-53330715e44be231cdb070e5d1d2c6272023bc25.tar.bz2 txr-53330715e44be231cdb070e5d1d2c6272023bc25.zip |
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.
-rw-r--r-- | parser.y | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -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)); } |