diff options
| author | Mel <einebeere@gmail.com> | 2022-08-08 23:46:09 +0000 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-08-08 23:46:09 +0000 |
| commit | 7717384414926eaa5821f04a08ee0d198f7b786f (patch) | |
| tree | 0b667518eba4c8d023d39a70fecf153a795a7f9c /pkg/libs/source | |
| parent | e0161c493867e788ad9db208247f3275e2d057dc (diff) | |
| download | jinx-7717384414926eaa5821f04a08ee0d198f7b786f.tar.zst jinx-7717384414926eaa5821f04a08ee0d198f7b786f.zip | |
Produce (slightly) better parser errors
Diffstat (limited to 'pkg/libs/source')
| -rw-r--r-- | pkg/libs/source/loc.go | 6 |
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) +} |
