修复: byte/rune 长度混淆及错误位置丢失

This commit is contained in:
2026-04-01 10:43:16 +08:00
parent 1b5b6aff8f
commit 2f9d81dc17
8 changed files with 603 additions and 93 deletions

View File

@@ -81,5 +81,12 @@ func wrapExecError(err error) error {
if errors.As(err, &unsafeErr) {
return err
}
var posErr *internal.PosError
if errors.As(err, &posErr) {
return &ExecError{
Pos: Position{Line: posErr.Line, Column: posErr.Col},
Message: err.Error(),
}
}
return &ExecError{Message: err.Error()}
}