about summary refs log tree commit diff
path: root/pkg/libs/source/loc.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-08-08 23:46:09 +0000
committerMel <einebeere@gmail.com>2022-08-08 23:46:09 +0000
commit7717384414926eaa5821f04a08ee0d198f7b786f (patch)
tree0b667518eba4c8d023d39a70fecf153a795a7f9c /pkg/libs/source/loc.go
parente0161c493867e788ad9db208247f3275e2d057dc (diff)
downloadjinx-7717384414926eaa5821f04a08ee0d198f7b786f.tar.zst
jinx-7717384414926eaa5821f04a08ee0d198f7b786f.zip
Produce (slightly) better parser errors
Diffstat (limited to 'pkg/libs/source/loc.go')
-rw-r--r--pkg/libs/source/loc.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/libs/source/loc.go b/pkg/libs/source/loc.go
index 3089d3b..f43b5c0 100644
--- a/pkg/libs/source/loc.go
+++ b/pkg/libs/source/loc.go
@@ -1,5 +1,7 @@
 package source
 
+import "fmt"
+
 type Loc struct {
 	Row int
 	Col int
@@ -8,3 +10,7 @@ type Loc struct {
 func NewLoc(row, col int) Loc {
 	return Loc{row, col}
 }
+
+func (l Loc) String() string {
+	return fmt.Sprintf("%d:%d", l.Row+1, l.Col)
+}