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.
13 lines
179 B
Go
13 lines
179 B
Go
2 years ago
|
package ast
|
||
|
|
||
|
func NewNode(tp, text string) *Node {
|
||
|
return &Node{
|
||
|
Type: tp,
|
||
|
Text: text,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (n *Node) AddChild(child *Node) {
|
||
|
n.Children = append(n.Children, child)
|
||
|
}
|