parse when and else clauses as statements