mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-02 08:37:42 +00:00
Parse outer attributes on StructPatternEtCetera
This commit is contained in:
parent
237ea0d34d
commit
0ee6b70b34
6 changed files with 103 additions and 32 deletions
|
@ -1175,6 +1175,7 @@ impl BoxPat {
|
|||
pub struct RestPat {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
impl ast::HasAttrs for RestPat {}
|
||||
impl RestPat {
|
||||
pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
|
||||
}
|
||||
|
@ -1289,7 +1290,7 @@ pub struct RecordPatFieldList {
|
|||
impl RecordPatFieldList {
|
||||
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
|
||||
pub fn fields(&self) -> AstChildren<RecordPatField> { support::children(&self.syntax) }
|
||||
pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
|
||||
pub fn rest_pat(&self) -> Option<RestPat> { support::child(&self.syntax) }
|
||||
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
|
||||
}
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
|
@ -3687,6 +3688,7 @@ impl AstNode for AnyHasAttrs {
|
|||
| MATCH_ARM_LIST
|
||||
| MATCH_ARM
|
||||
| IDENT_PAT
|
||||
| REST_PAT
|
||||
| RECORD_PAT_FIELD => true,
|
||||
_ => false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue