parser: add necessary checks to operator() to stop accepting nonsense.