Merge pull request #19388 from Veykril/push-oqysrnttwywu

feat: parse `unsafe` record fields
This commit is contained in:
Lukas Wirth 2025-03-25 08:12:20 +00:00 committed by GitHub
commit 749fde9017
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 39 additions and 9 deletions

View file

@ -240,7 +240,7 @@ RecordFieldList =
'{' fields:(RecordField (',' RecordField)* ','?)? '}'
RecordField =
Attr* Visibility?
Attr* Visibility? 'unsafe'?
Name ':' Type ('=' Expr)?
TupleFieldList =

View file

@ -1337,6 +1337,8 @@ impl RecordField {
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
#[inline]
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
}
pub struct RecordFieldList {
pub(crate) syntax: SyntaxNode,