Permalink
Browse files

Add documentation about paretheses for grouping expressions

  • Loading branch information...
1 parent 3d9f50a commit 2eda013ea24c7a6209bbd3836460c5a31a18682c @mbrubeck committed Jan 20, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 doc/rust.md
View
@@ -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}

0 comments on commit 2eda013

Please sign in to comment.