Esempio n. 1
0
        public static StatementSyntax Transpile(this Syntax.ExitStatementSyntax exitStatementNode)
        {
            _ = exitStatementNode ?? throw new ArgumentNullException(nameof(exitStatementNode));

            return(SyntaxFactory.IfStatement(
                       exitStatementNode.ConditionExpressionNode.Transpile(),
                       SyntaxFactory.BreakStatement()));
        }
        public static void Transpile(this Syntax.ExitStatementSyntax exitStatementNode, ref StringBuilder sb)
        {
            _ = exitStatementNode ?? throw new ArgumentNullException(nameof(exitStatementNode));

            sb.Append("if ");
            exitStatementNode.ConditionExpressionNode.Transpile(ref sb);
            sb.AppendLine(" then");
            sb.AppendLine("break");
            sb.Append("end");
        }