use oak_core::{ElementType, UniversalElementRole};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u16)]
pub enum GroovyElementType {
Root,
SourceFile,
IntLiteral,
FloatLiteral,
StringLiteral,
CharLiteral,
BooleanLiteral,
NullLiteral,
Identifier,
AbstractKeyword,
AsKeyword,
AssertKeyword,
BreakKeyword,
CaseKeyword,
CatchKeyword,
ClassKeyword,
ConstKeyword,
ContinueKeyword,
DefKeyword,
DefaultKeyword,
DoKeyword,
ElseKeyword,
EnumKeyword,
ExtendsKeyword,
FinalKeyword,
FinallyKeyword,
ForKeyword,
GotoKeyword,
IfKeyword,
ImplementsKeyword,
ImportKeyword,
InKeyword,
InstanceofKeyword,
InterfaceKeyword,
NativeKeyword,
NewKeyword,
PackageKeyword,
PrivateKeyword,
ProtectedKeyword,
PublicKeyword,
ReturnKeyword,
StaticKeyword,
StrictfpKeyword,
SuperKeyword,
SwitchKeyword,
SynchronizedKeyword,
ThisKeyword,
ThrowKeyword,
ThrowsKeyword,
TraitKeyword,
TransientKeyword,
TryKeyword,
VoidKeyword,
VolatileKeyword,
WhileKeyword,
Plus,
Minus,
Star,
Slash,
Percent,
Power,
Assign,
PlusAssign,
MinusAssign,
StarAssign,
SlashAssign,
PercentAssign,
PowerAssign,
Equal,
NotEqual,
Less,
Greater,
LessEqual,
GreaterEqual,
Spaceship,
LogicalAnd,
LogicalOr,
LogicalNot,
BitAnd,
BitOr,
BitXor,
BitNot,
LeftShift,
RightShift,
UnsignedRightShift,
Increment,
Decrement,
Question,
Colon,
Elvis,
SafeNavigation,
LeftParen,
RightParen,
LeftBracket,
RightBracket,
LeftBrace,
RightBrace,
Comma,
Period,
Semicolon,
At,
Whitespace,
Comment,
Newline,
Eof,
Error,
}
impl ElementType for GroovyElementType {
type Role = UniversalElementRole;
fn role(&self) -> Self::Role {
match self {
Self::Root => UniversalElementRole::Root,
_ => UniversalElementRole::None,
}
}
}
impl From<crate::lexer::token_type::GroovyTokenType> for GroovyElementType {
fn from(token: crate::lexer::token_type::GroovyTokenType) -> Self {
unsafe { std::mem::transmute(token) }
}
}