Modifying ANSI sequence parser to use switch