Repository: rust-analyzer/rust-analyzer
Pull request #3919 (2020-04-09 16:49:18)

Refactor tokena accessors
bors r+
🤖


Patch:
diff --git a/crates/ra_assists/src/handlers/add_explicit_type.rs b/crates/ra_assists/src/handlers/add_explicit_type.rs
index d86d804b2e..e7dcfb44e2 100644
--- a/crates/ra_assists/src/handlers/add_explicit_type.rs
+++ b/crates/ra_assists/src/handlers/add_explicit_type.rs
@@ -1,6 +1,6 @@
 use hir::HirDisplay;
 use ra_syntax::{
-    ast::{self, AstNode, LetStmt, NameOwner, TypeAscriptionOwner},
+    ast::{self, AstNode, AstToken, LetStmt, NameOwner, TypeAscriptionOwner},
     TextRange,
 };
 
@@ -35,7 +35,7 @@ pub(crate) fn add_explicit_type(ctx: AssistCtx) -> Option<Assist> {
     let name = pat.name()?;
     let name_range = name.syntax().text_range();
     let stmt_range = stmt.syntax().text_range();
-    let eq_range = stmt.eq_token()?.text_range();
+    let eq_range = stmt.eq_token()?.syntax().text_range();
     // Assist should only be applicable if cursor is between 'let' and '='
     let let_range = TextRange::from_to(stmt_range.start(), eq_range.start());
     let cursor_in_range = ctx.frange.range.is_subrange(&let_range);
diff --git a/crates/ra_assists/src/handlers/add_impl.rs b/crates/ra_assists/src/handlers/add_impl.rs
index 72a201b6d2..26dfed2376 100644
--- a/crates/ra_assists/src/handlers/add_impl.rs
+++ b/crates/ra_assists/src/handlers/add_impl.rs
@@ -42,7 +42,7 @@ pub(crate) fn add_impl(ctx: AssistCtx) -> Option<Assist> {
         if let Some(type_params) = type_params {
             let lifetime_params = type_params
                 .lifetime_params()
-                .filter_map(|it| it.lifetime())
+                .filter_map(|it| it.lifetime_token())
                 .map(|it| it.text().clone());
             let type_params =
                 type_params.type_params().filter_map(|it| it.name()).map(|it| it.text().clone());
diff --git a/crates/ra_assists/src/handlers/add_new.rs b/crates/ra_assists/src/handlers/add_new.rs
index c10397249f..30360af942 100644
--- a/crates/ra_assists/src/handlers/add_new.rs
+++ b/crates/ra_assists/src/handlers/add_new.rs
@@ -106,7 +106,7 @@ fn generate_impl_text(strukt: &ast::StructDef, code: &str) -> String {
     if let Some(type_params) = type_params {
         let lifetime_params = type_params
             .lifetime_params()
-            .filter_map(|it| it.lifetime())
+            .filter_map(|it| it.lifetime_token())
             .map(|it| it.text().clone());
         let type_params =
             type_params.type_params().filter_map(|it| it.name()).map(|it| it.text().clone());
diff --git a/crates/ra_assists/src/handlers/inline_local_variable.rs b/crates/ra_assists/src/handlers/inline_local_variable.rs
index 3bfcba8ff3..b9eb096765 100644
--- a/crates/ra_assists/src/handlers/inline_local_variable.rs
+++ b/crates/ra_assists/src/handlers/inline_local_variable.rs
@@ -29,7 +29,7 @@ pub(crate) fn inline_local_variable(ctx: AssistCtx) -> Option<Assist> {
         ast::Pat::BindPat(pat) => pat,
         _ => return None,
     };
-    if bind_pat.is_mutable() {
+    if bind_pat.mut_kw_token().is_some() {
         tested_by!(test_not_inline_mut_variable);
         return None;
     }
diff --git a/crates/ra_assists/src/handlers/introduce_variable.rs b/crates/ra_assists/src/handlers/introduce_variable.rs
index 8a02f1a32c..ab6bdf6bbd 100644
--- a/crates/ra_assists/src/handlers/introduce_variable.rs
+++ b/crates/ra_assists/src/handlers/introduce_variable.rs
@@ -61,7 +61,7 @@ pub(crate) fn introduce_variable(ctx: AssistCtx) -> Option<Assist> {
         };
         if is_full_stmt {
             tested_by!(test_introduce_var_expr_stmt);
-            if !full_stmt.unwrap().has_semi() {
+            if full_stmt.unwrap().semi_token().is_none() {
                 buf.push_str(";");
             }
             edit.replace(expr.syntax().text_range(), buf);
diff --git a/crates/ra_assists/src/handlers/merge_imports.rs b/crates/ra_assists/src/handlers/merge_imports.rs
index f8b3ddb4e1..936d50ab49 100644
--- a/crates/ra_assists/src/handlers/merge_imports.rs
+++ b/crates/ra_assists/src/handlers/merge_imports.rs
@@ -82,7 +82,7 @@ fn try_merge_trees(old: &ast::UseTree, new: &ast::UseTree) -> Option<ast::UseTre
             .filter(|it| it.kind() != T!['{'] && it.kind() != T!['}']),
     );
     let use_tree_list = lhs.use_tree_list()?;
-    let pos = InsertPosition::Before(use_tree_list.r_curly()?.syntax().clone().into());
+    let pos = InsertPosition::Before(use_tree_list.r_curly_token()?.syntax().clone().into());
     let use_tree_list = use_tree_list.insert_children(pos, to_insert);
     Some(lhs.with_use_tree_list(use_tree_list))
 }
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index b02de5d67d..c4a5ec59cb 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -572,7 +572,10 @@ impl ExprCollector<'_> {
         let pattern = match &pat {
             ast::Pat::BindPat(bp) => {
                 let name = bp.name().map(|nr| nr.as_name()).unwrap_or_else(Name::missing);
-                let annotation = BindingAnnotation::new(bp.is_mutable(), bp.is_ref());
+                let annotation = BindingAnnotation::new(
+                    bp.mut_kw_token().is_some(),
+                    bp.ref_kw_token().is_some(),
+                );
                 let subpat = bp.pat().map(|subpat| self.collect_pat(subpat));
                 if annotation == BindingAnnotation::Unannotated && subpat.is_none() {
                     // This could also be a single-segment path pattern. To
@@ -613,7 +616,7 @@ impl ExprCollector<'_> {
             }
             ast::Pat::RefPat(p) => {
                 let pat = self.collect_pat_opt(p.pat());
-                let mutability = Mutability::from_mutable(p.is_mut());
+                let mutability = Mutability::from_mutable(p.mut_kw_token().is_some());
                 Pat::Ref { pat, mutability }
             }
             ast::Pat::PathPat(p) => {
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs
index 606ec48b08..689bb6c5c2 100644
--- a/crates/ra_hir_def/src/data.rs
+++ b/crates/ra_hir_def/src/data.rs
@@ -75,7 +75,7 @@ impl FunctionData {
             TypeRef::unit()
         };
 
-        let ret_type = if src.value.is_async() {
+        let ret_type = if src.value.async_kw_token().is_some() {
             let future_impl = desugar_future_path(ret_type);
             let ty_bound = TypeBound::Path(future_impl);
             TypeRef::ImplTrait(vec![ty_bound])
@@ -136,7 +136,7 @@ impl TraitData {
     pub(crate) fn trait_data_query(db: &dyn DefDatabase, tr: TraitId) -> Arc<TraitData> {
         let src = tr.lookup(db).source(db);
         let name = src.value.name().map_or_else(Name::missing, |n| n.as_name());
-        let auto = src.value.is_auto();
+        let auto = src.value.auto_kw_token().is_some();
         let ast_id_map = db.ast_id_map(src.file_id);
 
         let container = AssocContainerId::TraitId(tr);
@@ -213,7 +213,7 @@ impl ImplData {
 
         let target_trait = src.value.target_trait().map(TypeRef::from_ast);
         let target_type = TypeRef::from_ast_opt(src.value.target_type());
-        let is_negative = src.value.is_negative();
+        let is_negative = src.value.excl_token().is_some();
         let module_id = impl_loc.container.module(db);
 
         let mut items = Vec::new();
diff --git a/crates/ra_hir_def/src/generics.rs b/crates/ra_hir_def/src/generics.rs
index b687ce2b22..d850244c4a 100644
--- a/crates/ra_hir_def/src/generics.rs
+++ b/crates/ra_hir_def/src/generics.rs
@@ -194,7 +194,7 @@ impl GenericParams {
     }
 
     fn add_where_predicate_from_bound(&mut self, bound: ast::TypeBound, type_ref: TypeRef) {
-        if bound.has_question_mark() {
+        if bound.question_token().is_some() {
             // FIXME: remove this bound
             return;
         }
diff --git a/crates/ra_hir_def/src/nameres/raw.rs b/crates/ra_hir_def/src/nameres/raw.rs
index a9dff3a5d5..e72ba52cfb 100644
--- a/crates/ra_hir_def/src/nameres/raw.rs
+++ b/crates/ra_hir_def/src/nameres/raw.rs
@@ -287,7 +287,7 @@ impl RawItemsCollector {
         let visibility = RawVisibility::from_ast_with_hygiene(module.visibility(), &self.hygiene);
 
         let ast_id = self.source_ast_id_map.ast_id(&module);
-        if module.has_semi() {
+        if module.semi_token().is_some() {
             let item =
                 self.raw_items.modules.alloc(ModuleData::Declaration { name, visibility, ast_id });
             self.push_item(current_module, attrs, RawItemKind::Module(item));
diff --git a/crates/ra_hir_def/src/path/lower.rs b/crates/ra_hir_def/src/path/lower.rs
index 3c13cb2c78..0f806d6fb5 100644
--- a/crates/ra_hir_def/src/path/lower.rs
+++ b/crates/ra_hir_def/src/path/lower.rs
@@ -28,7 +28,7 @@ pub(super) fn lower_path(mut path: ast::Path, hygiene: &Hygiene) -> Option<Path>
     loop {
         let segment = path.segment()?;
 
-        if segment.coloncolon().is_some() {
+        if segment.coloncolon_token().is_some() {
             kind = PathKind::Abs;
         }
 
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs
index 6ec944228c..5b6854b0f0 100644
--- a/crates/ra_hir_def/src/path/lower/lower_use.rs
+++ b/crates/ra_hir_def/src/path/lower/lower_use.rs
@@ -34,7 +34,7 @@ pub(crate) fn lower_use_tree(
         let alias = tree.alias().map(|a| {
             a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias)
         });
-        let is_glob = tree.star().is_some();
+        let is_glob = tree.star_token().is_some();
         if let Some(ast_path) = tree.path() {
             // Handle self in a path.
             // E.g. `use something::{self, <...>}`
diff --git a/crates/ra_hir_def/src/type_ref.rs b/crates/ra_hir_def/src/type_ref.rs
index 01cc392db0..7a83389374 100644
--- a/crates/ra_hir_def/src/type_ref.rs
+++ b/crates/ra_hir_def/src/type_ref.rs
@@ -77,7 +77,7 @@ impl TypeRef {
             }
             ast::TypeRef::PointerType(inner) => {
                 let inner_ty = TypeRef::from_ast_opt(inner.type_ref());
-                let mutability = Mutability::from_mutable(inner.is_mut());
+                let mutability = Mutability::from_mutable(inner.mut_kw_token().is_some());
                 TypeRef::RawPtr(Box::new(inner_ty), mutability)
             }
             ast::TypeRef::ArrayType(inner) => {
@@ -88,7 +88,7 @@ impl TypeRef {
             }
             ast::TypeRef::ReferenceType(inner) => {
                 let inner_ty = TypeRef::from_ast_opt(inner.type_ref());
-                let mutability = Mutability::from_mutable(inner.is_mut());
+                let mutability = Mutability::from_mutable(inner.mut_kw_token().is_some());
                 TypeRef::Reference(Box::new(inner_ty), mutability)
             }
             ast::TypeRef::PlaceholderType(_inner) => TypeRef::Placeholder,
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs
index 219bc20978..3fd4233da8 100644
--- a/crates/ra_hir_expand/src/quote.rs
+++ b/crates/ra_hir_expand/src/quote.rs
@@ -232,7 +232,7 @@ mod tests {
         let quoted = quote!(#a);
         assert_eq!(quoted.to_string(), "hello");
         let t = format!("{:?}", quoted);
-        assert_eq!(t, "SUBTREE $\n  IDENT   hello 4294967295");
+        assert_eq!(t, "Subtree { delimiter: None, token_trees: [Leaf(Ident(Ident { text: \"hello\", id: TokenId(4294967295) }))] }");
     }
 
     #[test]
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index f833d2a9ad..0e34d85dbd 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -190,7 +190,10 @@ impl<'a> CompletionContext<'a> {
         if let Some(name) = find_node_at_offset::<ast::Name>(&file_with_fake_ident, offset) {
             if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) {
                 self.is_pat_binding_or_const = true;
-                if bind_pat.has_at() || bind_pat.is_ref() || bind_pat.is_mutable() {
+                if bind_pat.at_token().is_some()
+                    || bind_pat.ref_kw_token().is_some()
+                    || bind_pat.mut_kw_token().is_some()
+                {
                     self.is_pat_binding_or_const = false;
                 }
                 if bind_pat.syntax().parent().and_then(ast::RecordFieldPatList::cast).is_some() {
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs
index 746cc86ba6..ad6fd50aa0 100644
--- a/crates/ra_ide/src/references.rs
+++ b/crates/ra_ide/src/references.rs
@@ -152,7 +152,7 @@ fn decl_access(def: &Definition, syntax: &SyntaxNode, range: TextRange) -> Optio
     if stmt.initializer().is_some() {
         let pat = stmt.pat()?;
         if let ast::Pat::BindPat(it) = pat {
-            if it.is_mutable() {
+            if it.mut_kw_token().is_some() {
                 return Some(ReferenceAccess::Write);
             }
         }
diff --git a/crates/ra_ide/src/typing.rs b/crates/ra_ide/src/typing.rs
index cb2cd2479f..71d2bcb045 100644
--- a/crates/ra_ide/src/typing.rs
+++ b/crates/ra_ide/src/typing.rs
@@ -63,7 +63,7 @@ fn on_char_typed_inner(
 fn on_eq_typed(file: &SourceFile, offset: TextUnit) -> Option<SingleFileChange> {
     assert_eq!(file.syntax().text().char_at(offset), Some('='));
     let let_stmt: ast::LetStmt = find_node_at_offset(file.syntax(), offset)?;
-    if let_stmt.has_semi() {
+    if let_stmt.semi_token().is_some() {
         return None;
     }
     if let Some(expr) = let_stmt.initializer() {
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index a42eec91a9..15a8279f3d 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -287,7 +287,7 @@ where
     let pred = predicates.next().unwrap();
     let mut bounds = pred.type_bound_list().unwrap().bounds();
 
-    assert_eq!("'a", pred.lifetime().unwrap().text());
+    assert_eq!("'a", pred.lifetime_token().unwrap().text());
 
     assert_bound("'b", bounds.next());
     assert_bound("'c", bounds.next());
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs
index d793109953..069c6ee82a 100644
--- a/crates/ra_syntax/src/ast/edit.rs
+++ b/crates/ra_syntax/src/ast/edit.rs
@@ -33,9 +33,9 @@ impl ast::FnDef {
         let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new();
         let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() {
             old_body.syntax().clone().into()
-        } else if let Some(semi) = self.semicolon_token() {
+        } else if let Some(semi) = self.semi_token() {
             to_insert.push(make::tokens::single_space().into());
-            semi.into()
+            semi.syntax.clone().into()
         } else {
             to_insert.push(make::tokens::single_space().into());
             to_insert.push(body.syntax().clone().into());
@@ -96,7 +96,7 @@ impl ast::ItemList {
                 leading_indent(it.syntax()).unwrap_or_default().to_string(),
                 InsertPosition::After(it.syntax().clone().into()),
             ),
-            None => match self.l_curly() {
+            None => match self.l_curly_token() {
                 Some(it) => (
                     "    ".to_string() + &leading_indent(self.syntax()).unwrap_or_default(),
                     InsertPosition::After(it.syntax().clone().into()),
@@ -142,7 +142,7 @@ impl ast::RecordFieldList {
 
         macro_rules! after_l_curly {
             () => {{
-                let anchor = match self.l_curly() {
+                let anchor = match self.l_curly_token() {
                     Some(it) => it.syntax().clone().into(),
                     None => return self.clone(),
                 };
@@ -301,7 +301,7 @@ impl ast::UseTree {
             suffix.clone(),
             self.use_tree_list(),
             self.alias(),
-            self.star().is_some(),
+            self.star_token().is_some(),
         );
         let nested = make::use_tree_list(iter::once(use_tree));
         return make::use_tree(prefix.clone(), Some(nested), None, false);
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs
index 33fe60762a..b50a89864e 100644
--- a/crates/ra_syntax/src/ast/extensions.rs
+++ b/crates/ra_syntax/src/ast/extensions.rs
@@ -2,16 +2,14 @@
 //! Extensions for various expressions live in a sibling `expr_extensions` module.
 
 use itertools::Itertools;
+use ra_parser::SyntaxKind;
 
 use crate::{
     ast::{
         self, child_opt, children, support, AstNode, AstToken, AttrInput, NameOwner, SyntaxNode,
     },
-    SmolStr, SyntaxElement,
-    SyntaxKind::*,
-    SyntaxToken, T,
+    SmolStr, SyntaxElement, SyntaxToken, T,
 };
-use ra_parser::SyntaxKind;
 
 impl ast::Name {
     pub fn text(&self) -> &SmolStr {
@@ -25,13 +23,11 @@ impl ast::NameRef {
     }
 
     pub fn as_tuple_field(&self) -> Option<usize> {
-        self.syntax().children_with_tokens().find_map(|c| {
-            if c.kind() == SyntaxKind::INT_NUMBER {
-                c.as_token().and_then(|tok| tok.text().as_str().parse().ok())
-            } else {
-                None
-            }
-        })
+        if let Some(ast::NameRefToken::IntNumber(token)) = self.name_ref_token_token() {
+            token.text().as_str().parse().ok()
+        } else {
+            None
+        }
     }
 }
 
@@ -140,15 +136,6 @@ impl ast::Path {
     }
 }
 
-impl ast::Module {
-    pub fn has_semi(&self) -> bool {
-        match self.syntax().last_child_or_token() {
-            None => false,
-            Some(node) => node.kind() == T![;],
-        }
-    }
-}
-
 impl ast::UseTreeList {
     pub fn parent_use_tree(&self) -> ast::UseTree {
         self.syntax()
@@ -179,10 +166,6 @@ impl ast::ImplDef {
         let second = types.next();
         (first, second)
     }
-
-    pub fn is_negative(&self) -> bool {
-        self.syntax().children_with_tokens().any(|t| t.kind() == T![!])
-    }
 }
 
 #[derive(Debug, Clone, PartialEq, Eq)]
@@ -223,41 +206,6 @@ impl ast::EnumVariant {
     }
 }
 
-impl ast::FnDef {
-    pub fn semicolon_token(&self) -> Option<SyntaxToken> {
-        self.syntax()
-            .last_child_or_token()
-            .and_then(|it| it.into_token())
-            .filter(|it| it.kind() == T![;])
-    }
-
-    pub fn is_async(&self) -> bool {
-        self.syntax().children_with_tokens().any(|it| it.kind() == T![async])
-    }
-}
-
-impl ast::LetStmt {
-    pub fn has_semi(&self) -> bool {
-        match self.syntax().last_child_or_token() {
-            None => false,
-            Some(node) => node.kind() == T![;],
-        }
-    }
-
-    pub fn eq_token(&self) -> Option<SyntaxToken> {
-        self.syntax().children_with_tokens().find(|t| t.kind() == EQ).and_then(|it| it.into_token())
-    }
-}
-
-impl ast::ExprStmt {
-    pub fn has_semi(&self) -> bool {
-        match self.syntax().last_child_or_token() {
-            None => false,
-            Some(node) => node.kind() == T![;],
-        }
-    }
-}
-
 #[derive(Debug, Clone, PartialEq, Eq)]
 pub enum FieldKind {
     Name(ast::NameRef),
@@ -286,25 +234,6 @@ impl ast::FieldExpr {
     }
 }
 
-impl ast::RefPat {
-    pub fn is_mut(&self) -> bool {
-        self.syntax().children_with_tokens().any(|n| n.kind() == T![mut])
-    }
-}
-
-impl ast::BindPat {
-    pub fn is_mutable(&self) -> bool {
-        self.syntax().children_with_tokens().any(|n| n.kind() == T![mut])
-    }
-
-    pub fn is_ref(&self) -> bool {
-        self.syntax().children_with_tokens().any(|n| n.kind() == T![ref])
-    }
-    pub fn has_at(&self) -> bool {
-        self.syntax().children_with_tokens().any(|it| it.kind() == T![@])
-    }
-}
-
 pub struct SlicePatComponents {
     pub prefix: Vec<ast::Pat>,
     pub slice: Option<ast::Pat>,
@@ -339,18 +268,6 @@ impl ast::SlicePat {
     }
 }
 
-impl ast::PointerType {
-    pub fn is_mut(&self) -> bool {
-        self.syntax().children_with_tokens().any(|n| n.kind() == T![mut])
-    }
-}
-
-impl ast::ReferenceType {
-    pub fn is_mut(&self) -> bool {
-        self.syntax().children_with_tokens().any(|n| n.kind() == T![mut])
-    }
-}
-
 #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
 pub enum SelfParamKind {
     /// self
@@ -363,8 +280,8 @@ pub enum SelfParamKind {
 
 impl ast::SelfParam {
     pub fn kind(&self) -> SelfParamKind {
-        if self.amp().is_some() {
-            if self.amp_mut_kw().is_some() {
+        if self.amp_token().is_some() {
+            if self.amp_mut_kw_token().is_some() {
                 SelfParamKind::MutRef
             } else {
                 SelfParamKind::Ref
@@ -375,7 +292,7 @@ impl ast::SelfParam {
     }
 
     /// the "mut" in "mut self", not the one in "&mut self"
-    pub fn mut_kw(&self) -> Option<ast::MutKw> {
+    pub fn mut_kw_token(&self) -> Option<ast::MutKw> {
         self.syntax()
             .children_with_tokens()
             .filter_map(|it| it.into_token())
@@ -384,7 +301,7 @@ impl ast::SelfParam {
     }
 
     /// the "mut" in "&mut self", not the one in "mut self"
-    pub fn amp_mut_kw(&self) -> Option<ast::MutKw> {
+    pub fn amp_mut_kw_token(&self) -> Option<ast::MutKw> {
         self.syntax()
             .children_with_tokens()
             .filter_map(|it| it.into_token())
@@ -409,18 +326,14 @@ impl ast::TypeBound {
             TypeBoundKind::PathType(path_type)
         } else if let Some(for_type) = children(self).next() {
             TypeBoundKind::ForType(for_type)
-        } else if let Some(lifetime) = self.lifetime() {
+        } else if let Some(lifetime) = self.lifetime_token() {
             TypeBoundKind::Lifetime(lifetime)
         } else {
             unreachable!()
         }
     }
 
-    pub fn has_question_mark(&self) -> bool {
-        self.question().is_some()
-    }
-
-    pub fn const_question(&self) -> Option<ast::Question> {
+    pub fn const_question_token(&self) -> Option<ast::Question> {
         self.syntax()
             .children_with_tokens()
             .filter_map(|it| it.into_token())
@@ -428,8 +341,8 @@ impl ast::TypeBound {
             .find_map(ast::Question::cast)
     }
 
-    pub fn question(&self) -> Option<ast::Question> {
-        if self.const_kw().is_some() {
+    pub fn question_token(&self) -> Option<ast::Question> {
+        if self.const_kw_token().is_some() {
             self.syntax()
                 .children_with_tokens()
                 .filter_map(|it| it.into_token())
@@ -441,12 +354,6 @@ impl ast::TypeBound {
     }
 }
 
-impl ast::TraitDef {
-    pub fn is_auto(&self) -> bool {
-        self.syntax().children_with_tokens().any(|t| t.kind() == T![auto])
-    }
-}
-
 pub enum VisibilityKind {
     In(ast::Path),
     PubCrate,
@@ -459,28 +366,16 @@ impl ast::Visibility {
     pub fn kind(&self) -> VisibilityKind {
         if let Some(path) = children(self).next() {
             VisibilityKind::In(path)
-        } else if self.is_pub_crate() {
+        } else if self.crate_kw_token().is_some() {
             VisibilityKind::PubCrate
-        } else if self.is_pub_super() {
+        } else if self.super_kw_token().is_some() {
             VisibilityKind::PubSuper
-        } else if self.is_pub_self() {
+        } else if self.self_kw_token().is_some() {
             VisibilityKind::PubSuper
         } else {
             VisibilityKind::Pub
         }
     }
-
-    fn is_pub_crate(&self) -> bool {
-        self.syntax().children_with_tokens().any(|it| it.kind() == T![crate])
-    }
-
-    fn is_pub_super(&self) -> bool {
-        self.syntax().children_with_tokens().any(|it| it.kind() == T![super])
-    }
-
-    fn is_pub_self(&self) -> bool {
-        self.syntax().children_with_tokens().any(|it| it.kind() == T![self])
-    }
 }
 
 impl ast::MacroCall {
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index 8b348ad6e1..bcbfd1129d 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -49,15 +49,15 @@ impl ast::DocCommentsOwner for FnDef {}
 impl ast::AttrsOwner for FnDef {}
 impl FnDef {
     pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
-    pub fn const_kw(&self) -> Option<ConstKw> { support::token(&self.syntax) }
-    pub fn default_kw(&self) -> Option<DefaultKw> { support::token(&self.syntax) }
-    pub fn async_kw(&self) -> Option<AsyncKw> { support::token(&self.syntax) }
-    pub fn unsafe_kw(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
-    pub fn fn_kw(&self) -> Option<FnKw> { support::token(&self.syntax) }
+    pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) }
+    pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) }
+    pub fn async_kw_token(&self) -> Option<AsyncKw> { support::token(&self.syntax) }
+    pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
+    pub fn fn_kw_token(&self) -> Option<FnKw> { support::token(&self.syntax) }
     pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
     pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
     pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct RetType {
@@ -75,7 +75,7 @@ impl AstNode for RetType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl RetType {
-    pub fn thin_arrow(&self) -> Option<ThinArrow> { support::token(&self.syntax) }
+    pub fn thin_arrow_token(&self) -> Option<ThinArrow> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -99,9 +99,9 @@ impl ast::TypeParamsOwner for StructDef {}
 impl ast::AttrsOwner for StructDef {}
 impl ast::DocCommentsOwner for StructDef {}
 impl StructDef {
-    pub fn struct_kw(&self) -> Option<StructKw> { support::token(&self.syntax) }
+    pub fn struct_kw_token(&self) -> Option<StructKw> { support::token(&self.syntax) }
     pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct UnionDef {
@@ -124,7 +124,7 @@ impl ast::TypeParamsOwner for UnionDef {}
 impl ast::AttrsOwner for UnionDef {}
 impl ast::DocCommentsOwner for UnionDef {}
 impl UnionDef {
-    pub fn union_kw(&self) -> Option<UnionKw> { support::token(&self.syntax) }
+    pub fn union_kw_token(&self) -> Option<UnionKw> { support::token(&self.syntax) }
     pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> {
         support::child(&self.syntax)
     }
@@ -145,9 +145,9 @@ impl AstNode for RecordFieldDefList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl RecordFieldDefList {
-    pub fn l_curly(&self) -> Option<LCurly> { support::token(&self.syntax) }
+    pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) }
     pub fn fields(&self) -> AstChildren<RecordFieldDef> { support::children(&self.syntax) }
-    pub fn r_curly(&self) -> Option<RCurly> { support::token(&self.syntax) }
+    pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct RecordFieldDef {
@@ -186,9 +186,9 @@ impl AstNode for TupleFieldDefList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl TupleFieldDefList {
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TupleFieldDef {
@@ -231,7 +231,7 @@ impl ast::TypeParamsOwner for EnumDef {}
 impl ast::AttrsOwner for EnumDef {}
 impl ast::DocCommentsOwner for EnumDef {}
 impl EnumDef {
-    pub fn enum_kw(&self) -> Option<EnumKw> { support::token(&self.syntax) }
+    pub fn enum_kw_token(&self) -> Option<EnumKw> { support::token(&self.syntax) }
     pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -250,9 +250,9 @@ impl AstNode for EnumVariantList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl EnumVariantList {
-    pub fn l_curly(&self) -> Option<LCurly> { support::token(&self.syntax) }
+    pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) }
     pub fn variants(&self) -> AstChildren<EnumVariant> { support::children(&self.syntax) }
-    pub fn r_curly(&self) -> Option<RCurly> { support::token(&self.syntax) }
+    pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct EnumVariant {
@@ -275,7 +275,7 @@ impl ast::DocCommentsOwner for EnumVariant {}
 impl ast::AttrsOwner for EnumVariant {}
 impl EnumVariant {
     pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -300,9 +300,9 @@ impl ast::DocCommentsOwner for TraitDef {}
 impl ast::TypeParamsOwner for TraitDef {}
 impl ast::TypeBoundsOwner for TraitDef {}
 impl TraitDef {
-    pub fn unsafe_kw(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
-    pub fn auto_kw(&self) -> Option<AutoKw> { support::token(&self.syntax) }
-    pub fn trait_kw(&self) -> Option<TraitKw> { support::token(&self.syntax) }
+    pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
+    pub fn auto_kw_token(&self) -> Option<AutoKw> { support::token(&self.syntax) }
+    pub fn trait_kw_token(&self) -> Option<TraitKw> { support::token(&self.syntax) }
     pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -325,9 +325,9 @@ impl ast::NameOwner for Module {}
 impl ast::AttrsOwner for Module {}
 impl ast::DocCommentsOwner for Module {}
 impl Module {
-    pub fn mod_kw(&self) -> Option<ModKw> { support::token(&self.syntax) }
+    pub fn mod_kw_token(&self) -> Option<ModKw> { support::token(&self.syntax) }
     pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ItemList {
@@ -347,9 +347,9 @@ impl AstNode for ItemList {
 impl ast::FnDefOwner for ItemList {}
 impl ast::ModuleItemOwner for ItemList {}
 impl ItemList {
-    pub fn l_curly(&self) -> Option<LCurly> { support::token(&self.syntax) }
+    pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) }
     pub fn impl_items(&self) -> AstChildren<ImplItem> { support::children(&self.syntax) }
-    pub fn r_curly(&self) -> Option<RCurly> { support::token(&self.syntax) }
+    pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ConstDef {
@@ -373,11 +373,11 @@ impl ast::AttrsOwner for ConstDef {}
 impl ast::DocCommentsOwner for ConstDef {}
 impl ast::TypeAscriptionOwner for ConstDef {}
 impl ConstDef {
-    pub fn default_kw(&self) -> Option<DefaultKw> { support::token(&self.syntax) }
-    pub fn const_kw(&self) -> Option<ConstKw> { support::token(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) }
+    pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct StaticDef {
@@ -401,11 +401,11 @@ impl ast::AttrsOwner for StaticDef {}
 impl ast::DocCommentsOwner for StaticDef {}
 impl ast::TypeAscriptionOwner for StaticDef {}
 impl StaticDef {
-    pub fn static_kw(&self) -> Option<StaticKw> { support::token(&self.syntax) }
-    pub fn mut_kw(&self) -> Option<MutKw> { support::token(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn static_kw_token(&self) -> Option<StaticKw> { support::token(&self.syntax) }
+    pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TypeAliasDef {
@@ -429,11 +429,11 @@ impl ast::AttrsOwner for TypeAliasDef {}
 impl ast::DocCommentsOwner for TypeAliasDef {}
 impl ast::TypeBoundsOwner for TypeAliasDef {}
 impl TypeAliasDef {
-    pub fn default_kw(&self) -> Option<DefaultKw> { support::token(&self.syntax) }
-    pub fn type_kw(&self) -> Option<TypeKw> { support::token(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) }
+    pub fn type_kw_token(&self) -> Option<TypeKw> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ImplDef {
@@ -453,12 +453,12 @@ impl AstNode for ImplDef {
 impl ast::TypeParamsOwner for ImplDef {}
 impl ast::AttrsOwner for ImplDef {}
 impl ImplDef {
-    pub fn default_kw(&self) -> Option<DefaultKw> { support::token(&self.syntax) }
-    pub fn const_kw(&self) -> Option<ConstKw> { support::token(&self.syntax) }
-    pub fn unsafe_kw(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
-    pub fn impl_kw(&self) -> Option<ImplKw> { support::token(&self.syntax) }
-    pub fn excl(&self) -> Option<Excl> { support::token(&self.syntax) }
-    pub fn for_kw(&self) -> Option<ForKw> { support::token(&self.syntax) }
+    pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) }
+    pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) }
+    pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
+    pub fn impl_kw_token(&self) -> Option<ImplKw> { support::token(&self.syntax) }
+    pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) }
+    pub fn for_kw_token(&self) -> Option<ForKw> { support::token(&self.syntax) }
     pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -477,9 +477,9 @@ impl AstNode for ParenType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl ParenType {
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TupleType {
@@ -497,9 +497,9 @@ impl AstNode for TupleType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl TupleType {
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn fields(&self) -> AstChildren<TypeRef> { support::children(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct NeverType {
@@ -517,7 +517,7 @@ impl AstNode for NeverType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl NeverType {
-    pub fn excl(&self) -> Option<Excl> { support::token(&self.syntax) }
+    pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct PathType {
@@ -553,8 +553,9 @@ impl AstNode for PointerType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl PointerType {
-    pub fn star(&self) -> Option<Star> { support::token(&self.syntax) }
-    pub fn const_kw(&self) -> Option<ConstKw> { support::token(&self.syntax) }
+    pub fn star_token(&self) -> Option<Star> { support::token(&self.syntax) }
+    pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) }
+    pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -573,11 +574,11 @@ impl AstNode for ArrayType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl ArrayType {
-    pub fn l_brack(&self) -> Option<LBrack> { support::token(&self.syntax) }
+    pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn r_brack(&self) -> Option<RBrack> { support::token(&self.syntax) }
+    pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct SliceType {
@@ -595,9 +596,9 @@ impl AstNode for SliceType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl SliceType {
-    pub fn l_brack(&self) -> Option<LBrack> { support::token(&self.syntax) }
+    pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
-    pub fn r_brack(&self) -> Option<RBrack> { support::token(&self.syntax) }
+    pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ReferenceType {
@@ -615,9 +616,9 @@ impl AstNode for ReferenceType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl ReferenceType {
-    pub fn amp(&self) -> Option<Amp> { support::token(&self.syntax) }
-    pub fn lifetime(&self) -> Option<Lifetime> { support::token(&self.syntax) }
-    pub fn mut_kw(&self) -> Option<MutKw> { support::token(&self.syntax) }
+    pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) }
+    pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
+    pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -636,7 +637,7 @@ impl AstNode for PlaceholderType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl PlaceholderType {
-    pub fn underscore(&self) -> Option<Underscore> { support::token(&self.syntax) }
+    pub fn underscore_token(&self) -> Option<Underscore> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct FnPointerType {
@@ -655,8 +656,8 @@ impl AstNode for FnPointerType {
 }
 impl FnPointerType {
     pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
-    pub fn unsafe_kw(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
-    pub fn fn_kw(&self) -> Option<FnKw> { support::token(&self.syntax) }
+    pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
+    pub fn fn_kw_token(&self) -> Option<FnKw> { support::token(&self.syntax) }
     pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
     pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
 }
@@ -676,7 +677,7 @@ impl AstNode for ForType {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl ForType {
-    pub fn for_kw(&self) -> Option<ForKw> { support::token(&self.syntax) }
+    pub fn for_kw_token(&self) -> Option<ForKw> { support::token(&self.syntax) }
     pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
@@ -697,7 +698,7 @@ impl AstNode for ImplTraitType {
 }
 impl ast::TypeBoundsOwner for ImplTraitType {}
 impl ImplTraitType {
-    pub fn impl_kw(&self) -> Option<ImplKw> { support::token(&self.syntax) }
+    pub fn impl_kw_token(&self) -> Option<ImplKw> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct DynTraitType {
@@ -716,7 +717,7 @@ impl AstNode for DynTraitType {
 }
 impl ast::TypeBoundsOwner for DynTraitType {}
 impl DynTraitType {
-    pub fn dyn_kw(&self) -> Option<DynKw> { support::token(&self.syntax) }
+    pub fn dyn_kw_token(&self) -> Option<DynKw> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TupleExpr {
@@ -735,9 +736,9 @@ impl AstNode for TupleExpr {
 }
 impl ast::AttrsOwner for TupleExpr {}
 impl TupleExpr {
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ArrayExpr {
@@ -756,10 +757,10 @@ impl AstNode for ArrayExpr {
 }
 impl ast::AttrsOwner for ArrayExpr {}
 impl ArrayExpr {
-    pub fn l_brack(&self) -> Option<LBrack> { support::token(&self.syntax) }
+    pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) }
     pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
-    pub fn r_brack(&self) -> Option<RBrack> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ParenExpr {
@@ -778,9 +779,9 @@ impl AstNode for ParenExpr {
 }
 impl ast::AttrsOwner for ParenExpr {}
 impl ParenExpr {
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct PathExpr {
@@ -817,9 +818,9 @@ impl AstNode for LambdaExpr {
 }
 impl ast::AttrsOwner for LambdaExpr {}
 impl LambdaExpr {
-    pub fn static_kw(&self) -> Option<StaticKw> { support::token(&self.syntax) }
-    pub fn async_kw(&self) -> Option<AsyncKw> { support::token(&self.syntax) }
-    pub fn move_kw(&self) -> Option<MoveKw> { support::token(&self.syntax) }
+    pub fn static_kw_token(&self) -> Option<StaticKw> { support::token(&self.syntax) }
+    pub fn async_kw_token(&self) -> Option<AsyncKw> { support::token(&self.syntax) }
+    pub fn move_kw_token(&self) -> Option<MoveKw> { support::token(&self.syntax) }
     pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
     pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
     pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
@@ -841,7 +842,7 @@ impl AstNode for IfExpr {
 }
 impl ast::AttrsOwner for IfExpr {}
 impl IfExpr {
-    pub fn if_kw(&self) -> Option<IfKw> { support::token(&self.syntax) }
+    pub fn if_kw_token(&self) -> Option<IfKw> { support::token(&self.syntax) }
     pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -862,7 +863,7 @@ impl AstNode for LoopExpr {
 impl ast::AttrsOwner for LoopExpr {}
 impl ast::LoopBodyOwner for LoopExpr {}
 impl LoopExpr {
-    pub fn loop_kw(&self) -> Option<LoopKw> { support::token(&self.syntax) }
+    pub fn loop_kw_token(&self) -> Option<LoopKw> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TryBlockExpr {
@@ -881,7 +882,7 @@ impl AstNode for TryBlockExpr {
 }
 impl ast::AttrsOwner for TryBlockExpr {}
 impl TryBlockExpr {
-    pub fn try_kw(&self) -> Option<TryKw> { support::token(&self.syntax) }
+    pub fn try_kw_token(&self) -> Option<TryKw> { support::token(&self.syntax) }
     pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -902,9 +903,9 @@ impl AstNode for ForExpr {
 impl ast::AttrsOwner for ForExpr {}
 impl ast::LoopBodyOwner for ForExpr {}
 impl ForExpr {
-    pub fn for_kw(&self) -> Option<ForKw> { support::token(&self.syntax) }
+    pub fn for_kw_token(&self) -> Option<ForKw> { support::token(&self.syntax) }
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
-    pub fn in_kw(&self) -> Option<InKw> { support::token(&self.syntax) }
+    pub fn in_kw_token(&self) -> Option<InKw> { support::token(&self.syntax) }
     pub fn iterable(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -925,7 +926,7 @@ impl AstNode for WhileExpr {
 impl ast::AttrsOwner for WhileExpr {}
 impl ast::LoopBodyOwner for WhileExpr {}
 impl WhileExpr {
-    pub fn while_kw(&self) -> Option<WhileKw> { support::token(&self.syntax) }
+    pub fn while_kw_token(&self) -> Option<WhileKw> { support::token(&self.syntax) }
     pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -945,8 +946,8 @@ impl AstNode for ContinueExpr {
 }
 impl ast::AttrsOwner for ContinueExpr {}
 impl ContinueExpr {
-    pub fn continue_kw(&self) -> Option<ContinueKw> { support::token(&self.syntax) }
-    pub fn lifetime(&self) -> Option<Lifetime> { support::token(&self.syntax) }
+    pub fn continue_kw_token(&self) -> Option<ContinueKw> { support::token(&self.syntax) }
+    pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct BreakExpr {
@@ -965,8 +966,8 @@ impl AstNode for BreakExpr {
 }
 impl ast::AttrsOwner for BreakExpr {}
 impl BreakExpr {
-    pub fn break_kw(&self) -> Option<BreakKw> { support::token(&self.syntax) }
-    pub fn lifetime(&self) -> Option<Lifetime> { support::token(&self.syntax) }
+    pub fn break_kw_token(&self) -> Option<BreakKw> { support::token(&self.syntax) }
+    pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -985,7 +986,7 @@ impl AstNode for Label {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl Label {
-    pub fn lifetime(&self) -> Option<Lifetime> { support::token(&self.syntax) }
+    pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct BlockExpr {
@@ -1005,7 +1006,7 @@ impl AstNode for BlockExpr {
 impl ast::AttrsOwner for BlockExpr {}
 impl BlockExpr {
     pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
-    pub fn unsafe_kw(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
+    pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) }
     pub fn block(&self) -> Option<Block> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1065,7 +1066,7 @@ impl ast::AttrsOwner for MethodCallExpr {}
 impl ast::ArgListOwner for MethodCallExpr {}
 impl MethodCallExpr {
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn dot(&self) -> Option<Dot> { support::token(&self.syntax) }
+    pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) }
     pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
     pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) }
 }
@@ -1086,8 +1087,8 @@ impl AstNode for IndexExpr {
 }
 impl ast::AttrsOwner for IndexExpr {}
 impl IndexExpr {
-    pub fn l_brack(&self) -> Option<LBrack> { support::token(&self.syntax) }
-    pub fn r_brack(&self) -> Option<RBrack> { support::token(&self.syntax) }
+    pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) }
+    pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct FieldExpr {
@@ -1107,7 +1108,7 @@ impl AstNode for FieldExpr {
 impl ast::AttrsOwner for FieldExpr {}
 impl FieldExpr {
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn dot(&self) -> Option<Dot> { support::token(&self.syntax) }
+    pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) }
     pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1128,8 +1129,8 @@ impl AstNode for AwaitExpr {
 impl ast::AttrsOwner for AwaitExpr {}
 impl AwaitExpr {
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn dot(&self) -> Option<Dot> { support::token(&self.syntax) }
-    pub fn await_kw(&self) -> Option<AwaitKw> { support::token(&self.syntax) }
+    pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) }
+    pub fn await_kw_token(&self) -> Option<AwaitKw> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TryExpr {
@@ -1148,7 +1149,7 @@ impl AstNode for TryExpr {
 }
 impl ast::AttrsOwner for TryExpr {}
 impl TryExpr {
-    pub fn try_kw(&self) -> Option<TryKw> { support::token(&self.syntax) }
+    pub fn try_kw_token(&self) -> Option<TryKw> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1169,7 +1170,7 @@ impl AstNode for CastExpr {
 impl ast::AttrsOwner for CastExpr {}
 impl CastExpr {
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn as_kw(&self) -> Option<AsKw> { support::token(&self.syntax) }
+    pub fn as_kw_token(&self) -> Option<AsKw> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1189,9 +1190,9 @@ impl AstNode for RefExpr {
 }
 impl ast::AttrsOwner for RefExpr {}
 impl RefExpr {
-    pub fn amp(&self) -> Option<Amp> { support::token(&self.syntax) }
-    pub fn raw_kw(&self) -> Option<RawKw> { support::token(&self.syntax) }
-    pub fn mut_kw(&self) -> Option<MutKw> { support::token(&self.syntax) }
+    pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) }
+    pub fn raw_kw_token(&self) -> Option<RawKw> { support::token(&self.syntax) }
+    pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1211,7 +1212,7 @@ impl AstNode for PrefixExpr {
 }
 impl ast::AttrsOwner for PrefixExpr {}
 impl PrefixExpr {
-    pub fn prefix_op(&self) -> Option<PrefixOp> { support::token(&self.syntax) }
+    pub fn prefix_op_token(&self) -> Option<PrefixOp> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1231,7 +1232,7 @@ impl AstNode for BoxExpr {
 }
 impl ast::AttrsOwner for BoxExpr {}
 impl BoxExpr {
-    pub fn box_kw(&self) -> Option<BoxKw> { support::token(&self.syntax) }
+    pub fn box_kw_token(&self) -> Option<BoxKw> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1251,7 +1252,7 @@ impl AstNode for RangeExpr {
 }
 impl ast::AttrsOwner for RangeExpr {}
 impl RangeExpr {
-    pub fn range_op(&self) -> Option<RangeOp> { support::token(&self.syntax) }
+    pub fn range_op_token(&self) -> Option<RangeOp> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct BinExpr {
@@ -1270,7 +1271,7 @@ impl AstNode for BinExpr {
 }
 impl ast::AttrsOwner for BinExpr {}
 impl BinExpr {
-    pub fn bin_op(&self) -> Option<BinOp> { support::token(&self.syntax) }
+    pub fn bin_op_token(&self) -> Option<BinOp> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Literal {
@@ -1288,7 +1289,7 @@ impl AstNode for Literal {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl Literal {
-    pub fn literal_token(&self) -> Option<LiteralToken> { support::token(&self.syntax) }
+    pub fn literal_token_token(&self) -> Option<LiteralToken> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct MatchExpr {
@@ -1307,7 +1308,7 @@ impl AstNode for MatchExpr {
 }
 impl ast::AttrsOwner for MatchExpr {}
 impl MatchExpr {
-    pub fn match_kw(&self) -> Option<MatchKw> { support::token(&self.syntax) }
+    pub fn match_kw_token(&self) -> Option<MatchKw> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
     pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) }
 }
@@ -1328,9 +1329,9 @@ impl AstNode for MatchArmList {
 }
 impl ast::AttrsOwner for MatchArmList {}
 impl MatchArmList {
-    pub fn l_curly(&self) -> Option<LCurly> { support::token(&self.syntax) }
+    pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) }
     pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) }
-    pub fn r_curly(&self) -> Option<RCurly> { support::token(&self.syntax) }
+    pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct MatchArm {
@@ -1351,7 +1352,7 @@ impl ast::AttrsOwner for MatchArm {}
 impl MatchArm {
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
     pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) }
-    pub fn fat_arrow(&self) -> Option<FatArrow> { support::token(&self.syntax) }
+    pub fn fat_arrow_token(&self) -> Option<FatArrow> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1370,7 +1371,7 @@ impl AstNode for MatchGuard {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl MatchGuard {
-    pub fn if_kw(&self) -> Option<IfKw> { support::token(&self.syntax) }
+    pub fn if_kw_token(&self) -> Option<IfKw> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1408,11 +1409,11 @@ impl AstNode for RecordFieldList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl RecordFieldList {
-    pub fn l_curly(&self) -> Option<LCurly> { support::token(&self.syntax) }
+    pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) }
     pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) }
-    pub fn dotdot(&self) -> Option<Dotdot> { support::token(&self.syntax) }
+    pub fn dotdot_token(&self) -> Option<Dotdot> { support::token(&self.syntax) }
     pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn r_curly(&self) -> Option<RCurly> { support::token(&self.syntax) }
+    pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct RecordField {
@@ -1432,7 +1433,7 @@ impl AstNode for RecordField {
 impl ast::AttrsOwner for RecordField {}
 impl RecordField {
     pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
-    pub fn colon(&self) -> Option<Colon> { support::token(&self.syntax) }
+    pub fn colon_token(&self) -> Option<Colon> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1469,9 +1470,9 @@ impl AstNode for ParenPat {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl ParenPat {
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct RefPat {
@@ -1489,8 +1490,8 @@ impl AstNode for RefPat {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl RefPat {
-    pub fn amp(&self) -> Option<Amp> { support::token(&self.syntax) }
-    pub fn mut_kw(&self) -> Option<MutKw> { support::token(&self.syntax) }
+    pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) }
+    pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) }
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1509,7 +1510,7 @@ impl AstNode for BoxPat {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl BoxPat {
-    pub fn box_kw(&self) -> Option<BoxKw> { support::token(&self.syntax) }
+    pub fn box_kw_token(&self) -> Option<BoxKw> { support::token(&self.syntax) }
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1530,8 +1531,9 @@ impl AstNode for BindPat {
 impl ast::AttrsOwner for BindPat {}
 impl ast::NameOwner for BindPat {}
 impl BindPat {
-    pub fn ref_kw(&self) -> Option<RefKw> { support::token(&self.syntax) }
-    pub fn mut_kw(&self) -> Option<MutKw> { support::token(&self.syntax) }
+    pub fn ref_kw_token(&self) -> Option<RefKw> { support::token(&self.syntax) }
+    pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) }
+    pub fn at_token(&self) -> Option<At> { support::token(&self.syntax) }
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1550,7 +1552,7 @@ impl AstNode for PlaceholderPat {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl PlaceholderPat {
-    pub fn underscore(&self) -> Option<Underscore> { support::token(&self.syntax) }
+    pub fn underscore_token(&self) -> Option<Underscore> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct DotDotPat {
@@ -1568,7 +1570,7 @@ impl AstNode for DotDotPat {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl DotDotPat {
-    pub fn dotdot(&self) -> Option<Dotdot> { support::token(&self.syntax) }
+    pub fn dotdot_token(&self) -> Option<Dotdot> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct PathPat {
@@ -1604,9 +1606,9 @@ impl AstNode for SlicePat {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl SlicePat {
-    pub fn l_brack(&self) -> Option<LBrack> { support::token(&self.syntax) }
+    pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) }
     pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
-    pub fn r_brack(&self) -> Option<RBrack> { support::token(&self.syntax) }
+    pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct RangePat {
@@ -1624,7 +1626,7 @@ impl AstNode for RangePat {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl RangePat {
-    pub fn range_separator(&self) -> Option<RangeSeparator> { support::token(&self.syntax) }
+    pub fn range_separator_token(&self) -> Option<RangeSeparator> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct LiteralPat {
@@ -1699,14 +1701,14 @@ impl AstNode for RecordFieldPatList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl RecordFieldPatList {
-    pub fn l_curly(&self) -> Option<LCurly> { support::token(&self.syntax) }
+    pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) }
     pub fn pats(&self) -> AstChildren<RecordInnerPat> { support::children(&self.syntax) }
     pub fn record_field_pats(&self) -> AstChildren<RecordFieldPat> {
         support::children(&self.syntax)
     }
     pub fn bind_pats(&self) -> AstChildren<BindPat> { support::children(&self.syntax) }
-    pub fn dotdot(&self) -> Option<Dotdot> { support::token(&self.syntax) }
-    pub fn r_curly(&self) -> Option<RCurly> { support::token(&self.syntax) }
+    pub fn dotdot_token(&self) -> Option<Dotdot> { support::token(&self.syntax) }
+    pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct RecordFieldPat {
@@ -1726,7 +1728,7 @@ impl AstNode for RecordFieldPat {
 impl ast::AttrsOwner for RecordFieldPat {}
 impl ast::NameOwner for RecordFieldPat {}
 impl RecordFieldPat {
-    pub fn colon(&self) -> Option<Colon> { support::token(&self.syntax) }
+    pub fn colon_token(&self) -> Option<Colon> { support::token(&self.syntax) }
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1746,9 +1748,9 @@ impl AstNode for TupleStructPat {
 }
 impl TupleStructPat {
     pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TuplePat {
@@ -1766,9 +1768,9 @@ impl AstNode for TuplePat {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl TuplePat {
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Visibility {
@@ -1786,10 +1788,10 @@ impl AstNode for Visibility {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl Visibility {
-    pub fn pub_kw(&self) -> Option<PubKw> { support::token(&self.syntax) }
-    pub fn super_kw(&self) -> Option<SuperKw> { support::token(&self.syntax) }
-    pub fn self_kw(&self) -> Option<SelfKw> { support::token(&self.syntax) }
-    pub fn crate_kw(&self) -> Option<CrateKw> { support::token(&self.syntax) }
+    pub fn pub_kw_token(&self) -> Option<PubKw> { support::token(&self.syntax) }
+    pub fn super_kw_token(&self) -> Option<SuperKw> { support::token(&self.syntax) }
+    pub fn self_kw_token(&self) -> Option<SelfKw> { support::token(&self.syntax) }
+    pub fn crate_kw_token(&self) -> Option<CrateKw> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Name {
@@ -1807,7 +1809,7 @@ impl AstNode for Name {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl Name {
-    pub fn ident(&self) -> Option<Ident> { support::token(&self.syntax) }
+    pub fn ident_token(&self) -> Option<Ident> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct NameRef {
@@ -1825,7 +1827,7 @@ impl AstNode for NameRef {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl NameRef {
-    pub fn name_ref_token(&self) -> Option<NameRefToken> { support::token(&self.syntax) }
+    pub fn name_ref_token_token(&self) -> Option<NameRefToken> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct MacroCall {
@@ -1847,9 +1849,9 @@ impl ast::AttrsOwner for MacroCall {}
 impl ast::DocCommentsOwner for MacroCall {}
 impl MacroCall {
     pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
-    pub fn excl(&self) -> Option<Excl> { support::token(&self.syntax) }
+    pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) }
     pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Attr {
@@ -1867,13 +1869,13 @@ impl AstNode for Attr {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl Attr {
-    pub fn pound(&self) -> Option<Pound> { support::token(&self.syntax) }
-    pub fn excl(&self) -> Option<Excl> { support::token(&self.syntax) }
-    pub fn l_brack(&self) -> Option<LBrack> { support::token(&self.syntax) }
+    pub fn pound_token(&self) -> Option<Pound> { support::token(&self.syntax) }
+    pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) }
+    pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) }
     pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn input(&self) -> Option<AttrInput> { support::child(&self.syntax) }
-    pub fn r_brack(&self) -> Option<RBrack> { support::token(&self.syntax) }
+    pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TokenTree {
@@ -1907,12 +1909,12 @@ impl AstNode for TypeParamList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl TypeParamList {
-    pub fn l_angle(&self) -> Option<LAngle> { support::token(&self.syntax) }
+    pub fn l_angle_token(&self) -> Option<LAngle> { support::token(&self.syntax) }
     pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) }
     pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) }
     pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) }
     pub fn const_params(&self) -> AstChildren<ConstParam> { support::children(&self.syntax) }
-    pub fn r_angle(&self) -> Option<RAngle> { support::token(&self.syntax) }
+    pub fn r_angle_token(&self) -> Option<RAngle> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TypeParam {
@@ -1933,7 +1935,7 @@ impl ast::NameOwner for TypeParam {}
 impl ast::AttrsOwner for TypeParam {}
 impl ast::TypeBoundsOwner for TypeParam {}
 impl TypeParam {
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn default_type(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1955,7 +1957,7 @@ impl ast::NameOwner for ConstParam {}
 impl ast::AttrsOwner for ConstParam {}
 impl ast::TypeAscriptionOwner for ConstParam {}
 impl ConstParam {
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1975,7 +1977,7 @@ impl AstNode for LifetimeParam {
 }
 impl ast::AttrsOwner for LifetimeParam {}
 impl LifetimeParam {
-    pub fn lifetime(&self) -> Option<Lifetime> { support::token(&self.syntax) }
+    pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TypeBound {
@@ -1993,8 +1995,8 @@ impl AstNode for TypeBound {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl TypeBound {
-    pub fn lifetime(&self) -> Option<Lifetime> { support::token(&self.syntax) }
-    pub fn const_kw(&self) -> Option<ConstKw> { support::token(&self.syntax) }
+    pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
+    pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2032,7 +2034,7 @@ impl AstNode for WherePred {
 }
 impl ast::TypeBoundsOwner for WherePred {}
 impl WherePred {
-    pub fn lifetime(&self) -> Option<Lifetime> { support::token(&self.syntax) }
+    pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2051,7 +2053,7 @@ impl AstNode for WhereClause {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl WhereClause {
-    pub fn where_kw(&self) -> Option<WhereKw> { support::token(&self.syntax) }
+    pub fn where_kw_token(&self) -> Option<WhereKw> { support::token(&self.syntax) }
     pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2070,7 +2072,7 @@ impl AstNode for Abi {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl Abi {
-    pub fn string(&self) -> Option<String> { support::token(&self.syntax) }
+    pub fn string_token(&self) -> Option<String> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ExprStmt {
@@ -2090,7 +2092,7 @@ impl AstNode for ExprStmt {
 impl ast::AttrsOwner for ExprStmt {}
 impl ExprStmt {
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn semi(&self) -> Option<Semi> { support::token(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct LetStmt {
@@ -2110,10 +2112,11 @@ impl AstNode for LetStmt {
 impl ast::AttrsOwner for LetStmt {}
 impl ast::TypeAscriptionOwner for LetStmt {}
 impl LetStmt {
-    pub fn let_kw(&self) -> Option<LetKw> { support::token(&self.syntax) }
+    pub fn let_kw_token(&self) -> Option<LetKw> { support::token(&self.syntax) }
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) }
+    pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Condition {
@@ -2131,9 +2134,9 @@ impl AstNode for Condition {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl Condition {
-    pub fn let_kw(&self) -> Option<LetKw> { support::token(&self.syntax) }
+    pub fn let_kw_token(&self) -> Option<LetKw> { support::token(&self.syntax) }
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2154,10 +2157,10 @@ impl AstNode for Block {
 impl ast::AttrsOwner for Block {}
 impl ast::ModuleItemOwner for Block {}
 impl Block {
-    pub fn l_curly(&self) -> Option<LCurly> { support::token(&self.syntax) }
+    pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) }
     pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
-    pub fn r_curly(&self) -> Option<RCurly> { support::token(&self.syntax) }
+    pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ParamList {
@@ -2175,10 +2178,10 @@ impl AstNode for ParamList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl ParamList {
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
     pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct SelfParam {
@@ -2198,9 +2201,9 @@ impl AstNode for SelfParam {
 impl ast::TypeAscriptionOwner for SelfParam {}
 impl ast::AttrsOwner for SelfParam {}
 impl SelfParam {
-    pub fn amp(&self) -> Option<Amp> { support::token(&self.syntax) }
-    pub fn lifetime(&self) -> Option<Lifetime> { support::token(&self.syntax) }
-    pub fn self_kw(&self) -> Option<SelfKw> { support::token(&self.syntax) }
+    pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) }
+    pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
+    pub fn self_kw_token(&self) -> Option<SelfKw> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Param {
@@ -2221,7 +2224,7 @@ impl ast::TypeAscriptionOwner for Param {}
 impl ast::AttrsOwner for Param {}
 impl Param {
     pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
-    pub fn dotdotdot(&self) -> Option<Dotdotdot> { support::token(&self.syntax) }
+    pub fn dotdotdot_token(&self) -> Option<Dotdotdot> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct UseItem {
@@ -2241,7 +2244,7 @@ impl AstNode for UseItem {
 impl ast::AttrsOwner for UseItem {}
 impl ast::VisibilityOwner for UseItem {}
 impl UseItem {
-    pub fn use_kw(&self) -> Option<UseKw> { support::token(&self.syntax) }
+    pub fn use_kw_token(&self) -> Option<UseKw> { support::token(&self.syntax) }
     pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2261,7 +2264,7 @@ impl AstNode for UseTree {
 }
 impl UseTree {
     pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
-    pub fn star(&self) -> Option<Star> { support::token(&self.syntax) }
+    pub fn star_token(&self) -> Option<Star> { support::token(&self.syntax) }
     pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) }
     pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) }
 }
@@ -2282,7 +2285,7 @@ impl AstNode for Alias {
 }
 impl ast::NameOwner for Alias {}
 impl Alias {
-    pub fn as_kw(&self) -> Option<AsKw> { support::token(&self.syntax) }
+    pub fn as_kw_token(&self) -> Option<AsKw> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct UseTreeList {
@@ -2300,9 +2303,9 @@ impl AstNode for UseTreeList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl UseTreeList {
-    pub fn l_curly(&self) -> Option<LCurly> { support::token(&self.syntax) }
+    pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) }
     pub fn use_trees(&self) -> AstChildren<UseTree> { support::children(&self.syntax) }
-    pub fn r_curly(&self) -> Option<RCurly> { support::token(&self.syntax) }
+    pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ExternCrateItem {
@@ -2322,8 +2325,8 @@ impl AstNode for ExternCrateItem {
 impl ast::AttrsOwner for ExternCrateItem {}
 impl ast::VisibilityOwner for ExternCrateItem {}
 impl ExternCrateItem {
-    pub fn extern_kw(&self) -> Option<ExternKw> { support::token(&self.syntax) }
-    pub fn crate_kw(&self) -> Option<CrateKw> { support::token(&self.syntax) }
+    pub fn extern_kw_token(&self) -> Option<ExternKw> { support::token(&self.syntax) }
+    pub fn crate_kw_token(&self) -> Option<CrateKw> { support::token(&self.syntax) }
     pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
     pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) }
 }
@@ -2343,9 +2346,9 @@ impl AstNode for ArgList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl ArgList {
-    pub fn l_paren(&self) -> Option<LParen> { support::token(&self.syntax) }
+    pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) }
     pub fn args(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
-    pub fn r_paren(&self) -> Option<RParen> { support::token(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Path {
@@ -2382,14 +2385,14 @@ impl AstNode for PathSegment {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl PathSegment {
-    pub fn coloncolon(&self) -> Option<Coloncolon> { support::token(&self.syntax) }
-    pub fn l_angle(&self) -> Option<LAngle> { support::token(&self.syntax) }
+    pub fn coloncolon_token(&self) -> Option<Coloncolon> { support::token(&self.syntax) }
+    pub fn l_angle_token(&self) -> Option<LAngle> { support::token(&self.syntax) }
     pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
     pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) }
     pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
     pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
     pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) }
-    pub fn r_angle(&self) -> Option<RAngle> { support::token(&self.syntax) }
+    pub fn r_angle_token(&self) -> Option<RAngle> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TypeArgList {
@@ -2407,14 +2410,14 @@ impl AstNode for TypeArgList {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl TypeArgList {
-    pub fn coloncolon(&self) -> Option<Coloncolon> { support::token(&self.syntax) }
-    pub fn l_angle(&self) -> Option<LAngle> { support::token(&self.syntax) }
+    pub fn coloncolon_token(&self) -> Option<Coloncolon> { support::token(&self.syntax) }
+    pub fn l_angle_token(&self) -> Option<LAngle> { support::token(&self.syntax) }
     pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) }
     pub fn type_args(&self) -> AstChildren<TypeArg> { support::children(&self.syntax) }
     pub fn lifetime_args(&self) -> AstChildren<LifetimeArg> { support::children(&self.syntax) }
     pub fn assoc_type_args(&self) -> AstChildren<AssocTypeArg> { support::children(&self.syntax) }
     pub fn const_args(&self) -> AstChildren<ConstArg> { support::children(&self.syntax) }
-    pub fn r_angle(&self) -> Option<RAngle> { support::token(&self.syntax) }
+    pub fn r_angle_token(&self) -> Option<RAngle> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct TypeArg {
@@ -2452,7 +2455,7 @@ impl AstNode for AssocTypeArg {
 impl ast::TypeBoundsOwner for AssocTypeArg {}
 impl AssocTypeArg {
     pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2471,7 +2474,7 @@ impl AstNode for LifetimeArg {
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
 impl LifetimeArg {
-    pub fn lifetime(&self) -> Option<Lifetime> { support::token(&self.syntax) }
+    pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ConstArg {
@@ -2490,7 +2493,7 @@ impl AstNode for ConstArg {
 }
 impl ConstArg {
     pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2548,9 +2551,9 @@ impl AstNode for ExternItemList {
 impl ast::FnDefOwner for ExternItemList {}
 impl ast::ModuleItemOwner for ExternItemList {}
 impl ExternItemList {
-    pub fn l_curly(&self) -> Option<LCurly> { support::token(&self.syntax) }
+    pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) }
     pub fn extern_items(&self) -> AstChildren<ExternItem> { support::children(&self.syntax) }
-    pub fn r_curly(&self) -> Option<RCurly> { support::token(&self.syntax) }
+    pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ExternBlock {
@@ -2588,7 +2591,7 @@ impl AstNode for MetaItem {
 }
 impl MetaItem {
     pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
-    pub fn eq(&self) -> Option<Eq> { support::token(&self.syntax) }
+    pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
     pub fn attr_input(&self) -> Option<AttrInput> { support::child(&self.syntax) }
     pub fn nested_meta_items(&self) -> AstChildren<MetaItem> { support::children(&self.syntax) }
 }
diff --git a/crates/ra_tt/src/lib.rs b/crates/ra_tt/src/lib.rs
index 5248e026c5..bd484aa30a 100644
--- a/crates/ra_tt/src/lib.rs
+++ b/crates/ra_tt/src/lib.rs
@@ -57,7 +57,7 @@ pub enum Leaf {
 }
 impl_froms!(Leaf: Literal, Punct, Ident);
 
-#[derive(Clone, PartialEq, Eq, Hash, Default)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]
 pub struct Subtree {
     pub delimiter: Option<Delimiter>,
     pub token_trees: Vec<TokenTree>,
@@ -101,61 +101,6 @@ pub struct Ident {
     pub id: TokenId,
 }
 
-fn print_debug_subtree(f: &mut fmt::Formatter<'_>, subtree: &Subtree, level: usize) -> fmt::Result {
-    let align = std::iter::repeat("  ").take(level).collect::<String>();
-
-    let aux = match subtree.delimiter.map(|it| (it.kind, it.id.0)) {
-        None => "$".to_string(),
-        Some((DelimiterKind::Parenthesis, id)) => format!("() {}", id),
-        Some((DelimiterKind::Brace, id)) => format!("{{}} {}", id),
-        Some((DelimiterKind::Bracket, id)) => format!("[] {}", id),
-    };
-
-    if subtree.token_trees.is_empty() {
-        write!(f, "{}SUBTREE {}", align, aux)?;
-    } else {
-        writeln!(f, "{}SUBTREE {}", align, aux)?;
-        for (idx, child) in subtree.token_trees.iter().enumerate() {
-            print_debug_token(f, child, level + 1)?;
-            if idx != subtree.token_trees.len() - 1 {
-                writeln!(f, "")?;
-            }
-        }
-    }
-
-    Ok(())
-}
-
-fn print_debug_token(f: &mut fmt::Formatter<'_>, tkn: &TokenTree, level: usize) -> fmt::Result {
-    let align = std::iter::repeat("  ").take(level).collect::<String>();
-
-    match tkn {
-        TokenTree::Leaf(leaf) => match leaf {
-            Leaf::Literal(lit) => write!(f, "{}LITERAL {} {}", align, lit.text, lit.id.0)?,
-            Leaf::Punct(punct) => write!(
-                f,
-                "{}PUNCH   {} [{}] {}",
-                align,
-                punct.char,
-                if punct.spacing == Spacing::Alone { "alone" } else { "joint" },
-                punct.id.0
-            )?,
-            Leaf::Ident(ident) => write!(f, "{}IDENT   {} {}", align, ident.text, ident.id.0)?,
-        },
-        TokenTree::Subtree(subtree) => {
-            print_debug_subtree(f, subtree, level)?;
-        }
-    }
-
-    Ok(())
-}
-
-impl Debug for Subtree {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        print_debug_subtree(f, self, 0)
-    }
-}
-
 impl fmt::Display for TokenTree {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match self {
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs
index eba66ff4d9..74a87e9009 100644
--- a/xtask/src/ast_src.rs
+++ b/xtask/src/ast_src.rs
@@ -408,7 +408,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
         struct TupleType { LParen, fields: [TypeRef], RParen }
         struct NeverType { Excl }
         struct PathType { Path }
-        struct PointerType { Star, ConstKw, TypeRef }
+        struct PointerType { Star, ConstKw, MutKw, TypeRef }
         struct ArrayType { LBrack, TypeRef, Semi, Expr, RBrack }
         struct SliceType { LBrack, TypeRef, RBrack }
         struct ReferenceType { Amp, Lifetime, MutKw, TypeRef }
@@ -485,7 +485,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
         struct ParenPat { LParen, Pat, RParen }
         struct RefPat { Amp, MutKw, Pat }
         struct BoxPat { BoxKw, Pat }
-        struct BindPat: AttrsOwner, NameOwner { RefKw, MutKw, Pat }
+        struct BindPat: AttrsOwner, NameOwner { RefKw, MutKw, At, Pat }
         struct PlaceholderPat { Underscore }
         struct DotDotPat { Dotdot }
         struct PathPat { Path }
@@ -545,6 +545,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
             Pat,
             Eq,
             initializer: Expr,
+            Semi,
         }
         struct Condition { LetKw, Pat, Eq, Expr }
         struct Block: AttrsOwner, ModuleItemOwner {
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs
index 6657c9fc5f..b5594e3a98 100644
--- a/xtask/src/codegen/gen_syntax.rs
+++ b/xtask/src/codegen/gen_syntax.rs
@@ -208,6 +208,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> {
                 FieldSrc::Optional(_) | FieldSrc::Shorthand => {
                     let is_token = token_kinds.contains(&ty.to_string());
                     if is_token {
+                        let method_name = format_ident!("{}_token", method_name);
                         quote! {
                             pub fn #method_name(&self) -> Option<#ty> {
                                 support::token(&self.syntax)


Test patch:
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs
index ac09662368..f97e0bfebc 100644
--- a/crates/ra_hir_ty/src/tests.rs
+++ b/crates/ra_hir_ty/src/tests.rs
@@ -101,7 +101,7 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String {
             let node = src_ptr.value.to_node(&src_ptr.file_syntax(&db));
 
             let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) {
-                (self_param.self_kw().unwrap().syntax().text_range(), "self".to_string())
+                (self_param.self_kw_token().unwrap().syntax().text_range(), "self".to_string())
             } else {
                 (src_ptr.value.range(), node.text().to_string().replace("\n", " "))
             };
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs
index 1ef6f6eedd..254318e239 100644
--- a/crates/ra_mbe/src/tests.rs
+++ b/crates/ra_mbe/src/tests.rs
@@ -141,79 +141,6 @@ macro_rules! impl_froms {
         );
 }
 
-#[test]
-fn test_convert_tt2() {
-    parse_macro(
-        r#"
-macro_rules! impl_froms {
-    ($e:ident: $($v:ident),*) => {
-        $(
-            impl From<$v> for $e {
-                fn from(it: $v) -> $e {
-                    $e::$v(it)
-                }
-            }
-        )*
-    }
-}
-"#,
-    )
-    .assert_expand(
-        "impl_froms!(TokenTree: Leaf, Subtree);",
-        r#"
-SUBTREE $
-  IDENT   impl 20
-  IDENT   From 21
-  PUNCH   < [joint] 22
-  IDENT   Leaf 53
-  PUNCH   > [alone] 25
-  IDENT   for 26
-  IDENT   TokenTree 51
-  SUBTREE {} 29
-    IDENT   fn 30
-    IDENT   from 31
-    SUBTREE () 32
-      IDENT   it 33
-      PUNCH   : [alone] 34
-      IDENT   Leaf 53
-    PUNCH   - [joint] 37
-    PUNCH   > [alone] 38
-    IDENT   TokenTree 51
-    SUBTREE {} 41
-      IDENT   TokenTree 51
-      PUNCH   : [joint] 44
-      PUNCH   : [joint] 45
-      IDENT   Leaf 53
-      SUBTREE () 48
-        IDENT   it 49
-  IDENT   impl 20
-  IDENT   From 21
-  PUNCH   < [joint] 22
-  IDENT   Subtree 55
-  PUNCH   > [alone] 25
-  IDENT   for 26
-  IDENT   TokenTree 51
-  SUBTREE {} 29
-    IDENT   fn 30
-    IDENT   from 31
-    SUBTREE () 32
-      IDENT   it 33
-      PUNCH   : [alone] 34
-      IDENT   Subtree 55
-    PUNCH   - [joint] 37
-    PUNCH   > [alone] 38
-    IDENT   TokenTree 51
-    SUBTREE {} 41
-      IDENT   TokenTree 51
-      PUNCH   : [joint] 44
-      PUNCH   : [joint] 45
-      IDENT   Subtree 55
-      SUBTREE () 48
-        IDENT   it 49
-"#,
-    );
-}
-
 #[test]
 fn test_expr_order() {
     let expanded = parse_macro(
@@ -1552,12 +1479,6 @@ impl MacroFixture {
         assert_eq!(expansion.to_string(), expected);
     }
 
-    fn assert_expand(&self, invocation: &str, expected: &str) {
-        let expansion = self.expand_tt(invocation);
-        let actual = format!("{:?}", expansion);
-        test_utils::assert_eq_text!(&actual.trim(), &expected.trim());
-    }
-
     fn assert_expand_items(&self, invocation: &str, expected: &str) -> &MacroFixture {
         self.assert_expansion(FragmentKind::Items, invocation, expected);
         self