Skip to content

Commit

Permalink
Add documentation about paretheses for grouping expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrubeck committed Jan 20, 2012
1 parent 3d9f50a commit 2eda013
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/rust.md
Expand Up @@ -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}
Expand Down

0 comments on commit 2eda013

Please sign in to comment.