def _append_sep(line, syntax):
    """Append statement separator to `line`.

    Omit separator if entire `line` is a comment.
    Raise `ValueError` if `line` contains code and comment.
    """
    com = syntax['COMMENT']
    if line.startswith(com):
        return line
    if com in line:
        raise ValueError(line)
    # line contains only code
    sep = syntax['SEP']
    return '{line}{SEP}'.format(line=line, SEP=sep)