Skip to main content

Module brackets

Module brackets 

Source
Expand description

Matching brackets: (), [] and {}. Plain text: a bracket inside a string or comment counts like any other. The search is bounded so a caret next to an unmatched bracket in a huge file stays cheap.

Structs§

BracketPair
A bracket next to a caret, and its match if there is one in reach.

Constants§

SEARCH_LIMIT
How far either way to look for the match.

Functions§

bracket_at
The bracket just after caret, or else just before it, and its match.
find_match
The bracket matching the one at at, counting nesting of the same kind.