fix symbol lexing bug that snuck into the rewrite, and simplify the logic considerably in the process