Making lexer more strict

Lexer was just scanning input string for any matches rather than actually
parsing the input and failing on unrecognized tokens