diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-09-19 11:06:50 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-09-19 11:44:05 -0700 |
| commit | 0c82c00dc4f49aeb9b57c92c9a40ae35d8a1ee29 (patch) | |
| tree | f0b2ccdd691ebf73ca2f5e676aaceb058d109463 /src/libsyntax/parse/token.rs | |
| parent | 76f8cfb26c7aa38cf066c42ea500a57d48fc828d (diff) | |
| download | rust-0c82c00dc4f49aeb9b57c92c9a40ae35d8a1ee29.tar.gz rust-0c82c00dc4f49aeb9b57c92c9a40ae35d8a1ee29.zip | |
libsyntax: Remove the restricted keyword concept
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index f9c50e46264..c7ecc5ae548 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -362,20 +362,17 @@ fn mk_fake_ident_interner() -> ident_interner { /** * All the valid words that have meaning in the Rust language. * - * Rust keywords are either 'temporary', 'restricted', or 'strict'. Temporary + * Rust keywords are either 'temporary', 'strict' or 'reserved'. Temporary * keywords are contextual and may be used as identifiers anywhere. They are - * expected to disappear from the grammar soon. Restricted keywords may not - * appear in positions that might otherwise contain _value identifiers_. - * Strict keywords may not appear as identifiers at all. + * expected to disappear from the grammar soon. Strict keywords may not + * appear as identifiers at all. Reserved keywords are not used anywhere in + * the language and may not appear as identifiers. */ fn keyword_table() -> HashMap<~str, ()> { let keywords = str_hash(); for temporary_keyword_table().each_key |word| { keywords.insert(word, ()); } - for restricted_keyword_table().each_key |word| { - keywords.insert(word, ()); - } for strict_keyword_table().each_key |word| { keywords.insert(word, ()); } @@ -397,30 +394,6 @@ fn temporary_keyword_table() -> HashMap<~str, ()> { words } -/** - * Keywords that may not appear in any position that might otherwise contain a - * _value identifier_. Restricted keywords may still be used as other types of - * identifiers. - * - * Reasons: - * - * * For some (most?), if used at the start of a line, they will cause the - * line to be interpreted as a specific kind of statement, which would be - * confusing. - * - * * `true` or `false` as identifiers would always be shadowed by - * the boolean constants - */ -fn restricted_keyword_table() -> HashMap<~str, ()> { - let words = str_hash(); - let keys = ~[ - ]; - for keys.each |word| { - words.insert(word, ()); - } - words -} - /// Full keywords. May not appear anywhere else. fn strict_keyword_table() -> HashMap<~str, ()> { let words = str_hash(); |
