mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-19 03:44:23 -05:00
fixed the broken try/catch grammar
This commit is contained in:
@@ -279,13 +279,13 @@ rule
|
|||||||
Try:
|
Try:
|
||||||
TRY Expressions Catch "." { result = TryNode.new(val[1], val[2][0], val[2][1]) }
|
TRY Expressions Catch "." { result = TryNode.new(val[1], val[2][0], val[2][1]) }
|
||||||
| TRY Expressions Catch
|
| 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.
|
# A catch clause.
|
||||||
Catch:
|
Catch:
|
||||||
/* nothing */ { result = [nil, nil] }
|
/* nothing */ { result = [nil, nil] }
|
||||||
| CATCH IDENTIFIER Then Expressions { result = [val[1], val[3]] }
|
| CATCH IDENTIFIER Expressions { result = [val[1], val[2]] }
|
||||||
;
|
;
|
||||||
|
|
||||||
# Throw an exception.
|
# Throw an exception.
|
||||||
|
|||||||
Reference in New Issue
Block a user