about summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2014-08-06 17:04:44 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2014-08-06 17:04:44 +0200
commitd3202354f5fe3860c429adc4bab6e6dc88ee83bc (patch)
tree04140f380a93c58864e9d84503f7aad3ea6a2985 /src/libsyntax/ast.rs
parentb09a02b41588b2348fcce89c37c4a2cdc614d350 (diff)
downloadrust-d3202354f5fe3860c429adc4bab6e6dc88ee83bc.tar.gz
rust-d3202354f5fe3860c429adc4bab6e6dc88ee83bc.zip
AST refactoring: merge PatWild and PatWildMulti into one variant with a flag.
Diffstat (limited to 'src/libsyntax/ast.rs')
-rw-r--r--src/libsyntax/ast.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 19882fecaa9..2d39a47a85e 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -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).