Exemplo n.º 1
0
        protected virtual BoundStatement RewriteVariableDeclarationStatement(BoundVariableDeclarationStatement node)
        {
            var initializer = RewriteExpression(node.Initializer);

            if (initializer == node.Initializer)
            {
                return(node);
            }
            return(new BoundVariableDeclarationStatement(node.Variable, initializer));
        }
 private static void WriteVariableDeclarationStatement(BoundVariableDeclarationStatement node, IndentedTextWriter writer)
 {
     writer.WriteKeyword(node.Variable.IsReadonly ? SyntaxKind.LetKeyword : SyntaxKind.VarKeyword);
     writer.WriteSpace();
     writer.WriteIdentifier(node.Variable.Name);
     writer.WriteSpace();
     writer.WritePunctuation(SyntaxKind.EqualsToken);
     writer.WriteSpace();
     node.Initializer.WriteTo(writer);
     writer.WriteLine();
 }