修复: 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

@@ -14,11 +14,10 @@ func (p Position) String() string {
type ParseError struct {
Message string
Pos Position
Token string
}
func (e ParseError) Error() string {
return fmt.Sprintf("%s: %s (token: %q)", e.Pos, e.Message, e.Token)
return fmt.Sprintf("%s: %s", e.Pos, e.Message)
}
type ExecError struct {