Skip to content

Commit a9d6907

Browse files
committed
Adjustments after review:
- use the TUPLE_INDEX token - compacted the TupleExpression
1 parent 2c7bf1a commit a9d6907

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/expressions/tuple-expr.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
> **<sup>Syntax</sup>**
66
> _TupleExpression_ :
77
> &nbsp;&nbsp; &nbsp;&nbsp; `(` `)`
8-
> &nbsp;&nbsp; | `(` [_Expression_] `,` `)`
9-
> &nbsp;&nbsp; | `(` [_Expression_] (`,` [_Expression_] )<sup>\+</sup>
10-
> `,`<sup>?</sup> `)`
8+
> &nbsp;&nbsp; | `(` ( [_Expression_] `,` )<sup>+</sup> [_Expression_]<sup>?</sup> `)`
119
1210
Tuples are written by enclosing zero or more comma-separated expressions in
1311
parentheses. They are used to create [tuple-typed](types.html#tuple-types)
@@ -31,7 +29,7 @@ comma:
3129

3230
> **<sup>Syntax</sup>**
3331
> _TupleIndexingExpression_ :
34-
> &nbsp;&nbsp; [_Expression_] `.` [INTEGER_LITERAL]
32+
> &nbsp;&nbsp; [_Expression_] `.` [TUPLE_INDEX]
3533
3634
[Tuples](types.html#tuple-types) and [struct tuples](items/structs.html) can be
3735
indexed using the number corresponding to the position of the field. The index
@@ -48,5 +46,5 @@ let unit_x = Point(1.0, 0.0);
4846
assert_eq!(unit_x.0, 1.0);
4947
```
5048

51-
[INTEGER_LITERAL]: tokens.html#integer-literals
49+
[TUPLE_INDEX]: tokens.html#integer-literals
5250
[_Expression_]: expressions.html

0 commit comments

Comments
 (0)