(node)
| 241 | from: scanStart, |
| 242 | to: scanEnd, |
| 243 | enter(node) { |
| 244 | if (isSkipContext(node.name)) { |
| 245 | return false; |
| 246 | } |
| 247 | |
| 248 | const name = node.name; |
| 249 | if ( |
| 250 | name === "(" || |
| 251 | name === "[" || |
| 252 | name === "{" || |
| 253 | name === ")" || |
| 254 | name === "]" || |
| 255 | name === "}" |
| 256 | ) { |
| 257 | const pos = node.from; |
| 258 | |
| 259 | if (isOpeningBracket(name)) { |
| 260 | const colorIndex = openBrackets.length % marks.length; |
| 261 | if (isVisible(pos)) { |
| 262 | builder.add(pos, pos + 1, marks[colorIndex]); |
| 263 | } |
| 264 | openBrackets.push({ char: name, colorIndex }); |
| 265 | } else { |
| 266 | const matchingOpen = CLOSING_TO_OPENING[name as ClosingBracket]; |
| 267 | if (!matchingOpen) return; |
| 268 | |
| 269 | for (let index = openBrackets.length - 1; index >= 0; index--) { |
| 270 | if (openBrackets[index].char !== matchingOpen) continue; |
| 271 | |
| 272 | if (isVisible(pos)) { |
| 273 | builder.add( |
| 274 | pos, |
| 275 | pos + 1, |
| 276 | marks[openBrackets[index].colorIndex], |
| 277 | ); |
| 278 | } |
| 279 | openBrackets.length = index; |
| 280 | break; |
| 281 | } |
| 282 | } |
| 283 | } |
| 284 | }, |
| 285 | }); |
| 286 | |
| 287 | return builder.finish(); |
nothing calls this directly
no test coverage detected