Add documentation about paretheses for grouping expressions
This commit is contained in:
parent
3d9f50a186
commit
2eda013ea2
16
doc/rust.md
16
doc/rust.md
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user