Debian Codegraph @

extension/ast/tasklist.go

raw symbols SCIP
1 package ast
2
3 import (
4 "fmt"
5
6 gast "github.com/yuin/goldmark/ast"
7 )
8
9 // A TaskCheckBox struct represents a checkbox of a task list.
10 type TaskCheckBox struct {
11 gast.BaseInline
12 IsChecked bool
13 }
14
15 // Dump implements Node.Dump.
16 func (n *TaskCheckBox) Dump(source []byte, level int) {
17 m := map[string]string{
18 "Checked": fmt.Sprintf("%v", n.IsChecked),
19 }
20 gast.DumpHelper(n, source, level, m, nil)
21 }
22
23 // KindTaskCheckBox is a NodeKind of the TaskCheckBox node.
24 var KindTaskCheckBox = gast.NewNodeKind("TaskCheckBox")
25
26 // Kind implements Node.Kind.
27 func (n *TaskCheckBox) Kind() gast.NodeKind {
28 return KindTaskCheckBox
29 }
30
31 // NewTaskCheckBox returns a new TaskCheckBox node.
32 func NewTaskCheckBox(checked bool) *TaskCheckBox {
33 return &TaskCheckBox{
34 IsChecked: checked,
35 }
36 }