Rename NodeKind to Kind.
diff --git a/decode.go b/decode.go
index 2de4bef..5b08457 100644
--- a/decode.go
+++ b/decode.go
@@ -142,7 +142,7 @@
}
}
-func (p *parser) node(kind NodeKind, defaultTag, tag, value string) *Node {
+func (p *parser) node(kind Kind, defaultTag, tag, value string) *Node {
var style Style
if tag != "" && tag != "!" {
tag = shortTag(tag)
diff --git a/yaml.go b/yaml.go
index 449ddb2..f169b6a 100644
--- a/yaml.go
+++ b/yaml.go
@@ -282,11 +282,10 @@
return fmt.Sprintf("yaml: unmarshal errors:\n %s", strings.Join(e.Errors, "\n "))
}
-
-type NodeKind uint32
+type Kind uint32
const (
- DocumentNode NodeKind = 1 << iota
+ DocumentNode Kind = 1 << iota
SequenceNode
MappingNode
ScalarNode
@@ -311,28 +310,28 @@
// by itself, or composed together with other types. For example, it may be
// used as the type of a single field of a structure being decoded.
type Node struct {
- Kind NodeKind
- Style Style
+ Kind Kind
+ Style Style
// Line and Column hold the node position in the yaml text.
- Line int
- Column int
+ Line int
+ Column int
// Tag holds the yaml tag defining the data type for the value. On
// decoded values this field will always be set to the resolved tag,
// even when a tag wasn't explicitly provided in the yaml content.
// When encoding, if this field is unset the value type will be
// implied
- Tag string
+ Tag string
// Value holds the unescaped and unquoted represenation of the value.
- Value string
+ Value string
- // Anchor holds the anchor name for this node, which allows aliases to point to it.
- Anchor string
+ // Anchor holds the anchor name for this node, which allows aliases to point to it.
+ Anchor string
// Alias holds the node that this alias points to. Only valid when Kind is AliasNode.
- Alias *Node
+ Alias *Node
// Content holds contained nodes for documents, mappings, and sequences.
Content []*Node
@@ -391,7 +390,6 @@
}
}
-
// --------------------------------------------------------------------------
// Maintain a mapping of keys to structure field indexes