def t_error(t):
    """ Lexer error callback from PLY Lexer with token in error.
    """
    msg = _format("Illegal character {0!A}", t.value[0])
    t.lexer.last_msg = msg
    t.lexer.skip(1)
    return t