public static BoundExpressionStatement Increment(SyntaxNode syntax, BoundVariableExpression variable) { var increment = Add(syntax, variable, Literal(syntax, 1)); var incrementAssign = new BoundAssignmentExpression(syntax, variable.Variable, increment); return(new BoundExpressionStatement(syntax, incrementAssign)); }
private static void WriteAssignmentExpression(BoundAssignmentExpression node, IndentedTextWriter writer) { writer.WriteIdentifier(node.Variable.Name); writer.WriteSpace(); writer.WritePunctuation(SyntaxKind.EqualsToken); writer.WriteSpace(); node.Expression.WriteTo(writer); }