| 1 | package internal |
| 2 | |
| 3 | // Document represents a KDL document. |
| 4 | type Document struct { |
| 5 | Nodes []*Node |
| 6 | } |
| 7 | |
| 8 | // Node represents a KDL node. |
| 9 | type Node struct { |
| 10 | Name string |
| 11 | Type string // type annotation, empty if none |
| 12 | Arguments []*Value |
| 13 | Properties []*Property // ordered |
| 14 | Children []*Node |
| 15 | } |
| 16 | |
| 17 | // Property represents a KDL property (key=value pair on a node). |
| 18 | type Property struct { |
| 19 | Key string |
| 20 | Value *Value |
| 21 | } |
| 22 | |
| 23 | // Value represents a KDL value with optional type annotation. |
| 24 | type Value struct { |
| 25 | Type string // type annotation, empty if none |
| 26 | Value interface{} // string, int64, float64, bool, or nil |
| 27 | } |