lexer: when switching to another output stream, clean last read character.