From 873a4d07b50a52717febe1863e0a0f2a655d7984 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Sat, 20 May 2017 11:12:03 -0700 Subject: [PATCH] json: improve error message for duplicate property We need to be careful to keep straight the distinction between JSON properties and zcl body attributes here, since properties can represent both attributes _and_ blocks. --- zcl/json/parser.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zcl/json/parser.go b/zcl/json/parser.go index 1272673..7c0981f 100644 --- a/zcl/json/parser.go +++ b/zcl/json/parser.go @@ -154,12 +154,12 @@ Token: // anyway since this is a semantic error we can recover from. diags = diags.Append(&zcl.Diagnostic{ Severity: zcl.DiagError, - Summary: "Duplicate object attribute", + Summary: "Duplicate JSON object property", Detail: fmt.Sprintf( - "An attribute named %q was previously introduced at %s", + "An property named %q was previously introduced at %s", key, existing.NameRange.String(), ), - Subject: &colon.Range, + Subject: &keyStrNode.SrcRange, }) } attrs[key] = &objectAttr{