Skip to content

Commit b84fd47

Browse files
committed
More goccy progress
1 parent 58e0cd2 commit b84fd47

7 files changed

+274
-239
lines changed

pkg/yqlib/candidate_node_goccy_yaml.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ func (o *CandidateNode) UnmarshalGoccyYAML(node ast.Node, cm yaml.CommentMap, an
6969
o.Kind = ScalarNode
7070
o.Tag = "!!null"
7171
o.Value = node.GetToken().Value
72+
if node.GetToken().Type == goccyToken.ImplicitNullType {
73+
o.Value = ""
74+
}
7275
case ast.StringType:
7376
o.Kind = ScalarNode
7477
o.Tag = "!!str"
@@ -112,7 +115,7 @@ func (o *CandidateNode) UnmarshalGoccyYAML(node ast.Node, cm yaml.CommentMap, an
112115
for _, mappingValueNode := range mappingNode.Values {
113116
err := o.goccyProcessMappingValueNode(mappingValueNode, cm, anchorMap)
114117
if err != nil {
115-
return ast.ErrInvalidAnchorName
118+
return err
116119
}
117120
}
118121
if mappingNode.FootComment != nil {
@@ -126,7 +129,7 @@ func (o *CandidateNode) UnmarshalGoccyYAML(node ast.Node, cm yaml.CommentMap, an
126129
mappingValueNode := node.(*ast.MappingValueNode)
127130
err := o.goccyProcessMappingValueNode(mappingValueNode, cm, anchorMap)
128131
if err != nil {
129-
return ast.ErrInvalidAnchorName
132+
return err
130133
}
131134
case ast.SequenceType:
132135
log.Debugf("UnmarshalYAML - a sequence node")

0 commit comments

Comments
 (0)