feat: Implement default-field-values

This commit is contained in:
Shoyu Vanilla 2025-01-23 00:27:31 +09:00
parent 35b55fd67f
commit 7de0b2e75a
33 changed files with 647 additions and 31 deletions

View file

@ -1538,10 +1538,14 @@ impl ast::HasDocComments for RecordField {}
impl ast::HasName for RecordField {}
impl ast::HasVisibility for RecordField {}
impl RecordField {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
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![=]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]