mirror of
https://github.com/usememos/memos.git
synced 2024-12-26 12:52:27 +03:00
13 lines
179 B
Go
13 lines
179 B
Go
|
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)
|
||
|
}
|