MCPcopy Create free account
hub / github.com/abiosoft/mold / pos

Function pos

process.go:157–173  ·  view source on GitHub ↗
(body string, pos int)

Source from the content-addressed store, hash-verified

155}
156
157func pos(body string, pos int) (line int, col int) {
158 line = 1
159 col = 1
160 for i, char := range body {
161 if i >= pos {
162 break
163 }
164
165 if char == '\n' {
166 line++
167 col = 1
168 } else {
169 col++
170 }
171 }
172 return line, col
173}
174
175type nestingFunc string
176

Callers 2

TestPosFunction · 0.85
processTreeFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestPosFunction · 0.68