The code currently treats consecutive operators an error, so 3+-5 would throw an error because of the +-. It would need to be modified to throw an error only when this doesn't make sense, so for example 3+-5 is fine because it means three plus (-5), but 3+*5 would still throw an error.

Have a look at the code after the comment "// several important validation checks on the input"