Formula should not differ. The whitespace in front of the + or - should not be significant. But the current code interprets the whitespace as not one of the three tokens in the list and thus decides that the + or - is prefix and not infix. IE a space makes the current code think a binary operator is an unary operator.
You are likely correct that if not using this lexer with a parser, it may not matter. But, I noticed this bug because I am trying to use this lexer with a parser and it broke in this case. Thanks for picking up the change.