whenlist : whenlist kw_when expression kw_then expression
                | kw_when expression kw_then expression

def p_whenlist(self,t):
    """whenlist : whenlist kw_when expression kw_then expression
                | kw_when expression kw_then expression
    """
    if len(t)==5: t[0] = [WhenX(t[2],t[4])]
    elif len(t)==6: t[0] = t[1] + [WhenX(t[3],t[5])]
    else: raise NotImplementedError('unk_len',len(t)) # pragma: no cover