Add a new function `_skipToClosingBracket()` as suggested in code review.