This repository has been archived on 2022-08-29. You can view files and clone it, but cannot push or open issues or pull requests.
arf/file/location.go
Sasha Koshka c3a5b15049 Added Location struct
Its purpose is to carry error reporting information with it outside of files.
2022-08-03 13:40:00 -04:00

20 lines
511 B
Go

package file
// Location represents a specific point in a file. It is used for error
// reporting.
type Location struct {
file *File
row int
column int
}
// Error prints an error at this location.
func (location Location) Error (width int, message string) {
location.file.Error(location.column, location.row, width, message)
}
// Warn prints a warning at this location.
func (location Location) Warn (width int, message string) {
location.file.Warn(location.column, location.row, width, message)
}