aboutsummaryrefslogtreecommitdiff
path: root/parser/errors.go
blob: f6369be27c477be77ee700d215e2ccb7068a8211 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package parser

import "fmt"

type invalidSyntax struct {
	pos      position
	expected string
	found    string
}

func (e invalidSyntax) Error() string {
	return fmt.Sprintf("Syntax error near %v; expected %s but found %s", e.pos, e.expected, e.found)
}

type eof struct{}

func (e eof) Error() string {
	return "Hit end-of-file while parsing.  You’re probably missing a closing brace (‘}’) somewhere"
}