mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-08 06:45:38 +00:00
feat(parser): fix MappingValue position
This commit is contained in:
parent
807ccfbe53
commit
b966ccc107
@ -341,7 +341,7 @@ func (m *goccyMarshaller) marshalMapping(path string, o *CandidateNode) (ast.Nod
|
|||||||
mapping := ast.Mapping(nil, isFlowStyle)
|
mapping := ast.Mapping(nil, isFlowStyle)
|
||||||
|
|
||||||
if isFlowStyle {
|
if isFlowStyle {
|
||||||
mapping.Start = m.PushToken(goccyToken.MappingStart("{", &goccyToken.Position{}))
|
mapping.Start = m.PushToken(goccyToken.MappingStart("{", m.getPosition(o)))
|
||||||
}
|
}
|
||||||
|
|
||||||
values := make([]*ast.MappingValueNode, len(o.Content)/2)
|
values := make([]*ast.MappingValueNode, len(o.Content)/2)
|
||||||
@ -388,7 +388,10 @@ func (m *goccyMarshaller) marshalMappingValueNode(path string, entryNode, keyNod
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
separatorToken := m.PushToken(goccyToken.MappingValue(m.getPosition(entryNode)))
|
separatorToken := m.PushToken(goccyToken.MappingValue(&goccyToken.Position{
|
||||||
|
Line: key.GetToken().Position.Line,
|
||||||
|
Column: key.GetToken().Position.Column + len(key.String()),
|
||||||
|
}))
|
||||||
|
|
||||||
value, err := m.Marshal(key.GetPath(), valueNode)
|
value, err := m.Marshal(key.GetPath(), valueNode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user