Implement RFC 3503: frontmatters

Supercedes #137193
This commit is contained in:
Deadbeef 2025-04-12 15:53:46 +00:00
parent 39c198d823
commit 9fce1dfac5
5 changed files with 18 additions and 1 deletions

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]) }
}