use oak_core::{ElementType, UniversalElementRole};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u8)]
pub enum DotElementType {
Identifier,
String,
Number,
Whitespace,
Newline,
Graph,
Digraph,
Subgraph,
Node,
Edge,
Strict,
Arrow, Line, Equal, Semicolon, Comma,
LeftBrace, RightBrace, LeftBracket, RightBracket, LeftParen, RightParen,
Comment,
Root,
Error,
Eof,
}
impl ElementType for DotElementType {
type Role = UniversalElementRole;
fn role(&self) -> Self::Role {
match self {
_ => UniversalElementRole::None,
}
}
}
impl From<crate::lexer::token_type::DotTokenType> for DotElementType {
fn from(token: crate::lexer::token_type::DotTokenType) -> Self {
unsafe { std::mem::transmute(token) }
}
}