Add support for yield in if condition