Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding/json: fix location for JSON syntax error
The JSON decoder utilizes `parser.ParseExpr` to parse input data, which could be a valid CUE expression but an invalid JSON. Using the error position returned by `parser.ParseExpr` as output may cause cue to either omit the position or report the wrong position This change uses the offset returned by the JSON parser and recalculate the position to ensure the reported position is accurate. Fixes #3317 Change-Id: I019ab80c275d658f5773501d766ee9d03261ab58 Signed-off-by: haoqixu <[email protected]> Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199094 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information