Skip to content

Commit

Permalink
syntax: Remove unused tokens
Browse files Browse the repository at this point in the history
TyDesc, TyVisitor and intrinsic are not used anymore.
  • Loading branch information
Blei committed Jun 23, 2013
1 parent 976c0b3 commit 1b76bac
Showing 1 changed file with 99 additions and 105 deletions.
204 changes: 99 additions & 105 deletions src/libsyntax/parse/token.rs
Expand Up @@ -331,21 +331,18 @@ pub mod special_idents {
pub static str : ident = ident { name: 19, ctxt: 0}; // for the type

/* outside of libsyntax */
pub static ty_visitor : ident = ident { name: 20, ctxt: 0};
pub static arg : ident = ident { name: 21, ctxt: 0};
pub static descrim : ident = ident { name: 22, ctxt: 0};
pub static clownshoe_abi : ident = ident { name: 23, ctxt: 0};
pub static clownshoe_stack_shim : ident = ident { name: 24, ctxt: 0};
pub static tydesc : ident = ident { name: 25, ctxt: 0};
pub static main : ident = ident { name: 26, ctxt: 0};
pub static opaque : ident = ident { name: 27, ctxt: 0};
pub static blk : ident = ident { name: 28, ctxt: 0};
pub static statik : ident = ident { name: 29, ctxt: 0};
pub static intrinsic : ident = ident { name: 30, ctxt: 0};
pub static clownshoes_foreign_mod: ident = ident { name: 31, ctxt: 0};
pub static unnamed_field: ident = ident { name: 32, ctxt: 0};
pub static c_abi: ident = ident { name: 33, ctxt: 0};
pub static type_self: ident = ident { name: 34, ctxt: 0}; // `Self`
pub static arg : ident = ident { name: 20, ctxt: 0};
pub static descrim : ident = ident { name: 21, ctxt: 0};
pub static clownshoe_abi : ident = ident { name: 22, ctxt: 0};
pub static clownshoe_stack_shim : ident = ident { name: 23, ctxt: 0};
pub static main : ident = ident { name: 24, ctxt: 0};
pub static opaque : ident = ident { name: 25, ctxt: 0};
pub static blk : ident = ident { name: 26, ctxt: 0};
pub static statik : ident = ident { name: 27, ctxt: 0};
pub static clownshoes_foreign_mod: ident = ident { name: 28, ctxt: 0};
pub static unnamed_field: ident = ident { name: 29, ctxt: 0};
pub static c_abi: ident = ident { name: 30, ctxt: 0};
pub static type_self: ident = ident { name: 31, ctxt: 0}; // `Self`
}

