示例#1
0
        protected virtual BoundStatement RewriteVariableDeclaration(BoundVariableDeclaration node)
        {
            BoundExpression initializer = RewriteExpression(node.Initializer);

            if (initializer == node.Initializer)
            {
                return(node);
            }

            return(new BoundVariableDeclaration(node.Variable, initializer));
        }
示例#2
0
 private static void WriteVariableDeclaration(BoundVariableDeclaration node, IndentedTextWriter writer)
 {
     writer.WriteKeyword(node.Variable.IsReadOnly ? SyntaxKind.LetKeyword : SyntaxKind.VarKeyword);
     writer.WriteWhiteSpace();
     writer.WriteIdentifier(node.Variable.Name);
     writer.WriteWhiteSpace();
     writer.WritePunctuation(SyntaxKind.EqualsToken);
     writer.WriteWhiteSpace();
     node.Initializer.WriteTo(writer);
     writer.WriteLine();
 }