From 85c42fba1291f1cc41fb7bfec63117895b394fc5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 4 Feb 2018 16:46:26 +0300 Subject: Support contextual tokens --- src/syntax_kinds.rs | 110 +++++++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 52 deletions(-) (limited to 'src/syntax_kinds.rs') diff --git a/src/syntax_kinds.rs b/src/syntax_kinds.rs index 22c615831..27bc1cafa 100644 --- a/src/syntax_kinds.rs +++ b/src/syntax_kinds.rs @@ -6,32 +6,6 @@ use tree::SyntaxInfo; /// The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT_DEF`. #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SyntaxKind { - USE_KW, - FN_KW, - STRUCT_KW, - ENUM_KW, - TRAIT_KW, - IMPL_KW, - TRUE_KW, - FALSE_KW, - AS_KW, - EXTERN_KW, - CRATE_KW, - MOD_KW, - PUB_KW, - SELF_KW, - SUPER_KW, - IN_KW, - WHERE_KW, - FOR_KW, - LOOP_KW, - WHILE_KW, - IF_KW, - MATCH_KW, - CONST_KW, - STATIC_KW, - MUT_KW, - UNSAFE_KW, ERROR, IDENT, UNDERSCORE, @@ -83,6 +57,35 @@ pub enum SyntaxKind { COMMENT, DOC_COMMENT, SHEBANG, + USE_KW, + FN_KW, + STRUCT_KW, + ENUM_KW, + TRAIT_KW, + IMPL_KW, + TRUE_KW, + FALSE_KW, + AS_KW, + EXTERN_KW, + CRATE_KW, + MOD_KW, + PUB_KW, + SELF_KW, + SUPER_KW, + IN_KW, + WHERE_KW, + FOR_KW, + LOOP_KW, + WHILE_KW, + IF_KW, + MATCH_KW, + CONST_KW, + STATIC_KW, + MUT_KW, + UNSAFE_KW, + AUTO_KW, + DEFAULT_KW, + UNION_KW, FILE, STRUCT_ITEM, ENUM_ITEM, @@ -123,32 +126,6 @@ pub(crate) use self::SyntaxKind::*; impl SyntaxKind { pub(crate) fn info(self) -> &'static SyntaxInfo { match self { - USE_KW => &SyntaxInfo { name: "USE_KW" }, - FN_KW => &SyntaxInfo { name: "FN_KW" }, - STRUCT_KW => &SyntaxInfo { name: "STRUCT_KW" }, - ENUM_KW => &SyntaxInfo { name: "ENUM_KW" }, - TRAIT_KW => &SyntaxInfo { name: "TRAIT_KW" }, - IMPL_KW => &SyntaxInfo { name: "IMPL_KW" }, - TRUE_KW => &SyntaxInfo { name: "TRUE_KW" }, - FALSE_KW => &SyntaxInfo { name: "FALSE_KW" }, - AS_KW => &SyntaxInfo { name: "AS_KW" }, - EXTERN_KW => &SyntaxInfo { name: "EXTERN_KW" }, - CRATE_KW => &SyntaxInfo { name: "CRATE_KW" }, - MOD_KW => &SyntaxInfo { name: "MOD_KW" }, - PUB_KW => &SyntaxInfo { name: "PUB_KW" }, - SELF_KW => &SyntaxInfo { name: "SELF_KW" }, - SUPER_KW => &SyntaxInfo { name: "SUPER_KW" }, - IN_KW => &SyntaxInfo { name: "IN_KW" }, - WHERE_KW => &SyntaxInfo { name: "WHERE_KW" }, - FOR_KW => &SyntaxInfo { name: "FOR_KW" }, - LOOP_KW => &SyntaxInfo { name: "LOOP_KW" }, - WHILE_KW => &SyntaxInfo { name: "WHILE_KW" }, - IF_KW => &SyntaxInfo { name: "IF_KW" }, - MATCH_KW => &SyntaxInfo { name: "MATCH_KW" }, - CONST_KW => &SyntaxInfo { name: "CONST_KW" }, - STATIC_KW => &SyntaxInfo { name: "STATIC_KW" }, - MUT_KW => &SyntaxInfo { name: "MUT_KW" }, - UNSAFE_KW => &SyntaxInfo { name: "UNSAFE_KW" }, ERROR => &SyntaxInfo { name: "ERROR" }, IDENT => &SyntaxInfo { name: "IDENT" }, UNDERSCORE => &SyntaxInfo { name: "UNDERSCORE" }, @@ -200,6 +177,35 @@ impl SyntaxKind { COMMENT => &SyntaxInfo { name: "COMMENT" }, DOC_COMMENT => &SyntaxInfo { name: "DOC_COMMENT" }, SHEBANG => &SyntaxInfo { name: "SHEBANG" }, + USE_KW => &SyntaxInfo { name: "USE_KW" }, + FN_KW => &SyntaxInfo { name: "FN_KW" }, + STRUCT_KW => &SyntaxInfo { name: "STRUCT_KW" }, + ENUM_KW => &SyntaxInfo { name: "ENUM_KW" }, + TRAIT_KW => &SyntaxInfo { name: "TRAIT_KW" }, + IMPL_KW => &SyntaxInfo { name: "IMPL_KW" }, + TRUE_KW => &SyntaxInfo { name: "TRUE_KW" }, + FALSE_KW => &SyntaxInfo { name: "FALSE_KW" }, + AS_KW => &SyntaxInfo { name: "AS_KW" }, + EXTERN_KW => &SyntaxInfo { name: "EXTERN_KW" }, + CRATE_KW => &SyntaxInfo { name: "CRATE_KW" }, + MOD_KW => &SyntaxInfo { name: "MOD_KW" }, + PUB_KW => &SyntaxInfo { name: "PUB_KW" }, + SELF_KW => &SyntaxInfo { name: "SELF_KW" }, + SUPER_KW => &SyntaxInfo { name: "SUPER_KW" }, + IN_KW => &SyntaxInfo { name: "IN_KW" }, + WHERE_KW => &SyntaxInfo { name: "WHERE_KW" }, + FOR_KW => &SyntaxInfo { name: "FOR_KW" }, + LOOP_KW => &SyntaxInfo { name: "LOOP_KW" }, + WHILE_KW => &SyntaxInfo { name: "WHILE_KW" }, + IF_KW => &SyntaxInfo { name: "IF_KW" }, + MATCH_KW => &SyntaxInfo { name: "MATCH_KW" }, + CONST_KW => &SyntaxInfo { name: "CONST_KW" }, + STATIC_KW => &SyntaxInfo { name: "STATIC_KW" }, + MUT_KW => &SyntaxInfo { name: "MUT_KW" }, + UNSAFE_KW => &SyntaxInfo { name: "UNSAFE_KW" }, + AUTO_KW => &SyntaxInfo { name: "AUTO_KW" }, + DEFAULT_KW => &SyntaxInfo { name: "DEFAULT_KW" }, + UNION_KW => &SyntaxInfo { name: "UNION_KW" }, FILE => &SyntaxInfo { name: "FILE" }, STRUCT_ITEM => &SyntaxInfo { name: "STRUCT_ITEM" }, ENUM_ITEM => &SyntaxInfo { name: "ENUM_ITEM" }, -- cgit v1.2.3