summaryrefslogtreecommitdiff
path: root/decode_scan.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-30 12:31:42 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-30 14:41:30 -0700
commitc24b34a47359ffb012b85e329f829b64d9d27215 (patch)
tree0a7acb802d5c9e3cf3ccde658b07f1034f680f52 /decode_scan.go
parent8b7c8d2f87f9c4d924d070926fb5ab9860d00c61 (diff)
decode: Fix DecodeTypeError offsets
Diffstat (limited to 'decode_scan.go')
-rw-r--r--decode_scan.go4
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 {