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

Function join_multiline_signature

ci/lint_cpp_rs/src/lib.rs:3407–3444  ·  view source on GitHub ↗
(lines: &[String], start: usize)

Source from the content-addressed store, hash-verified

3405}
3406
3407fn join_multiline_signature(lines: &[String], start: usize) -> Option<String> {
3408 let line = strip_line_comment_code(&lines[start]);
3409 if !line.contains('(') {
3410 return None;
3411 }
3412 let mut depth = 0_i32;
3413 for ch in line.chars() {
3414 if ch == '(' {
3415 depth += 1;
3416 } else if ch == ')' {
3417 depth -= 1;
3418 }
3419 }
3420 if depth <= 0 {
3421 return None;
3422 }
3423 let mut joined = line;
3424 for offset in 1..10 {
3425 let idx = start + offset;
3426 if idx >= lines.len() {
3427 break;
3428 }
3429 let next = strip_line_comment_code(&lines[idx]).trim().to_string();
3430 joined.push(' ');
3431 joined.push_str(&next);
3432 for ch in next.chars() {
3433 if ch == '(' {
3434 depth += 1;
3435 } else if ch == ')' {
3436 depth -= 1;
3437 }
3438 }
3439 if depth <= 0 {
3440 return Some(joined);
3441 }
3442 }
3443 None
3444}
3445
3446fn signature_has_noexcept(lines: &[String], start: usize, open_paren: usize) -> bool {
3447 let Some((close_line, close_col)) = find_close_paren_multiline(lines, start, open_paren) else {

Callers 1

check_file_contentMethod · 0.85

Calls 5

strip_line_comment_codeFunction · 0.85
trimMethod · 0.80
containsMethod · 0.45
to_stringMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected