Parses a standalone tuple pattern without a path prefix. # Example Input ```text (10, 20) (> 10, < 30) (== 5, != 10) ``` This parses parenthesized tuple elements. For enum/tuple variants with a path prefix (e.g., `Some(> 30)`), use PatternEnum instead.
(input: ParseStream)
| 34 | /// This parses parenthesized tuple elements. For enum/tuple variants |
| 35 | /// with a path prefix (e.g., `Some(> 30)`), use PatternEnum instead. |
| 36 | fn parse(input: ParseStream) -> syn::Result<Self> { |
| 37 | // Capture the span of the `(` token before consuming it. |
| 38 | let span = input.span(); |
| 39 | let content; |
| 40 | syn::parenthesized!(content in input); |
| 41 | |
| 42 | let elements = TupleElement::parse_comma_separated(&content)?; |
| 43 | |
| 44 | Ok(PatternTuple { |
| 45 | node_id: next_node_id(), |
| 46 | span, |
| 47 | elements, |
| 48 | }) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | /// Represents an element in a tuple pattern, supporting both positional and indexed syntax |
no test coverage detected