(s: string, idx: number)
| 136 | return [...r].reverse().join(""); |
| 137 | } |
| 138 | function isEscaped(s: string, idx: number): boolean { |
| 139 | let k = idx - 1, |
| 140 | cnt = 0; |
| 141 | while (k >= 0 && s[k] === "\\") { |
| 142 | cnt++; |
| 143 | k--; |
| 144 | } |
| 145 | return cnt % 2 === 1; |
| 146 | } |
| 147 | |
| 148 | // 提取字面头/尾(解转义)及其源长度 |
| 149 | function literalHeadInfo(s: string): { lit: string; srcLen: number } { |
no outgoing calls
no test coverage detected