Add documentation about paretheses for grouping expressions

This commit is contained in:
Matt Brubeck 2012-01-19 21:52:55 -08:00
parent 3d9f50a186
commit 2eda013ea2
1 changed files with 16 additions and 0 deletions

View File

@ -1705,6 +1705,22 @@ as
Operators at the same precedence level are evaluated left-to-right.
### Grouped expressions
An expression enclosed in parentheses evaluates to the result of the enclosed
expression. Parentheses can be used to explicitly specify evaluation order
within an expression.
~~~~~~~~{.ebnf .gram}
paren_expr : '(' expr ')' ;
~~~~~~~~
An example of a parenthesized expression:
~~~~
let x = (2 + 3) * 4;
~~~~
### Unary copy expressions
~~~~~~~~{.ebnf .gram}