* Checks whether the character at the given offset is escaped by an odd number * of immediately preceding backslashes.
(input: InputStream, offset: number)
| 131 | * of immediately preceding backslashes. |
| 132 | */ |
| 133 | function isEscapedAt(input: InputStream, offset: number): boolean { |
| 134 | let backslashCount = 0; |
| 135 | let currentOffset = offset - 1; |
| 136 | |
| 137 | while (input.peek(currentOffset) === 92 /* backslash */) { |
| 138 | backslashCount++; |
| 139 | currentOffset--; |
| 140 | } |
| 141 | |
| 142 | return backslashCount % 2 === 1; |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Returns the offset of the closing ')' that matches the '(' at startOffset. |
no outgoing calls
no test coverage detected