Remove redudant error checks by introducing parser actions.