mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
258 B
Go
20 lines
258 B
Go
2 years ago
|
package ast
|
||
|
|
||
|
type Node struct {
|
||
|
Type string
|
||
|
Text string
|
||
|
Children []*Node
|
||
|
}
|
||
|
|
||
|
type Document struct {
|
||
|
Nodes []*Node
|
||
|
}
|
||
|
|
||
|
func NewDocument() *Document {
|
||
|
return &Document{}
|
||
|
}
|
||
|
|
||
|
func (d *Document) AddNode(node *Node) {
|
||
|
d.Nodes = append(d.Nodes, node)
|
||
|
}
|