def p_const_vector_vector_list(p):
    """ const_vector_list : const_vector_list COMMA const_vector
    """
    if len(p[3]) != len(p[1][0]):
        syntax_error(p.lineno(2), 'All rows must have the same number of elements')
        p[0] = None
        return

    p[0] = p[1] + [p[3]]
def p_const_vector_vector_list ( p ) : if len ( p [ 3 ] ) != len ( p [ 1 ] [ 0 ] ) : syntax_error ( p . lineno ( 2 ) , 'All rows must have the same number of elements' ) p [ 0 ] = None return p [ 0 ] = p [ 1 ] + [ p [ 3 ] ]
const_vector_list : const_vector_list COMMA const_vector