Skip to content

Commit

Permalink
fix(parser): inconsistent paths between single-line MappingKeyValueNo…
Browse files Browse the repository at this point in the history
…de and multi-line (#612)
  • Loading branch information
LarsStegman authored Jan 16, 2025
1 parent cb5fb47 commit 1c32d14
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,13 @@ func (p *parser) parseMapKeyValue(ctx *context, g *TokenGroup) (*ast.MappingValu
if err != nil {
return nil, err
}
value, err := p.parseToken(ctx.withChild(p.mapKeyText(key)), g.Last())

c := ctx.withChild(p.mapKeyText(key))
value, err := p.parseToken(c, g.Last())
if err != nil {
return nil, err
}
return newMappingValueNode(ctx, keyGroup.Last(), key, value)
return newMappingValueNode(c, keyGroup.Last(), key, value)
}

func (p *parser) parseMapKey(ctx *context, g *TokenGroup) (ast.MapKeyNode, error) {
Expand Down

0 comments on commit 1c32d14

Please sign in to comment.