chore: implement part of nodes

This commit is contained in:
Steven
2023-12-13 09:06:47 +08:00
parent dd83782522
commit b20e0097cf
16 changed files with 227 additions and 142 deletions

View File

@ -24,7 +24,9 @@ func (*TextParser) Match(tokens []*tokenizer.Token) (int, bool) {
func (*TextParser) Parse(tokens []*tokenizer.Token) ast.Node {
if len(tokens) == 0 {
return ast.NewText("")
return &ast.Text{}
}
return &ast.Text{
Content: tokens[0].String(),
}
return ast.NewText(tokens[0].String())
}