MCPcopy Create free account
hub / github.com/FastLED/FastLED / find_close_paren_multiline

Function find_close_paren_multiline

ci/lint_cpp_rs/src/lib.rs:3259–3293  ·  view source on GitHub ↗
(
    lines: &[String],
    start_idx: usize,
    open_col: usize,
)

Source from the content-addressed store, hash-verified

3257}
3258
3259fn find_close_paren_multiline(
3260 lines: &[String],
3261 start_idx: usize,
3262 open_col: usize,
3263) -> Option<(usize, usize)> {
3264 let line = &lines[start_idx];
3265 let mut depth = 1_i32;
3266 for (offset, ch) in line[open_col + 1..].char_indices() {
3267 if ch == '(' {
3268 depth += 1;
3269 } else if ch == ')' {
3270 depth -= 1;
3271 if depth == 0 {
3272 return Some((start_idx, open_col + 1 + offset));
3273 }
3274 }
3275 }
3276 for lookahead in 1..15 {
3277 let idx = start_idx + lookahead;
3278 if idx >= lines.len() {
3279 break;
3280 }
3281 for (col, ch) in lines[idx].char_indices() {
3282 if ch == '(' {
3283 depth += 1;
3284 } else if ch == ')' {
3285 depth -= 1;
3286 if depth == 0 {
3287 return Some((idx, col));
3288 }
3289 }
3290 }
3291 }
3292 None
3293}
3294
3295fn compute_block_comment_mask(lines: &[String]) -> Vec<bool> {
3296 let mut mask = Vec::with_capacity(lines.len());

Callers 1

signature_has_noexceptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected