public static void Transpile(this Syntax.ReturnStatementSyntax returnStatementNode, ref StringBuilder sb) { _ = returnStatementNode ?? throw new ArgumentNullException(nameof(returnStatementNode)); if (returnStatementNode.EmptyExpressionNode is null) { sb.Append("return "); returnStatementNode.ExpressionNode?.Transpile(ref sb); } else { sb.Append("return"); } }
public static StatementSyntax Transpile(this Syntax.ReturnStatementSyntax returnStatementNode) { _ = returnStatementNode ?? throw new ArgumentNullException(nameof(returnStatementNode)); return(SyntaxFactory.ReturnStatement(returnStatementNode.ExpressionNode?.Transpile())); }