Leiden System Bracket Pair Validator ([ ])
Validate square-bracket pairing and nesting in a Leiden-system transcription, counting bracket pairs, maximum nesting depth, and reporting the zero-based character position of the first unmatched bracket (-1 when balanced).
Description
Validate square-bracket pairing and nesting in a Leiden-system transcription, counting bracket pairs, maximum nesting depth, and reporting the zero-based character position of the first unmatched bracket (-1 when balanced).