Skip to content

Commit

Permalink
chore: update node type
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Jan 31, 2024
1 parent fe6ddcf commit 224a9a6
Showing 1 changed file with 34 additions and 32 deletions.
66 changes: 34 additions & 32 deletions ast/ast.go
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
package ast

type NodeType uint32
type NodeType string

// Block nodes.
const (
UnknownNode NodeType = iota
// Block nodes.
LineBreakNode
ParagraphNode
CodeBlockNode
HeadingNode
HorizontalRuleNode
BlockquoteNode
OrderedListNode
UnorderedListNode
TaskListNode
MathBlockNode
TableNode
EmbeddedContentNode
// Inline nodes.
TextNode
BoldNode
ItalicNode
BoldItalicNode
CodeNode
ImageNode
LinkNode
AutoLinkNode
TagNode
StrikethroughNode
EscapingCharacterNode
MathNode
HighlightNode
SubscriptNode
SuperscriptNode
ReferencedContentNode
LineBreakNode NodeType = "LINE_BREAK"
ParagraphNode NodeType = "PARAGRAPH"
CodeBlockNode NodeType = "CODE_BLOCK"
HeadingNode NodeType = "HEADING"
HorizontalRuleNode NodeType = "HORIZONTAL_RULE"
BlockquoteNode NodeType = "BLOCKQUOTE"
OrderedListNode NodeType = "ORDERED_LIST"
UnorderedListNode NodeType = "UNORDERED_LIST"
TaskListNode NodeType = "TASK_LIST"
MathBlockNode NodeType = "MATH_BLOCK"
TableNode NodeType = "TABLE"
EmbeddedContentNode NodeType = "EMBEDDED_CONTENT"
)

// Inline nodes.
const (
TextNode NodeType = "TEXT"
BoldNode NodeType = "BOLD"
ItalicNode NodeType = "ITALIC"
BoldItalicNode NodeType = "BOLD_ITALIC"
CodeNode NodeType = "CODE"
ImageNode NodeType = "IMAGE"
LinkNode NodeType = "LINK"
AutoLinkNode NodeType = "AUTO_LINK"
TagNode NodeType = "TAG"
StrikethroughNode NodeType = "STRIKETHROUGH"
EscapingCharacterNode NodeType = "ESCAPING_CHARACTER"
MathNode NodeType = "MATH"
HighlightNode NodeType = "HIGHLIGHT"
SubscriptNode NodeType = "SUBSCRIPT"
SuperscriptNode NodeType = "SUPERSCRIPT"
ReferencedContentNode NodeType = "REFERENCED_CONTENT"
)

type Node interface {
Expand Down

0 comments on commit 224a9a6

Please sign in to comment.