From 8883fb76ce1a4eb83f79f6fddf73b5fe54b5685c Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Sat, 20 May 2017 08:56:41 -0700 Subject: [PATCH] json: include NameRange and ExprRange in returned attributes --- zcl/json/structure.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zcl/json/structure.go b/zcl/json/structure.go index 8f92741..a48f6c6 100644 --- a/zcl/json/structure.go +++ b/zcl/json/structure.go @@ -65,9 +65,11 @@ func (b *body) PartialContent(schema *zcl.BodySchema) (*zcl.BodyContent, zcl.Bod continue } content.Attributes[attrS.Name] = &zcl.Attribute{ - Name: attrS.Name, - Expr: &expression{src: jsonAttr.Value}, - Range: zcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()), + Name: attrS.Name, + Expr: &expression{src: jsonAttr.Value}, + Range: zcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()), + NameRange: jsonAttr.NameRange, + ExprRange: jsonAttr.Value.Range(), } usedNames[attrS.Name] = struct{}{} }