A non-recursive criterion for weights of a highest-weight module for an affine Lie algebra