From 643623dbecdc1ccb6f3ac77e4ebabdc6ca1d8d06 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 2 Sep 2023 18:49:53 +0200 Subject: Genesis commit --- parser/errors.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 parser/errors.go (limited to 'parser/errors.go') diff --git a/parser/errors.go b/parser/errors.go new file mode 100644 index 0000000..f6369be --- /dev/null +++ b/parser/errors.go @@ -0,0 +1,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" +} -- cgit v1.2.3