internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) { var namesWhiteSpace = this.GetNamesWhiteSpace(ast); if (namesWhiteSpace != null) { ListExpression.AppendItems(res, ast, format, "global", "", this, Names.Count, (i, sb) => { sb.Append(namesWhiteSpace[i]); Names[i].AppendCodeString(res, ast, format); }); } else { ListExpression.AppendItems(res, ast, format, "global", "", this, Names.Count, (i, sb) => Names[i].AppendCodeString(sb, ast, format)); } }
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) { format.ReflowComment(res, this.GetPreceedingWhiteSpace(ast)); res.Append("print"); if (Destination != null) { res.Append(this.GetSecondWhiteSpace(ast)); res.Append(">>"); Destination.AppendCodeString(res, ast, format); if (Expressions.Count > 0) { res.Append(this.GetThirdWhiteSpace(ast)); res.Append(','); } } ListExpression.AppendItems(res, ast, format, string.Empty, string.Empty, this, Expressions); }
internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) { if (this.IsAltForm(ast)) { ListExpression.AppendItems(res, ast, format, "", "", this, Items); } else { if (Items.Count == 0 && format.SpaceWithinEmptyTupleExpression != null) { format.ReflowComment(res, this.GetPreceedingWhiteSpace(ast)); res.Append('('); format.Append(res, format.SpaceWithinEmptyTupleExpression, " ", "", this.GetSecondWhiteSpaceDefaultNull(ast)); res.Append(')'); } else { ListExpression.AppendItems(res, ast, format, "(", this.IsMissingCloseGrouping(ast) ? "" : ")", this, Items, format.SpacesWithinParenthesisedTupleExpression); } } }
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) => ListExpression.AppendItems(res, ast, format, "del", string.Empty, this, Expressions);
public override bool Walk(ListExpression node) => true;
internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) => ListExpression.AppendItems(res, ast, format, "{", this.IsMissingCloseGrouping(ast) ? "" : "}", this, Items);
public override void PostWalk(ListExpression node) { }
// ListExpression public override bool Walk(ListExpression node) { return(false); }
public virtual void PostWalk(ListExpression node) { }
// ListExpression public virtual bool Walk(ListExpression node) { return(true); }
// ListExpression public override bool Walk(ListExpression node) { return(Location >= node.StartIndex && Location <= node.EndIndex); }