#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SyntaxKind<'a> {
Expression,
IdentifierExpression(&'a str),
NumberExpression(u64),
StringExpression(&'a str),
BooleanExpression(bool),
NullExpression,
Element,
Fragment,
FragmentOpening,
FragmentClosing,
Opening {
self_closing: bool,
},
Closing,
Intrinsic(&'a str),
Component(&'a str),
Member,
Property(&'a str),
Attribute(&'a str),
AttributeName(&'a str),
AttributeString(&'a str),
SpreadAttribute,
Container,
Empty,
Text(&'a str),
SpreadChild,
}
impl SyntaxKind<'_> {
#[must_use]
pub const fn is_expression(self) -> bool {
matches!(
self,
Self::Expression
| Self::IdentifierExpression(_)
| Self::NumberExpression(_)
| Self::StringExpression(_)
| Self::BooleanExpression(_)
| Self::NullExpression
)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SyntaxEdge {
Enter,
Leave,
Leaf,
}