/**
Expand Down Expand Up @@ -426,59 +423,56 @@ fn mk_fresh_ident_interner() -> @ident_interner {
"tt", // 17
"matchers", // 18
"str", // 19
"TyVisitor", // 20
"arg", // 21
"descrim", // 22
"__rust_abi", // 23
"__rust_stack_shim", // 24
"TyDesc", // 25
"main", // 26
"<opaque>", // 27
"blk", // 28
"static", // 29
"intrinsic", // 30
"__foreign_mod__", // 31
"__field__", // 32
"C", // 33
"Self", // 34

"as", // 35
"break", // 36
"const", // 37
"copy", // 38
"do", // 39
"else", // 40
"enum", // 41
"extern", // 42
"false", // 43
"fn", // 44
"for", // 45
"if", // 46
"impl", // 47
"let", // 48
"__log", // 49
"loop", // 50
"match", // 51
"mod", // 52
"mut", // 53
"once", // 54
"priv", // 55
"pub", // 56
"pure", // 57
"ref", // 58
"return", // 59
"static", // 29 -- also a special ident
"arg", // 20
"descrim", // 21
"__rust_abi", // 22
"__rust_stack_shim", // 23
"main", // 24
"<opaque>", // 25
"blk", // 26
"static", // 27
"__foreign_mod__", // 28
"__field__", // 29
"C", // 30
"Self", // 31

"as", // 32
"break", // 33
"const", // 34
"copy", // 35
"do", // 36
"else", // 37
"enum", // 38
"extern", // 39
"false", // 40
"fn", // 41
"for", // 42
"if", // 43
"impl", // 44
"let", // 45
"__log", // 46
"loop", // 47
"match", // 48
"mod", // 49
"mut", // 50
"once", // 51
"priv", // 52
"pub", // 53
"pure", // 54
"ref", // 55
"return", // 56
"static", // 27 -- also a special ident
"self", // 8 -- also a special ident
"struct", // 60
"super", // 61
"true", // 62
"trait", // 63
"type", // 64
"unsafe", // 65
"use", // 66
"while", // 67

"be", // 68
"struct", // 57
"super", // 58
"true", // 59
"trait", // 60
"type", // 61
"unsafe", // 62
"use", // 63
"while", // 64

"be", // 65
];

@ident_interner {
Expand Down Expand Up @@ -612,42 +606,42 @@ pub mod keywords {
impl Keyword {
pub fn to_ident(&self) -> ident {
match *self {
As => ident { name: 35, ctxt: 0 },
Break => ident { name: 36, ctxt: 0 },
Const => ident { name: 37, ctxt: 0 },
Copy => ident { name: 38, ctxt: 0 },
Do => ident { name: 39, ctxt: 0 },
Else => ident { name: 40, ctxt: 0 },
Enum => ident { name: 41, ctxt: 0 },
Extern => ident { name: 42, ctxt: 0 },
False => ident { name: 43, ctxt: 0 },
Fn => ident { name: 44, ctxt: 0 },
For => ident { name: 45, ctxt: 0 },
If => ident { name: 46, ctxt: 0 },
Impl => ident { name: 47, ctxt: 0 },
Let => ident { name: 48, ctxt: 0 },
__Log => ident { name: 49, ctxt: 0 },
Loop => ident { name: 50, ctxt: 0 },
Match => ident { name: 51, ctxt: 0 },
Mod => ident { name: 52, ctxt: 0 },
Mut => ident { name: 53, ctxt: 0 },
Once => ident { name: 54, ctxt: 0 },
Priv => ident { name: 55, ctxt: 0 },
Pub => ident { name: 56, ctxt: 0 },
Pure => ident { name: 57, ctxt: 0 },
Ref => ident { name: 58, ctxt: 0 },
Return => ident { name: 59, ctxt: 0 },
Static => ident { name: 29, ctxt: 0 },
As => ident { name: 32, ctxt: 0 },
Break => ident { name: 33, ctxt: 0 },
Const => ident { name: 34, ctxt: 0 },
Copy => ident { name: 35, ctxt: 0 },
Do => ident { name: 36, ctxt: 0 },
Else => ident { name: 37, ctxt: 0 },
Enum => ident { name: 38, ctxt: 0 },
Extern => ident { name: 39, ctxt: 0 },
False => ident { name: 40, ctxt: 0 },
Fn => ident { name: 41, ctxt: 0 },
For => ident { name: 42, ctxt: 0 },
If => ident { name: 43, ctxt: 0 },
Impl => ident { name: 44, ctxt: 0 },
Let => ident { name: 45, ctxt: 0 },
__Log => ident { name: 46, ctxt: 0 },
Loop => ident { name: 47, ctxt: 0 },
Match => ident { name: 48, ctxt: 0 },
Mod => ident { name: 49, ctxt: 0 },
Mut => ident { name: 50, ctxt: 0 },
Once => ident { name: 51, ctxt: 0 },
Priv => ident { name: 52, ctxt: 0 },
Pub => ident { name: 53, ctxt: 0 },
Pure => ident { name: 54, ctxt: 0 },
Ref => ident { name: 55, ctxt: 0 },
Return => ident { name: 56, ctxt: 0 },
Static => ident { name: 27, ctxt: 0 },
Self => ident { name: 8, ctxt: 0 },
Struct => ident { name: 60, ctxt: 0 },
Super => ident { name: 61, ctxt: 0 },
True => ident { name: 62, ctxt: 0 },
Trait => ident { name: 63, ctxt: 0 },
Type => ident { name: 64, ctxt: 0 },
Unsafe => ident { name: 65, ctxt: 0 },
Use => ident { name: 66, ctxt: 0 },
While => ident { name: 67, ctxt: 0 },
Be => ident { name: 68, ctxt: 0 },
Struct => ident { name: 57, ctxt: 0 },
Super => ident { name: 58, ctxt: 0 },
True => ident { name: 59, ctxt: 0 },
Trait => ident { name: 60, ctxt: 0 },
Type => ident { name: 61, ctxt: 0 },
Unsafe => ident { name: 62, ctxt: 0 },
Use => ident { name: 63, ctxt: 0 },
While => ident { name: 64, ctxt: 0 },
Be => ident { name: 65, ctxt: 0 },
}
}
}
Expand All @@ -663,7 +657,7 @@ pub fn is_keyword(kw: keywords::Keyword, tok: &Token) -> bool {
pub fn is_any_keyword(tok: &Token) -> bool {
match *tok {
token::IDENT(sid, false) => match sid.name {
8 | 29 | 35 .. 68 => true,
8 | 27 | 32 .. 65 => true,
_ => false,
},
_ => false
Expand All @@ -673,7 +667,7 @@ pub fn is_any_keyword(tok: &Token) -> bool {
pub fn is_strict_keyword(tok: &Token) -> bool {
match *tok {
token::IDENT(sid, false) => match sid.name {
8 | 29 | 35 .. 67 => true,
8 | 27 | 32 .. 64 => true,
_ => false,
},
_ => false,
Expand All @@ -683,7 +677,7 @@ pub fn is_strict_keyword(tok: &Token) -> bool {
pub fn is_reserved_keyword(tok: &Token) -> bool {
match *tok {
token::IDENT(sid, false) => match sid.name {
68 => true,
65 => true,
_ => false,
},
_ => false,
Expand Down

0 comments on commit 1b76bac

Please sign in to comment.