encoding/json: correct positions of field labels from json
In JSON, object keys must be quoted. When converting to CUE, where safe,
we convert the string lit to a plain ident. However, because the quote
marks have been lost, it means the literal string has become 2 chars
shorter.
We should add 1 to the starting position of the plain idents.
- This ensures the individual character offsets match up with the
original.
- It also means the start-end range of the ident makes sense.
Signed-off-by: Matthew Sackman <matthew@cue.works>
Change-Id: I74cb800998953383bd1742a29c21c7555265e9f0
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1229647
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>