diff options
| author | Ben Blum <bblum@andrew.cmu.edu> | 2013-08-22 17:00:02 -0400 |
|---|---|---|
| committer | Ben Blum <bblum@andrew.cmu.edu> | 2013-08-23 17:24:14 -0400 |
| commit | e9f6f3f2ccf563b39f7484025c8272da60c24dfa (patch) | |
| tree | 42e2f6b59b1972cbfe75ec69d14aa97fbbb478a9 /src/libsyntax/parse/token.rs | |
| parent | 2c0f9bd35493def5e23f0f43ddeba54da9d788b4 (diff) | |
| download | rust-e9f6f3f2ccf563b39f7484025c8272da60c24dfa.tar.gz rust-e9f6f3f2ccf563b39f7484025c8272da60c24dfa.zip | |
Parse and reserve typeof keyword. #3228
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 0d7def84003..8128a4e905c 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -478,6 +478,7 @@ fn mk_fresh_ident_interner() -> @ident_interner { "be", // 64 "pure", // 65 "yield", // 66 + "typeof", // 67 ]; @ident_interner { @@ -595,6 +596,7 @@ pub mod keywords { True, Trait, Type, + Typeof, Unsafe, Use, While, @@ -639,6 +641,7 @@ pub mod keywords { True => ident { name: 57, ctxt: 0 }, Trait => ident { name: 58, ctxt: 0 }, Type => ident { name: 59, ctxt: 0 }, + Typeof => ident { name: 67, ctxt: 0 }, Unsafe => ident { name: 60, ctxt: 0 }, Use => ident { name: 61, ctxt: 0 }, While => ident { name: 62, ctxt: 0 }, @@ -660,7 +663,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 | 27 | 32 .. 66 => true, + 8 | 27 | 32 .. 67 => true, _ => false, }, _ => false @@ -680,7 +683,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 { - 64 .. 66 => true, + 64 .. 67 => true, _ => false, }, _ => false, |
