use oak_core::{ElementType, TokenType, UniversalElementRole, UniversalTokenRole};
use serde::{Deserialize, Serialize};
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum NoteSyntaxKind {
Text,
Whitespace,
Newline,
Heading1,
Heading2,
Heading3,
Heading4,
Heading5,
Heading6,
HeadingText,
Emphasis, Strong, Strikethrough,
InlineCode, CodeBlock, CodeFence, CodeLanguage,
Link,
LinkText,
LinkUrl,
LinkTitle,
Image,
ImageAlt,
ImageUrl,
ImageTitle,
UnorderedList,
OrderedList,
ListItem,
ListMarker, TaskList,
TaskMarker,
Blockquote,
BlockquoteMarker,
HorizontalRule,
Table,
TableRow,
TableCell,
TableHeader,
TableSeparator, TableAlignment,
HtmlTag,
HtmlComment,
Escape,
LeftBracket, RightBracket, LeftParen, RightParen, LeftAngle, RightAngle, Asterisk, Underscore, Backtick, Tilde, Hash, Pipe, Dash, Plus, Dot, Colon, Exclamation,
Error,
Root,
Document,
Paragraph,
Metadata,
Eof,
}
impl TokenType for NoteSyntaxKind {
const END_OF_STREAM: Self = Self::Eof;
type Role = UniversalTokenRole;
fn role(&self) -> Self::Role {
match self {
Self::Whitespace | Self::Newline => UniversalTokenRole::Whitespace,
Self::HtmlComment => UniversalTokenRole::Comment,
Self::Eof => UniversalTokenRole::Eof,
_ => UniversalTokenRole::None,
}
}
}
impl ElementType for NoteSyntaxKind {
type Role = UniversalElementRole;
fn role(&self) -> Self::Role {
match self {
Self::Error => UniversalElementRole::Error,
_ => UniversalElementRole::None,
}
}
}