about summary refs log tree commit diff
path: root/src/libsyntax_pos
diff options
context:
space:
mode:
authorpetrochenkov <vadim.petrochenkov@gmail.com>2017-06-29 13:16:35 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-06-29 15:19:53 +0300
commitb33fd6d75966411c3934cd6bde07bb1a653b2d83 (patch)
tree99da762fe26f23fef6f73a6a2b6302b6569c52da /src/libsyntax_pos
parente03948ef3e19ff90066ca366bf76c390d7a42bc5 (diff)
downloadrust-b33fd6d75966411c3934cd6bde07bb1a653b2d83.tar.gz
rust-b33fd6d75966411c3934cd6bde07bb1a653b2d83.zip
Change some terminology around keywords and reserved identifiers
Diffstat (limited to 'src/libsyntax_pos')
-rw-r--r--src/libsyntax_pos/symbol.rs127
1 files changed, 63 insertions, 64 deletions
diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs
index 5e2e448f741..debac70545a 100644
--- a/src/libsyntax_pos/symbol.rs
+++ b/src/libsyntax_pos/symbol.rs
@@ -237,77 +237,76 @@ macro_rules! declare_keywords {(
 // NB: leaving holes in the ident table is bad! a different ident will get
 // interned with the id from the hole, but it will be between the min and max
 // of the reserved words, and thus tagged as "reserved".
-// After modifying this list adjust `is_strict_keyword`/`is_reserved_keyword`,
+// After modifying this list adjust `is_special_ident`, `is_used_keyword`/`is_unused_keyword`,
 // this should be rarely necessary though if the keywords are kept in alphabetic order.
 declare_keywords! {
-    // Invalid identifier
+    // Special reserved identifiers used internally for elided lifetimes,
+    // unnamed method parameters, crate root module, error recovery etc.
     (0,  Invalid,        "")
-
-    // Strict keywords used in the language.
-    (1,  As,             "as")
-    (2,  Box,            "box")
-    (3,  Break,          "break")
-    (4,  Const,          "const")
-    (5,  Continue,       "continue")
-    (6,  Crate,          "crate")
-    (7,  DollarCrate,    "$crate")
-    (8,  Else,           "else")
-    (9,  Enum,           "enum")
-    (10, Extern,         "extern")
-    (11, False,          "false")
-    (12, Fn,             "fn")
-    (13, For,            "for")
-    (14, If,             "if")
-    (15, Impl,           "impl")
-    (16, In,             "in")
-    (17, Let,            "let")
-    (18, Loop,           "loop")
-    (19, Match,          "match")
-    (20, Mod,            "mod")
-    (21, Move,           "move")
-    (22, Mut,            "mut")
-    (23, Pub,            "pub")
-    (24, Ref,            "ref")
-    (25, Return,         "return")
-    (26, SelfValue,      "self")
-    (27, SelfType,       "Self")
-    (28, Static,         "static")
-    (29, Struct,         "struct")
-    (30, Super,          "super")
-    (31, Trait,          "trait")
-    (32, True,           "true")
-    (33, Type,           "type")
-    (34, Unsafe,         "unsafe")
-    (35, Use,            "use")
-    (36, Where,          "where")
-    (37, While,          "while")
+    (1,  CrateRoot,      "{{root}}")
+    (2,  DollarCrate,    "$crate")
+
+    // Keywords used in the language.
+    (3,  As,             "as")
+    (4,  Box,            "box")
+    (5,  Break,          "break")
+    (6,  Const,          "const")
+    (7,  Continue,       "continue")
+    (8,  Crate,          "crate")
+    (9,  Else,           "else")
+    (10, Enum,           "enum")
+    (11, Extern,         "extern")
+    (12, False,          "false")
+    (13, Fn,             "fn")
+    (14, For,            "for")
+    (15, If,             "if")
+    (16, Impl,           "impl")
+    (17, In,             "in")
+    (18, Let,            "let")
+    (19, Loop,           "loop")
+    (20, Match,          "match")
+    (21, Mod,            "mod")
+    (22, Move,           "move")
+    (23, Mut,            "mut")
+    (24, Pub,            "pub")
+    (25, Ref,            "ref")
+    (26, Return,         "return")
+    (27, SelfValue,      "self")
+    (28, SelfType,       "Self")
+    (29, Static,         "static")
+    (30, Struct,         "struct")
+    (31, Super,          "super")
+    (32, Trait,          "trait")
+    (33, True,           "true")
+    (34, Type,           "type")
+    (35, Unsafe,         "unsafe")
+    (36, Use,            "use")
+    (37, Where,          "where")
+    (38, While,          "while")
 
     // Keywords reserved for future use.
-    (38, Abstract,       "abstract")
-    (39, Alignof,        "alignof")
-    (40, Become,         "become")
-    (41, Do,             "do")
-    (42, Final,          "final")
-    (43, Macro,          "macro")
-    (44, Offsetof,       "offsetof")
-    (45, Override,       "override")
-    (46, Priv,           "priv")
-    (47, Proc,           "proc")
-    (48, Pure,           "pure")
-    (49, Sizeof,         "sizeof")
-    (50, Typeof,         "typeof")
-    (51, Unsized,        "unsized")
-    (52, Virtual,        "virtual")
-    (53, Yield,          "yield")
+    (39, Abstract,       "abstract")
+    (40, Alignof,        "alignof")
+    (41, Become,         "become")
+    (42, Do,             "do")
+    (43, Final,          "final")
+    (44, Macro,          "macro")
+    (45, Offsetof,       "offsetof")
+    (46, Override,       "override")
+    (47, Priv,           "priv")
+    (48, Proc,           "proc")
+    (49, Pure,           "pure")
+    (50, Sizeof,         "sizeof")
+    (51, Typeof,         "typeof")
+    (52, Unsized,        "unsized")
+    (53, Virtual,        "virtual")
+    (54, Yield,          "yield")
 
     // Weak keywords, have special meaning only in specific contexts.
-    (54, Default,        "default")
-    (55, StaticLifetime, "'static")
-    (56, Union,          "union")
-    (57, Catch,          "catch")
-
-    // A virtual keyword that resolves to the crate root when used in a lexical scope.
-    (58, CrateRoot,      "{{root}}")
+    (55, Default,        "default")
+    (56, StaticLifetime, "'static")
+    (57, Union,          "union")
+    (58, Catch,          "catch")
 }
 
 // If an interner exists in TLS, return it. Otherwise, prepare a fresh one.