* Checks if a character at position `pos` in `content` is escaped by counting * consecutive backslashes before it. An odd number means it's escaped.
(content: string, pos: number)
| 1725 | * consecutive backslashes before it. An odd number means it's escaped. |
| 1726 | */ |
| 1727 | function isEscapedAtPosition(content: string, pos: number): boolean { |
| 1728 | let backslashCount = 0 |
| 1729 | let i = pos - 1 |
| 1730 | while (i >= 0 && content[i] === '\\') { |
| 1731 | backslashCount++ |
| 1732 | i-- |
| 1733 | } |
| 1734 | return backslashCount % 2 === 1 |
| 1735 | } |
| 1736 | |
| 1737 | /** |
| 1738 | * Detects unquoted brace expansion syntax that Bash expands but shell-quote/tree-sitter |
no outgoing calls
no test coverage detected