Add invariant assert in the parser.