mirror of
https://github.com/usememos/memos.git
synced 2024-12-20 01:31:29 +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)
|
||
|
}
|