diff --git a/library/src/commonMain/kotlin/dev/usbharu/markdown/AstNode.kt b/library/src/commonMain/kotlin/dev/usbharu/markdown/AstNode.kt new file mode 100644 index 0000000..068b181 --- /dev/null +++ b/library/src/commonMain/kotlin/dev/usbharu/markdown/AstNode.kt @@ -0,0 +1,19 @@ +package dev.usbharu.markdown + +import kotlin.collections.List + +sealed class AstNode +data class RootNode(val node: AstNode) : AstNode() +data class BodyNode(val body: List) : AstNode() +sealed class BlockNode : AstNode() + +data class HeaderNode(val header: Int, val headerText: HeaderText?) : BlockNode() +data class HeaderText(val text: String) : BlockNode() +sealed interface QuotableNode +data class QuoteNode(val nodes: List) : AstNode(), QuotableNode +data object SeparatorNode : BlockNode() +sealed class ListNode : BlockNode() +data class DiscListNode(val node: InlineNode, val childList: List) : ListNode() +data class DecimalListNode(val node: InlineNode, val childList: List) : ListNode() + +sealed class InlineNode : AstNode(), QuotableNode \ No newline at end of file diff --git a/library/src/commonMain/kotlin/dev/usbharu/markdown/Parser.kt b/library/src/commonMain/kotlin/dev/usbharu/markdown/Parser.kt new file mode 100644 index 0000000..be319c7 --- /dev/null +++ b/library/src/commonMain/kotlin/dev/usbharu/markdown/Parser.kt @@ -0,0 +1,9 @@ +package dev.usbharu.markdown + +import kotlin.collections.List + +class Parser { + fun parse(tokens: List) { + + } +} \ No newline at end of file