(statement string, pos int)
| 416 | } |
| 417 | |
| 418 | func caretInsideBacktickIdentifier(statement string, pos int) bool { |
| 419 | if pos > len(statement) { |
| 420 | pos = len(statement) |
| 421 | } |
| 422 | masked := stripStringsAndComments(statement) |
| 423 | count := 0 |
| 424 | for i := 0; i < pos; i++ { |
| 425 | if masked[i] == '`' { |
| 426 | count++ |
| 427 | } |
| 428 | } |
| 429 | return count%2 == 1 |
| 430 | } |
| 431 | |
| 432 | // stripStringsAndComments returns statement with the contents of string literals |
| 433 | // ('...', "..."), line comments (-- , #), and block comments (/* */) replaced by |