(source, keyword string, offset, start, end int)
| 454 | } |
| 455 | |
| 456 | func keywordMatchAt(source, keyword string, offset, start, end int) bool { |
| 457 | if offset+len(keyword) > end || !strings.EqualFold(source[offset:offset+len(keyword)], keyword) { |
| 458 | return false |
| 459 | } |
| 460 | if offset > start && isSQLIdentifierChar(source[offset-1]) { |
| 461 | return false |
| 462 | } |
| 463 | if offset+len(keyword) < end && isSQLIdentifierChar(source[offset+len(keyword)]) { |
| 464 | return false |
| 465 | } |
| 466 | return true |
| 467 | } |
| 468 | |
| 469 | func isSQLIdentifierChar(ch byte) bool { |
| 470 | return ch == '_' || ch == '@' || ch == '#' || ch == '$' || |
no test coverage detected