(sql string, line, column int)
| 52 | } |
| 53 | |
| 54 | func lineColumnToByteOffset(sql string, line, column int) int { |
| 55 | currentLine := 1 |
| 56 | for i := 0; i < len(sql); i++ { |
| 57 | if currentLine == line { |
| 58 | pos := i |
| 59 | for c := 0; c < column && pos < len(sql); c++ { |
| 60 | _, size := utf8.DecodeRuneInString(sql[pos:]) |
| 61 | pos += size |
| 62 | } |
| 63 | if pos > len(sql) { |
| 64 | return len(sql) |
| 65 | } |
| 66 | return pos |
| 67 | } |
| 68 | if sql[i] == '\n' { |
| 69 | currentLine++ |
| 70 | } |
| 71 | } |
| 72 | return len(sql) |
| 73 | } |
| 74 | |
| 75 | func isNoSeparatorRequired(tokenType int) bool { |
| 76 | switch tokenType { |
no outgoing calls
no test coverage detected