Add information about the syntax used in ranges
... or ..=
This commit is contained in:
@@ -538,10 +538,16 @@ pub enum BindingMode {
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
||||
pub enum RangeEnd {
|
||||
Included,
|
||||
Included(RangeSyntax),
|
||||
Excluded,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
||||
pub enum RangeSyntax {
|
||||
DotDotDot,
|
||||
DotDotEq,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
||||
pub enum PatKind {
|
||||
/// Represents a wildcard pattern (`_`)
|
||||
@@ -578,7 +584,7 @@ pub enum PatKind {
|
||||
Ref(P<Pat>, Mutability),
|
||||
/// A literal
|
||||
Lit(P<Expr>),
|
||||
/// A range pattern, e.g. `1...2` or `1..2`
|
||||
/// A range pattern, e.g. `1...2`, `1..=2` or `1..2`
|
||||
Range(P<Expr>, P<Expr>, RangeEnd),
|
||||
/// `[a, b, ..i, y, z]` is represented as:
|
||||
/// `PatKind::Slice(box [a, b], Some(i), box [y, z])`
|
||||
|
||||
Reference in New Issue
Block a user