示例#1
0
        public static ExpressionSyntax Transpile(this Syntax.StringSyntax stringNode)
        {
            _ = stringNode ?? throw new ArgumentNullException(nameof(stringNode));

            return(stringNode.StringNode?.TranspileExpression()
                   ?? SyntaxFactory.ParseExpression("string.Empty"));
        }
示例#2
0
        public static void Transpile(this Syntax.StringSyntax stringNode, ref StringBuilder sb)
        {
            _ = stringNode ?? throw new ArgumentNullException(nameof(stringNode));

            if (stringNode.StringNode is null)
            {
                sb.Append("\"\"");
            }
            else
            {
                stringNode.StringNode.TranspileExpression(ref sb);
            }
        }