lexer: add Hint to Error, which is expanded as "%s" instead of "%q" #12

Merged
amery merged 2 commits from pr-amery-error into main 2023-09-04 15:15:03 +02:00
Showing only changes of commit ce75299e74 - Show all commits
+5
View File
@@ -25,6 +25,7 @@ type Error struct {
Column int
Content string
Hint string
Err error
}
@@ -57,6 +58,10 @@ func (err Error) Error() string {
s = append(s, fmt.Sprintf("%q", err.Content))
}
if err.Hint != "" {
s = append(s, err.Hint)
}
return strings.Join(s, ": ")
}