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

Function bracket_span

codegraph-kernel/src/cfnptr.rs:540–553  ·  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

538
539/// `\[[^\]]*\]` at `i` (the INIT/ARRAY declarator form — the class admits
540/// newlines): position after the FIRST `]`, or None.
541fn bracket_span(s: &[u8], i: usize) -> Option<usize> {
542 if s.get(i) != Some(&b'[') {
543 return None;
544 }
545 let mut j = i + 1;
546 while j < s.len() && s[j] != b']' {
547 j += 1;
548 }
549 if j < s.len() {
550 Some(j + 1)
551 } else {
552 None
553 }
554}
555
556/// 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