about summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-01-23 04:58:15 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-01-23 06:49:06 +0000
commit49f5b0a8cf1a2d588a55f6cb8ea43942e147c66b (patch)
tree8c33f46a70291aaf165e913371c1728fa57c4040 /src/libsyntax/parse/token.rs
parent31417efcd3e739b48c1cf78214e8c4ff82dc424f (diff)
downloadrust-49f5b0a8cf1a2d588a55f6cb8ea43942e147c66b.tar.gz
rust-49f5b0a8cf1a2d588a55f6cb8ea43942e147c66b.zip
Remove `open_span` and `close_span` from `Delimited`.
Diffstat (limited to 'src/libsyntax/parse/token.rs')
-rw-r--r--src/libsyntax/parse/token.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 8ac39dd462e..bf790b96e37 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -49,6 +49,12 @@ pub enum DelimToken {
     NoDelim,
 }
 
+impl DelimToken {
+    pub fn len(&self) -> u32 {
+        if *self == NoDelim { 0 } else { 1 }
+    }
+}
+
 #[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)]
 pub enum Lit {
     Byte(ast::Name),