From daed5fb235de2f2c50e84ecc65c4f8cc5d9415f4 Mon Sep 17 00:00:00 2001 From: usbharu Date: Fri, 15 Nov 2024 02:04:03 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=91=E3=83=BC=E3=82=B5=E4=BD=9C?= =?UTF-8?q?=E3=82=8A=E5=A7=8B=E3=82=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/dev/usbharu/markdown/AstNode.kt | 19 +++++++++++++++++++ .../kotlin/dev/usbharu/markdown/Parser.kt | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 library/src/commonMain/kotlin/dev/usbharu/markdown/AstNode.kt create mode 100644 library/src/commonMain/kotlin/dev/usbharu/markdown/Parser.kt 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