Pretty output (#973)

pretty output
This commit is contained in:
Zachary Rice authored and GitHub committed 2022-09-04 08:58:57 -05:00
1 parent 7d9dd260f4
commit 96eed6aa0f
12 files changed
+134 -15

No files matched your search

+3 -1
View File
@@ -21,6 +21,9 @@ func location(fragment Fragment, matchIndex []int) Location {
start := matchIndex[0]
end := matchIndex[1]
// default startLineIndex to 0
location.startLineIndex = 0
for lineNum, pair := range fragment.newlineIndices {
_lineNum = lineNum
newLineByteIndex := pair[0]
@@ -48,7 +51,6 @@ func location(fragment Fragment, matchIndex []int) Location {
location.endColumn = (end - prevNewLine)
location.startLine = _lineNum + 1
location.endLine = _lineNum + 1
location.startLineIndex = start
// search for new line byte index
i := 0