diff --git a/crates/libeditor/src/lib.rs b/crates/libeditor/src/lib.rs index a83fb7d1788..df0938e90ee 100644 --- a/crates/libeditor/src/lib.rs +++ b/crates/libeditor/src/lib.rs @@ -141,7 +141,7 @@ pub fn runnables(file: &ast::File) -> Vec { impl<'f> Declaration<'f> { fn cast(node: SyntaxNodeRef<'f>) -> Option> { match node.kind() { - | STRUCT | ENUM_ITEM | FUNCTION | TRAIT_ITEM + | STRUCT | ENUM | FUNCTION | TRAIT_ITEM | CONST_ITEM | STATIC_ITEM | MOD_ITEM | NAMED_FIELD | TYPE_ITEM => Some(Declaration(node)), _ => None diff --git a/crates/libsyntax2/src/grammar.ron b/crates/libsyntax2/src/grammar.ron index 4d034374748..06a4eb6a7ea 100644 --- a/crates/libsyntax2/src/grammar.ron +++ b/crates/libsyntax2/src/grammar.ron @@ -109,7 +109,7 @@ Grammar( "FILE", "STRUCT", - "ENUM_ITEM", + "ENUM", "FUNCTION", "EXTERN_CRATE_ITEM", "MOD_ITEM", diff --git a/crates/libsyntax2/src/grammar/items/mod.rs b/crates/libsyntax2/src/grammar/items/mod.rs index 1125daed953..be4ff976a7c 100644 --- a/crates/libsyntax2/src/grammar/items/mod.rs +++ b/crates/libsyntax2/src/grammar/items/mod.rs @@ -175,7 +175,7 @@ fn items_without_modifiers(p: &mut Parser) -> Option { } ENUM_KW => { structs::enum_item(p); - ENUM_ITEM + ENUM } USE_KW => { use_item::use_item(p); diff --git a/crates/libsyntax2/src/syntax_kinds/generated.rs b/crates/libsyntax2/src/syntax_kinds/generated.rs index 7e7d00d9db7..7d2fb60f6c1 100644 --- a/crates/libsyntax2/src/syntax_kinds/generated.rs +++ b/crates/libsyntax2/src/syntax_kinds/generated.rs @@ -109,7 +109,7 @@ pub enum SyntaxKind { SHEBANG, FILE, STRUCT, - ENUM_ITEM, + ENUM, FUNCTION, EXTERN_CRATE_ITEM, MOD_ITEM, @@ -344,7 +344,7 @@ pub(crate) fn info(self) -> &'static SyntaxInfo { SHEBANG => &SyntaxInfo { name: "SHEBANG" }, FILE => &SyntaxInfo { name: "FILE" }, STRUCT => &SyntaxInfo { name: "STRUCT" }, - ENUM_ITEM => &SyntaxInfo { name: "ENUM_ITEM" }, + ENUM => &SyntaxInfo { name: "ENUM" }, FUNCTION => &SyntaxInfo { name: "FUNCTION" }, EXTERN_CRATE_ITEM => &SyntaxInfo { name: "EXTERN_CRATE_ITEM" }, MOD_ITEM => &SyntaxInfo { name: "MOD_ITEM" }, diff --git a/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt b/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt index 8650381cd11..0ddf7eb9d6d 100644 --- a/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt +++ b/crates/libsyntax2/tests/data/parser/ok/0019_enums.txt @@ -1,5 +1,5 @@ FILE@[0; 182) - ENUM_ITEM@[0; 11) + ENUM@[0; 11) ENUM_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 7) @@ -9,7 +9,7 @@ FILE@[0; 182) WHITESPACE@[9; 10) R_CURLY@[10; 11) WHITESPACE@[11; 13) - ENUM_ITEM@[13; 27) + ENUM@[13; 27) ENUM_KW@[13; 17) WHITESPACE@[17; 18) NAME@[18; 20) @@ -25,7 +25,7 @@ FILE@[0; 182) WHITESPACE@[25; 26) R_CURLY@[26; 27) WHITESPACE@[27; 29) - ENUM_ITEM@[29; 46) + ENUM@[29; 46) ENUM_KW@[29; 33) WHITESPACE@[33; 34) NAME@[34; 36) @@ -39,7 +39,7 @@ FILE@[0; 182) WHITESPACE@[44; 45) R_CURLY@[45; 46) WHITESPACE@[46; 48) - ENUM_ITEM@[48; 66) + ENUM@[48; 66) ENUM_KW@[48; 52) WHITESPACE@[52; 53) NAME@[53; 55) @@ -54,7 +54,7 @@ FILE@[0; 182) WHITESPACE@[64; 65) R_CURLY@[65; 66) WHITESPACE@[66; 68) - ENUM_ITEM@[68; 181) + ENUM@[68; 181) ENUM_KW@[68; 72) WHITESPACE@[72; 73) NAME@[73; 75)