added support for [ and ] to the scanner