public override void VisitYieldStatement(YieldStatementSyntax node) { var nextState = GetNextState(node); if (node.ReturnOrBreakKeyword.IsKind(SyntaxKind.BreakKeyword)) { currentState.Add(ChangeState(nextState)); currentState.Add(Cs.Return(Cs.False())); } else { currentState.Add(ChangeState(nextState)); currentState.Add(Cs.Express(Cs.This().Member("Current").Assign(StateMachineThisFixer.Fix(node.Expression)))); currentState.Add(Cs.Return(Cs.True())); } SetClosed(currentState); currentState = nextState; }
protected virtual StatementSyntax ReturnOutOfState() { return(Cs.Return(Cs.False())); }