1
Fork 0

Add notes

This commit is contained in:
Jubilee Young 2021-01-06 12:31:34 -08:00
parent 6b98704df6
commit a7e808ed25

View file

@ -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]`.