Shells have somewhat unusual parsing requirements. For example "if" is a keyword when used as `if echo` but not `echo if`.
So you either need to implement the lexer hack, or have a "string" token type which is disambiguated by the parser (which is what fish-shell does).