about summary refs log tree commit diff
path: root/pkg/lang/compiler/errors.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/lang/compiler/errors.go')
-rw-r--r--pkg/lang/compiler/errors.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/lang/compiler/errors.go b/pkg/lang/compiler/errors.go
new file mode 100644
index 0000000..45f14cc
--- /dev/null
+++ b/pkg/lang/compiler/errors.go
@@ -0,0 +1,16 @@
+package compiler
+
+import (
+	"fmt"
+	"jinx/pkg/libs/source"
+)
+
+type Error struct {
+	Module string
+	Loc    source.Loc
+	Err    error
+}
+
+func (e Error) Error() string {
+	return fmt.Sprintf("compiler error at %s:%d:%d: %v", e.Module, e.Loc.Row, e.Loc.Col, e.Err)
+}