Add support for yield in if condition

If the condition of an if statement contains a yield we create a state machine for that expression.