Browse files

SI-4249 try/catch accepts expression

  • Loading branch information...
1 parent 622ffd4 commit e197cf8e72ad126d9bcdd0bb1d79b888e80cfca9 @adriaanm adriaanm committed Mar 12, 2014
Showing with 13 additions and 17 deletions.
  1. +3 −5 08-expressions.md
  2. +10 −12 15-scala-syntax-summary.md
View
8 08-expressions.md
@@ -3,13 +3,11 @@
```
Expr ::= (Bindings | id | `_') `=>' Expr
| Expr1
- Expr1 ::= `if' `(' Expr `)' {nl} Expr [[semi] else Expr]
+ Expr1 ::= `if' `(' Expr `)' {nl} Expr [[semi] `else' Expr]
| `while' `(' Expr `)' {nl} Expr
- | `try' `{' Block `}' [`catch' `{' CaseClauses `}']
- [`finally' Expr]
+ | `try' (`{' Block `}' | Expr) [`catch' `{' CaseClauses `}'] [`finally' Expr]
| `do' Expr [semi] `while' `(' Expr ')'
- | `for' (`(' Enumerators `)' | `{' Enumerators `}')
- {nl} [`yield'] Expr
+ | `for' (`(' Enumerators `)' | `{' Enumerators `}') {nl} [`yield'] Expr
| `throw' Expr
| `return' [Expr]
| [SimpleExpr `.'] id `=' Expr
View
22 15-scala-syntax-summary.md
@@ -108,20 +108,18 @@ grammar.
Expr ::= (Bindings | [‘implicit’] id | ‘_’) ‘=>’ Expr
| Expr1
- Expr1 ::= ‘if’ ‘(’ Expr ‘)’ {nl} Expr [[semi] else Expr]
- | ‘while’ ‘(’ Expr ‘)’ {nl} Expr
- | ‘try’ ‘{’ Block ‘}’ [‘catch’ ‘{’ CaseClauses ‘}’]
- [‘finally’ Expr]
- | ‘do’ Expr [semi] ‘while’ ‘(’ Expr ‘)’
- | ‘for’ (‘(’ Enumerators ‘)’ | ‘{’ Enumerators ‘}’)
- {nl} [‘yield’] Expr
- | ‘throw’ Expr
- | ‘return’ [Expr]
- | [SimpleExpr ‘.’] id ‘=’ Expr
- | SimpleExpr1 ArgumentExprs ‘=’ Expr
+ Expr1 ::= `if' `(' Expr `)' {nl} Expr [[semi] `else' Expr]
+ | `while' `(' Expr `)' {nl} Expr
+ | `try' (`{' Block `}' | Expr) [`catch' `{' CaseClauses `}'] [`finally' Expr]
+ | `do' Expr [semi] `while' `(' Expr ')'
+ | `for' (`(' Enumerators `)' | `{' Enumerators `}') {nl} [`yield'] Expr
+ | `throw' Expr
+ | `return' [Expr]
+ | [SimpleExpr `.'] id `=' Expr
+ | SimpleExpr1 ArgumentExprs `=' Expr
| PostfixExpr
| PostfixExpr Ascription
- | PostfixExpr match’ ‘{’ CaseClauses ‘}’
+ | PostfixExpr `match' `{' CaseClauses `}'
PostfixExpr ::= InfixExpr [id [nl]]
InfixExpr ::= PrefixExpr
| InfixExpr id [nl] InfixExpr

0 comments on commit e197cf8

Please sign in to comment.