From 47928ca952fa1819c8554608148934c5bad28602 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Thu, 24 Dec 2009 00:45:16 -0800 Subject: [PATCH] fixed the broken try/catch grammar --- lib/coffee_script/grammar.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coffee_script/grammar.y b/lib/coffee_script/grammar.y index 6261125f..b90de5c9 100644 --- a/lib/coffee_script/grammar.y +++ b/lib/coffee_script/grammar.y @@ -279,13 +279,13 @@ rule Try: TRY Expressions Catch "." { result = TryNode.new(val[1], val[2][0], val[2][1]) } | TRY Expressions Catch - FINALLY Then Expressions "." { result = TryNode.new(val[1], val[2][0], val[2][1], val[5]) } + FINALLY Expressions "." { result = TryNode.new(val[1], val[2][0], val[2][1], val[4]) } ; # A catch clause. Catch: /* nothing */ { result = [nil, nil] } - | CATCH IDENTIFIER Then Expressions { result = [val[1], val[3]] } + | CATCH IDENTIFIER Expressions { result = [val[1], val[2]] } ; # Throw an exception.