MCPcopy Create free account
hub / github.com/AI45Lab/Code / find_balanced

Function find_balanced

core/src/llm/structured.rs:370–372  ·  view source on GitHub ↗
(text: &str, open: char, close: char)

Source from the content-addressed store, hash-verified

368}
369
370fn find_balanced(text: &str, open: char, close: char) -> Option<&str> {
371 find_balanced_range(text, open, close).map(|(start, end)| &text[start..end])
372}
373
374/// Byte range `[start, end)` of the first balanced `open..close` substring (quote-aware).
375fn find_balanced_range(text: &str, open: char, close: char) -> Option<(usize, usize)> {

Callers 2

find_balanced_json_arrayFunction · 0.85

Calls 1

find_balanced_rangeFunction · 0.85

Tested by

no test coverage detected