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)]
pub enum RangeEnd {
/// `..=` or `...`
Included(RangeSyntax),
/// `..`
Excluded,
}
@ -687,6 +689,7 @@ pub enum RangeSyntax {
DotDotEq,
}
/// All the different flavors of pattern that Rust recognizes.
#[derive(Clone, Encodable, Decodable, Debug)]
pub enum PatKind {
/// Represents a wildcard pattern (`_`).
@ -727,7 +730,7 @@ pub enum PatKind {
/// A literal.
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>),
/// A slice pattern `[a, b, c]`.