Add notes
This commit is contained in:
parent
6b98704df6
commit
a7e808ed25
1 changed files with 4 additions and 1 deletions
|
@ -675,7 +675,9 @@ pub enum BindingMode {
|
||||||
|
|
||||||
#[derive(Clone, Encodable, Decodable, Debug)]
|
#[derive(Clone, Encodable, Decodable, Debug)]
|
||||||
pub enum RangeEnd {
|
pub enum RangeEnd {
|
||||||
|
/// `..=` or `...`
|
||||||
Included(RangeSyntax),
|
Included(RangeSyntax),
|
||||||
|
/// `..`
|
||||||
Excluded,
|
Excluded,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,6 +689,7 @@ pub enum RangeSyntax {
|
||||||
DotDotEq,
|
DotDotEq,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// All the different flavors of pattern that Rust recognizes.
|
||||||
#[derive(Clone, Encodable, Decodable, Debug)]
|
#[derive(Clone, Encodable, Decodable, Debug)]
|
||||||
pub enum PatKind {
|
pub enum PatKind {
|
||||||
/// Represents a wildcard pattern (`_`).
|
/// Represents a wildcard pattern (`_`).
|
||||||
|
@ -727,7 +730,7 @@ pub enum PatKind {
|
||||||
/// A literal.
|
/// A literal.
|
||||||
Lit(P<Expr>),
|
Lit(P<Expr>),
|
||||||
|
|
||||||
/// A range pattern (e.g., `1...2`, `1..=2` or `1..2`).
|
/// A range pattern (e.g., `1...2`, `1..2`, `1..`, `..2`, `1..=2`, `..=2`).
|
||||||
Range(Option<P<Expr>>, Option<P<Expr>>, Spanned<RangeEnd>),
|
Range(Option<P<Expr>>, Option<P<Expr>>, Spanned<RangeEnd>),
|
||||||
|
|
||||||
/// A slice pattern `[a, b, c]`.
|
/// A slice pattern `[a, b, c]`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue