Merge from rust-lang/rust

This commit is contained in:
Laurențiu Nicola 2025-05-20 10:01:00 +03:00
commit 9e86544698
10 changed files with 25 additions and 7 deletions

View file

@ -133,6 +133,7 @@ Meta =
SourceFile =
'#shebang'?
'#frontmatter'?
Attr*
Item*

View file

@ -1524,6 +1524,10 @@ impl ast::HasAttrs for SourceFile {}
impl ast::HasDocComments for SourceFile {}
impl ast::HasModuleItem for SourceFile {}
impl SourceFile {
#[inline]
pub fn frontmatter_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![frontmatter])
}
#[inline]
pub fn shebang_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![shebang]) }
}