예제 #1
0
        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;
        }
예제 #2
0
 protected virtual StatementSyntax ReturnOutOfState()
 {
     return(Cs.Return(Cs.False()));
 }