Documentation
¶
Overview ¶
Package ast defines the abstract syntax tree node types used by parsers. It provides a common Node interface that all AST nodes implement, allowing uniform traversal of syntax trees.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Kind ¶
type Kind uint
Kind identifies the type of an AST node. Each node in the syntax tree has a Kind that describes what it represents, such as a document, paragraph, heading, or inline formatting like emphasis.
const ( Any Kind = iota Attr Block BlockList Ident Label List Map Ref String // Markdown kinds Document Paragraph Heading CodeBlock Blockquote ListItem Text Emphasis // *italic* or _italic_ Strong // **bold** or __bold__ Strikethrough // ~~deleted~~ Code // `code` Link // [text](url) Image //  HorizontalRule // --- or *** or ___ LineBreak )
type Node ¶
type Node interface {
// Kind returns the type of this node (e.g., Document, Paragraph, Text).
Kind() Kind
// Children returns the immediate child nodes of this node.
// Leaf nodes (like Text) return nil.
Children() []Node
}
Node is the interface implemented by all AST nodes. It provides methods for inspecting the node's type and accessing child nodes.
Click to show internal directories.
Click to hide internal directories.