chore: implement gomark skeleton

This commit is contained in:
Steven
2023-12-12 23:24:02 +08:00
parent 7f1f6f77a0
commit aa3632e2ac
15 changed files with 393 additions and 172 deletions

View File

@@ -0,0 +1,42 @@
package ast
type BaseInline struct{}
type Text struct {
BaseInline
Content string
}
var NodeTypeText = NewNodeType("Text")
func NewText(content string) *Text {
return &Text{
Content: content,
}
}
func (*Text) Type() NodeType {
return NodeTypeText
}
type Bold struct {
BaseInline
// Symbol is "*" or "_"
Symbol string
Content string
}
var NodeTypeBold = NewNodeType("Bold")
func NewBold(symbol, content string) *Bold {
return &Bold{
Symbol: symbol,
Content: content,
}
}
func (*Bold) Type() NodeType {
return NodeTypeBold
}