Locations and tokens are now capable of creating errors on their own
This commit is contained in:
@@ -22,9 +22,9 @@ func NewError (
|
||||
message string,
|
||||
kind ErrorKind,
|
||||
) (
|
||||
err *Error,
|
||||
err Error,
|
||||
) {
|
||||
return &Error {
|
||||
return Error {
|
||||
Location: location,
|
||||
message: message,
|
||||
kind: kind,
|
||||
|
||||
@@ -8,3 +8,8 @@ type Location struct {
|
||||
column int
|
||||
width int
|
||||
}
|
||||
|
||||
// NewError creates a new error at this location.
|
||||
func (location Location) NewError (message string, kind ErrorKind) (err Error) {
|
||||
return NewError(location, message, kind)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user