Skip to main content

segment

Function segment 

Source
pub fn segment(source: &str, scope: &Scope) -> Vec<Span>
Expand description

Finds the regions of one scope in source.

Regions are sequential: the search for the next start resumes where the previous region ended, so a scope’s regions never overlap each other. A region spans from its start match to the next end match after that (or end of file when the scope has no end). Empty regions are dropped.