MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / bracket_span

Function bracket_span

codegraph-kernel/src/cfnptr.rs:530–543  ·  view source on GitHub ↗

`\[[^\]]*\]` at `i` (the INIT/ARRAY declarator form — the class admits newlines): position after the FIRST `]`, or None.

(s: &[u8], i: usize)

Source from the content-addressed store, hash-verified

528
529/// `\[[^\]]*\]` at `i` (the INIT/ARRAY declarator form — the class admits
530/// newlines): position after the FIRST `]`, or None.
531fn bracket_span(s: &[u8], i: usize) -> Option<usize> {
532 if s.get(i) != Some(&b'[') {
533 return None;
534 }
535 let mut j = i + 1;
536 while j < s.len() && s[j] != b']' {
537 j += 1;
538 }
539 if j < s.len() {
540 Some(j + 1)
541 } else {
542 None
543 }
544}
545
546/// Anchor-skeleton driver shared by INIT_RE and ARRAY_TABLE_RE: both match

Callers 2

init_bodyFunction · 0.85
array_table_bodyFunction · 0.85

Calls 2

lenMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected