Debian Codegraph @

extension/ast/definition_list.go

raw symbols SCIP
1 package ast
2
3 import (
4 gast "github.com/yuin/goldmark/ast"
5 )
6
7 // A DefinitionList struct represents a definition list of Markdown
8 // (PHPMarkdownExtra) text.
9 type DefinitionList struct {
10 gast.BaseBlock
11 Offset int
12 TemporaryParagraph *gast.Paragraph
13 }
14
15 // Dump implements Node.Dump.
16 func (n *DefinitionList) Dump(source []byte, level int) {
17 gast.DumpHelper(n, source, level, nil, nil)
18 }
19
20 // Pos implements Node.Pos.
21 func (n *DefinitionList) Pos() int {
22 if n.FirstChild() != nil {
23 return n.FirstChild().Pos()
24 }
25 return -1
26 }
27
28 // KindDefinitionList is a NodeKind of the DefinitionList node.
29 var KindDefinitionList = gast.NewNodeKind("DefinitionList")
30
31 // Kind implements Node.Kind.
32 func (n *DefinitionList) Kind() gast.NodeKind {
33 return KindDefinitionList
34 }
35
36 // NewDefinitionList returns a new DefinitionList node.
37 func NewDefinitionList(offset int, para *gast.Paragraph) *DefinitionList {
38 return &DefinitionList{
39 Offset: offset,
40 TemporaryParagraph: para,
41 }
42 }
43
44 // A DefinitionTerm struct represents a definition list term of Markdown
45 // (PHPMarkdownExtra) text.
46 type DefinitionTerm struct {
47 gast.BaseBlock
48 }
49
50 // Dump implements Node.Dump.
51 func (n *DefinitionTerm) Dump(source []byte, level int) {
52 gast.DumpHelper(n, source, level, nil, nil)
53 }
54
55 // Pos implements Node.Pos.
56 func (n *DefinitionTerm) Pos() int {
57 if n.Lines().Len() == 0 {
58 return -1
59 }
60 return n.Lines().At(0).Start
61 }
62
63 // KindDefinitionTerm is a NodeKind of the DefinitionTerm node.
64 var KindDefinitionTerm = gast.NewNodeKind("DefinitionTerm")
65
66 // Kind implements Node.Kind.
67 func (n *DefinitionTerm) Kind() gast.NodeKind {
68 return KindDefinitionTerm
69 }
70
71 // NewDefinitionTerm returns a new DefinitionTerm node.
72 func NewDefinitionTerm() *DefinitionTerm {
73 return &DefinitionTerm{}
74 }
75
76 // A DefinitionDescription struct represents a definition list description of Markdown
77 // (PHPMarkdownExtra) text.
78 type DefinitionDescription struct {
79 gast.BaseBlock
80 IsTight bool
81 }
82
83 // Dump implements Node.Dump.
84 func (n *DefinitionDescription) Dump(source []byte, level int) {
85 gast.DumpHelper(n, source, level, nil, nil)
86 }
87
88 // KindDefinitionDescription is a NodeKind of the DefinitionDescription node.
89 var KindDefinitionDescription = gast.NewNodeKind("DefinitionDescription")
90
91 // Kind implements Node.Kind.
92 func (n *DefinitionDescription) Kind() gast.NodeKind {
93 return KindDefinitionDescription
94 }
95
96 // NewDefinitionDescription returns a new DefinitionDescription node.
97 func NewDefinitionDescription() *DefinitionDescription {
98 return &DefinitionDescription{}
99 }