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

Function bracket_span

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

517
518/// `\[[^\]]*\]` at `i` (the INIT/ARRAY declarator form — the class admits
519/// newlines): position after the FIRST `]`, or None.
520fn bracket_span(s: &[u8], i: usize) -> Option<usize> {
521 if s.get(i) != Some(&b'[') {
522 return None;
523 }
524 let mut j = i + 1;
525 while j < s.len() && s[j] != b']' {
526 j += 1;
527 }
528 if j < s.len() {
529 Some(j + 1)
530 } else {
531 None
532 }
533}
534
535/// 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