closing square brackets should end tokens just like closing parens

review @confucious cc @kiril