diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-30 12:31:42 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-30 14:41:30 -0700 |
commit | c24b34a47359ffb012b85e329f829b64d9d27215 (patch) | |
tree | 0a7acb802d5c9e3cf3ccde658b07f1034f680f52 /decode_scan.go | |
parent | 8b7c8d2f87f9c4d924d070926fb5ab9860d00c61 (diff) |
decode: Fix DecodeTypeError offsets
Diffstat (limited to 'decode_scan.go')
-rw-r--r-- | decode_scan.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/decode_scan.go b/decode_scan.go index 249975d..b9a5ea8 100644 --- a/decode_scan.go +++ b/decode_scan.go @@ -62,7 +62,7 @@ func (sc *runeTypeScannerImpl) Reset() { sc.rType, err = sc.parser.HandleRune(sc.rRune) if err != nil { sc.rErr = &DecodeSyntaxError{ - Offset: sc.offset, + Offset: sc.offset - int64(sc.rSize), Err: err, } } else { @@ -89,7 +89,7 @@ func (sc *runeTypeScannerImpl) ReadRuneType() (rune, int, internal.RuneType, err sc.rType, err = sc.parser.HandleRune(sc.rRune) if err != nil { sc.rErr = &DecodeSyntaxError{ - Offset: sc.offset, + Offset: sc.offset - int64(sc.rSize), Err: err, } } else { |