From 084bd304f304e674fc3d5b132daf8a9f975064c9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 3 Jan 2020 20:37:02 +0100 Subject: Switch ast declaration from ron to a macro --- crates/ra_parser/src/syntax_kind/generated.rs | 270 +++++++++++++------------- 1 file changed, 135 insertions(+), 135 deletions(-) (limited to 'crates/ra_parser/src') diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index af2945f57..262c545e4 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs @@ -61,46 +61,46 @@ pub enum SyntaxKind { SHR, SHLEQ, SHREQ, + AS_KW, ASYNC_KW, - USE_KW, - FN_KW, - STRUCT_KW, - ENUM_KW, - TRAIT_KW, - IMPL_KW, + AWAIT_KW, + BOX_KW, + BREAK_KW, + CONST_KW, + CONTINUE_KW, + CRATE_KW, DYN_KW, - TRUE_KW, - FALSE_KW, - AS_KW, + ELSE_KW, + ENUM_KW, EXTERN_KW, - CRATE_KW, - MOD_KW, - PUB_KW, - SELF_KW, - SUPER_KW, - IN_KW, - WHERE_KW, + FALSE_KW, + FN_KW, FOR_KW, - LOOP_KW, - WHILE_KW, - CONTINUE_KW, - BREAK_KW, IF_KW, - ELSE_KW, + IMPL_KW, + IN_KW, + LET_KW, + LOOP_KW, + MACRO_KW, MATCH_KW, - CONST_KW, - STATIC_KW, + MOD_KW, + MOVE_KW, MUT_KW, - UNSAFE_KW, - TYPE_KW, + PUB_KW, REF_KW, - LET_KW, - MOVE_KW, RETURN_KW, + SELF_KW, + STATIC_KW, + STRUCT_KW, + SUPER_KW, + TRAIT_KW, + TRUE_KW, TRY_KW, - BOX_KW, - AWAIT_KW, - MACRO_KW, + TYPE_KW, + UNSAFE_KW, + USE_KW, + WHERE_KW, + WHILE_KW, AUTO_KW, DEFAULT_KW, EXISTENTIAL_KW, @@ -249,12 +249,12 @@ use self::SyntaxKind::*; impl SyntaxKind { pub fn is_keyword(self) -> bool { match self { - ASYNC_KW | USE_KW | FN_KW | STRUCT_KW | ENUM_KW | TRAIT_KW | IMPL_KW | DYN_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 | CONTINUE_KW - | BREAK_KW | IF_KW | ELSE_KW | MATCH_KW | CONST_KW | STATIC_KW | MUT_KW | UNSAFE_KW - | TYPE_KW | REF_KW | LET_KW | MOVE_KW | RETURN_KW | TRY_KW | BOX_KW | AWAIT_KW - | MACRO_KW | AUTO_KW | DEFAULT_KW | EXISTENTIAL_KW | UNION_KW => true, + AS_KW | ASYNC_KW | AWAIT_KW | BOX_KW | BREAK_KW | CONST_KW | CONTINUE_KW | CRATE_KW + | DYN_KW | ELSE_KW | ENUM_KW | EXTERN_KW | FALSE_KW | FN_KW | FOR_KW | IF_KW + | IMPL_KW | IN_KW | LET_KW | LOOP_KW | MACRO_KW | MATCH_KW | MOD_KW | MOVE_KW + | MUT_KW | PUB_KW | REF_KW | RETURN_KW | SELF_KW | STATIC_KW | STRUCT_KW | SUPER_KW + | TRAIT_KW | TRUE_KW | TRY_KW | TYPE_KW | UNSAFE_KW | USE_KW | WHERE_KW | WHILE_KW + | AUTO_KW | DEFAULT_KW | EXISTENTIAL_KW | UNION_KW => true, _ => false, } } @@ -278,46 +278,46 @@ impl SyntaxKind { } pub fn from_keyword(ident: &str) -> Option { let kw = match ident { + "as" => AS_KW, "async" => ASYNC_KW, - "use" => USE_KW, - "fn" => FN_KW, - "struct" => STRUCT_KW, - "enum" => ENUM_KW, - "trait" => TRAIT_KW, - "impl" => IMPL_KW, + "await" => AWAIT_KW, + "box" => BOX_KW, + "break" => BREAK_KW, + "const" => CONST_KW, + "continue" => CONTINUE_KW, + "crate" => CRATE_KW, "dyn" => DYN_KW, - "true" => TRUE_KW, - "false" => FALSE_KW, - "as" => AS_KW, + "else" => ELSE_KW, + "enum" => ENUM_KW, "extern" => EXTERN_KW, - "crate" => CRATE_KW, - "mod" => MOD_KW, - "pub" => PUB_KW, - "self" => SELF_KW, - "super" => SUPER_KW, - "in" => IN_KW, - "where" => WHERE_KW, + "false" => FALSE_KW, + "fn" => FN_KW, "for" => FOR_KW, - "loop" => LOOP_KW, - "while" => WHILE_KW, - "continue" => CONTINUE_KW, - "break" => BREAK_KW, "if" => IF_KW, - "else" => ELSE_KW, + "impl" => IMPL_KW, + "in" => IN_KW, + "let" => LET_KW, + "loop" => LOOP_KW, + "macro" => MACRO_KW, "match" => MATCH_KW, - "const" => CONST_KW, - "static" => STATIC_KW, + "mod" => MOD_KW, + "move" => MOVE_KW, "mut" => MUT_KW, - "unsafe" => UNSAFE_KW, - "type" => TYPE_KW, + "pub" => PUB_KW, "ref" => REF_KW, - "let" => LET_KW, - "move" => MOVE_KW, "return" => RETURN_KW, + "self" => SELF_KW, + "static" => STATIC_KW, + "struct" => STRUCT_KW, + "super" => SUPER_KW, + "trait" => TRAIT_KW, + "true" => TRUE_KW, "try" => TRY_KW, - "box" => BOX_KW, - "await" => AWAIT_KW, - "macro" => MACRO_KW, + "type" => TYPE_KW, + "unsafe" => UNSAFE_KW, + "use" => USE_KW, + "where" => WHERE_KW, + "while" => WHILE_KW, _ => return None, }; Some(kw) @@ -515,125 +515,125 @@ macro_rules! T { ( >>= ) => { $crate::SyntaxKind::SHREQ }; + ( as ) => { + $crate::SyntaxKind::AS_KW + }; ( async ) => { $crate::SyntaxKind::ASYNC_KW }; - ( use ) => { - $crate::SyntaxKind::USE_KW + ( await ) => { + $crate::SyntaxKind::AWAIT_KW }; - ( fn ) => { - $crate::SyntaxKind::FN_KW + ( box ) => { + $crate::SyntaxKind::BOX_KW }; - ( struct ) => { - $crate::SyntaxKind::STRUCT_KW + ( break ) => { + $crate::SyntaxKind::BREAK_KW }; - ( enum ) => { - $crate::SyntaxKind::ENUM_KW + ( const ) => { + $crate::SyntaxKind::CONST_KW }; - ( trait ) => { - $crate::SyntaxKind::TRAIT_KW + ( continue ) => { + $crate::SyntaxKind::CONTINUE_KW }; - ( impl ) => { - $crate::SyntaxKind::IMPL_KW + ( crate ) => { + $crate::SyntaxKind::CRATE_KW }; ( dyn ) => { $crate::SyntaxKind::DYN_KW }; - ( true ) => { - $crate::SyntaxKind::TRUE_KW - }; - ( false ) => { - $crate::SyntaxKind::FALSE_KW + ( else ) => { + $crate::SyntaxKind::ELSE_KW }; - ( as ) => { - $crate::SyntaxKind::AS_KW + ( enum ) => { + $crate::SyntaxKind::ENUM_KW }; ( extern ) => { $crate::SyntaxKind::EXTERN_KW }; - ( crate ) => { - $crate::SyntaxKind::CRATE_KW + ( false ) => { + $crate::SyntaxKind::FALSE_KW }; - ( mod ) => { - $crate::SyntaxKind::MOD_KW + ( fn ) => { + $crate::SyntaxKind::FN_KW }; - ( pub ) => { - $crate::SyntaxKind::PUB_KW + ( for ) => { + $crate::SyntaxKind::FOR_KW }; - ( self ) => { - $crate::SyntaxKind::SELF_KW + ( if ) => { + $crate::SyntaxKind::IF_KW }; - ( super ) => { - $crate::SyntaxKind::SUPER_KW + ( impl ) => { + $crate::SyntaxKind::IMPL_KW }; ( in ) => { $crate::SyntaxKind::IN_KW }; - ( where ) => { - $crate::SyntaxKind::WHERE_KW - }; - ( for ) => { - $crate::SyntaxKind::FOR_KW + ( let ) => { + $crate::SyntaxKind::LET_KW }; ( loop ) => { $crate::SyntaxKind::LOOP_KW }; - ( while ) => { - $crate::SyntaxKind::WHILE_KW - }; - ( continue ) => { - $crate::SyntaxKind::CONTINUE_KW - }; - ( break ) => { - $crate::SyntaxKind::BREAK_KW - }; - ( if ) => { - $crate::SyntaxKind::IF_KW - }; - ( else ) => { - $crate::SyntaxKind::ELSE_KW + ( macro ) => { + $crate::SyntaxKind::MACRO_KW }; ( match ) => { $crate::SyntaxKind::MATCH_KW }; - ( const ) => { - $crate::SyntaxKind::CONST_KW + ( mod ) => { + $crate::SyntaxKind::MOD_KW }; - ( static ) => { - $crate::SyntaxKind::STATIC_KW + ( move ) => { + $crate::SyntaxKind::MOVE_KW }; ( mut ) => { $crate::SyntaxKind::MUT_KW }; - ( unsafe ) => { - $crate::SyntaxKind::UNSAFE_KW - }; - ( type ) => { - $crate::SyntaxKind::TYPE_KW + ( pub ) => { + $crate::SyntaxKind::PUB_KW }; ( ref ) => { $crate::SyntaxKind::REF_KW }; - ( let ) => { - $crate::SyntaxKind::LET_KW - }; - ( move ) => { - $crate::SyntaxKind::MOVE_KW - }; ( return ) => { $crate::SyntaxKind::RETURN_KW }; + ( self ) => { + $crate::SyntaxKind::SELF_KW + }; + ( static ) => { + $crate::SyntaxKind::STATIC_KW + }; + ( struct ) => { + $crate::SyntaxKind::STRUCT_KW + }; + ( super ) => { + $crate::SyntaxKind::SUPER_KW + }; + ( trait ) => { + $crate::SyntaxKind::TRAIT_KW + }; + ( true ) => { + $crate::SyntaxKind::TRUE_KW + }; ( try ) => { $crate::SyntaxKind::TRY_KW }; - ( box ) => { - $crate::SyntaxKind::BOX_KW + ( type ) => { + $crate::SyntaxKind::TYPE_KW }; - ( await ) => { - $crate::SyntaxKind::AWAIT_KW + ( unsafe ) => { + $crate::SyntaxKind::UNSAFE_KW }; - ( macro ) => { - $crate::SyntaxKind::MACRO_KW + ( use ) => { + $crate::SyntaxKind::USE_KW + }; + ( where ) => { + $crate::SyntaxKind::WHERE_KW + }; + ( while ) => { + $crate::SyntaxKind::WHILE_KW }; ( auto ) => { $crate::SyntaxKind::AUTO_KW -- cgit v1.2.3