diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-02-08 06:02:35 -0800 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-02-08 06:02:35 -0800 |
| commit | 14930fbffe95971e9258cb2eb45a1642eb735bbe (patch) | |
| tree | 605f9182243b7979f5d334a51b2733d08e0d14d4 /src/libsyntax/parse/token.rs | |
| parent | bc1fb62c343639f9ac66cb0017b8c1813d5e06a7 (diff) | |
| download | rust-14930fbffe95971e9258cb2eb45a1642eb735bbe.tar.gz rust-14930fbffe95971e9258cb2eb45a1642eb735bbe.zip | |
Add and lex LIFETIME tokens
cc #4846
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 2770d823bf3..49de7264d2c 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -88,6 +88,7 @@ pub enum Token { /* Name components */ IDENT(ast::ident, bool), UNDERSCORE, + LIFETIME(ast::ident), /* For interpolation */ INTERPOLATED(nonterminal), @@ -193,7 +194,7 @@ pub fn to_str(in: @ident_interner, t: Token) -> ~str { /* Name components */ IDENT(s, _) => *in.get(s), - + LIFETIME(s) => fmt!("'%s", *in.get(s)), UNDERSCORE => ~"_", /* Other */ @@ -760,6 +761,12 @@ impl Token : cmp::Eq { _ => false } } + LIFETIME(e0a) => { + match (*other) { + LIFETIME(e0b) => e0a == e0b, + _ => false + } + } UNDERSCORE => { match (*other) { UNDERSCORE => true, |
