AST refactoring: merge PatWild and PatWildMulti into one variant with a flag.

This commit is contained in:
Felix S. Klock II 2014-08-06 17:04:44 +02:00
parent b09a02b415
commit d3202354f5
20 changed files with 42 additions and 36 deletions

View file

@ -324,9 +324,19 @@ pub enum BindingMode {
}
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
pub enum Pat_ {
PatWild,
pub enum PatWildKind {
/// Represents the wildcard pattern `_`
PatWildSingle,
/// Represents the wildcard pattern `..`
PatWildMulti,
}
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
pub enum Pat_ {
/// Represents a wildcard pattern (either `_` or `..`)
PatWild(PatWildKind),
/// A PatIdent may either be a new bound variable,
/// or a nullary enum (in which case the third field
/// is None).