Added token type to emitted symbols and improved white space handling