-
Notifications
You must be signed in to change notification settings - Fork 136
/
ast.go
85 lines (63 loc) · 1.4 KB
/
ast.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package yamlmeta
import (
"github.com/k14s/ytt/pkg/filepos"
)
type Node interface {
GetPosition() *filepos.Position
GetValues() []interface{} // ie children
SetValue(interface{}) error
AddValue(interface{}) error
ResetValue()
GetMetas() []*Meta
addMeta(*Meta)
GetAnnotations() interface{}
SetAnnotations(interface{})
DeepCopyAsInterface() interface{}
DeepCopyAsNode() Node
_private()
}
var _ []Node = []Node{&DocumentSet{}, &Document{}, &Map{}, &MapItem{}, &Array{}, &ArrayItem{}}
type DocumentSet struct {
Metas []*Meta
AllMetas []*Meta
Items []*Document
Position *filepos.Position
annotations interface{}
originalBytes *[]byte
}
type Document struct {
Metas []*Meta
Value interface{}
Position *filepos.Position
annotations interface{}
injected bool // indicates that Document was not present in the parsed content
}
type Map struct {
Metas []*Meta
Items []*MapItem
Position *filepos.Position
annotations interface{}
}
type MapItem struct {
Metas []*Meta
Key interface{}
Value interface{}
Position *filepos.Position
annotations interface{}
}
type Array struct {
Metas []*Meta
Items []*ArrayItem
Position *filepos.Position
annotations interface{}
}
type ArrayItem struct {
Metas []*Meta
Value interface{}
Position *filepos.Position
annotations interface{}
}
type Meta struct {
Data string
Position *filepos.Position
}