parent
bc1fb62c34
commit
14930fbffe
3 changed files with 90 additions and 22 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue