fix O(n^2) parser behavior on long chains of + and *

it took thousands of expressions for this to be a problem, but still better
to fix it of course.