本文整理汇总了C#中CodeFormattingOptions.ReflowComment方法的典型用法代码示例。如果您正苦于以下问题:C# CodeFormattingOptions.ReflowComment方法的具体用法?C# CodeFormattingOptions.ReflowComment怎么用?C# CodeFormattingOptions.ReflowComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeFormattingOptions
的用法示例。
在下文中一共展示了CodeFormattingOptions.ReflowComment方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendCodeStringStmt
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append("while");
_test.AppendCodeString(res, ast, format);
_body.AppendCodeString(res, ast, format);
if (_else != null) {
format.ReflowComment(res, this.GetSecondWhiteSpaceDefaultNull(ast));
res.Append("else");
_else.AppendCodeString(res, ast, format);
}
}
示例2: AppendCodeStringStmt
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append("with");
var itemWhiteSpace = this.GetListWhiteSpace(ast);
int whiteSpaceIndex = 0;
for (int i = 0; i < _items.Length; i++) {
var item = _items[i];
if (i != 0) {
if (itemWhiteSpace != null) {
res.Append(itemWhiteSpace[whiteSpaceIndex++]);
}
res.Append(',');
}
item.ContextManager.AppendCodeString(res, ast, format);
if (item.Variable != null) {
if (itemWhiteSpace != null) {
res.Append(itemWhiteSpace[whiteSpaceIndex++]);
} else {
res.Append(' ');
}
res.Append("as");
item.Variable.AppendCodeString(res, ast, format);
}
}
_body.AppendCodeString(res, ast, format);
}
示例3: AppendCodeString
internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
var verbatimPieces = this.GetVerbatimNames(ast);
var verbatimComments = this.GetListWhiteSpace(ast);
if (verbatimPieces != null) {
// string+ / bytes+, such as "abc" "abc", which can spawn multiple lines, and
// have comments in between the peices.
for (int i = 0; i < verbatimPieces.Length; i++) {
if (verbatimComments != null && i < verbatimComments.Length) {
format.ReflowComment(res, verbatimComments[i]);
}
res.Append(verbatimPieces[i]);
}
} else {
format.ReflowComment(res, this.GetProceedingWhiteSpaceDefaultNull(ast));
res.Append(this.GetExtraVerbatimText(ast) ?? GetConstantRepr(ast.LanguageVersion));
}
}
示例4: AppendCodeString
internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpaceDefaultNull(ast));
if (format.UseVerbatimImage) {
res.Append(this.GetVerbatimImage(ast) ?? _name);
} else {
res.Append(_name);
}
}
示例5: AppendCodeString
internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append('`');
_expression.AppendCodeString(res, ast, format);
if (!this.IsMissingCloseGrouping(ast)) {
res.Append(this.GetSecondWhiteSpace(ast));
res.Append('`');
}
}
示例6: AppendCodeStringStmt
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
var decorateWhiteSpace = this.GetNamesWhiteSpace(ast);
if (Decorators != null) {
for (int i = 0, curWhiteSpace = 0; i < Decorators.Count; i++) {
if (decorateWhiteSpace != null) {
format.ReflowComment(res, decorateWhiteSpace[curWhiteSpace++]);
}
res.Append('@');
if (Decorators[i] != null) {
Decorators[i].AppendCodeString(res, ast, format);
if (decorateWhiteSpace != null) {
format.ReflowComment(res, decorateWhiteSpace[curWhiteSpace++]);
} else {
res.Append(Environment.NewLine);
}
}
}
}
}
示例7: AppendCodeStringStmt
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append("assert");
_test.AppendCodeString(res, ast, format);
if (_message != null) {
res.Append(this.GetSecondWhiteSpace(ast));
res.Append(',');
_message.AppendCodeString(res, ast, format);
}
}
示例8: AppendCodeString
internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append("await");
if (!this.IsAltForm(ast)) {
_expression.AppendCodeString(res, ast, format);
var itemWhiteSpace = this.GetListWhiteSpace(ast);
if (itemWhiteSpace != null) {
res.Append(",");
res.Append(itemWhiteSpace[0]);
}
}
}
示例9: AppendCodeStringStmt
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
var itemWhiteSpace = this.GetListWhiteSpace(ast);
for (int i = 0; i < _tests.Length; i++) {
if (itemWhiteSpace != null) {
format.ReflowComment(res, itemWhiteSpace[i]);
}
if (i == 0) {
res.Append("if");
} else {
res.Append("elif");
}
_tests[i].AppendCodeString(res, ast, format);
}
if (_else != null) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append("else");
_else.AppendCodeString(res, ast, format);
}
}
示例10: AppendCodeString
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.GetProceedingWhiteSpace(ast));
res.Append('(');
if (String.IsNullOrWhiteSpace(this.GetSecondWhiteSpace(ast))) {
res.Append(format.SpaceWithinEmptyTupleExpression.Value ? " " : "");
} else {
format.ReflowComment(res, this.GetSecondWhiteSpace(ast));
}
res.Append(')');
} else {
string delimWs =
format.SpacesWithinParenthesisedTupleExpression != null ?
format.SpacesWithinParenthesisedTupleExpression.Value ? " " : "" : null;
ListExpression.AppendItems(res, ast, format, "(", this.IsMissingCloseGrouping(ast) ? "" : ")", this, Items, delimWs);
}
}
}
示例11: AppendCodeStringStmt
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append("print");
if (_dest != null) {
res.Append(this.GetSecondWhiteSpace(ast));
res.Append(">>");
_dest.AppendCodeString(res, ast, format);
if (_expressions.Length > 0) {
res.Append(this.GetThirdWhiteSpace(ast));
res.Append(',');
}
}
ListExpression.AppendItems(res, ast, format, "", "", this, Expressions);
}
示例12: AppendCodeStringStmt
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append("return");
if (_expression != null) {
int len = res.Length;
_expression.AppendCodeString(res, ast, format);
if (this.IsAltForm(ast)) {
// remove the leading white space and insert a single space
res.Remove(len, _expression.GetLeadingWhiteSpace(ast).Length);
res.Insert(len, ' ');
}
}
}
示例13: AppendCodeStringStmt
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append("exec");
_code.AppendCodeString(res, ast, format);
if (_globals != null) {
res.Append(this.GetSecondWhiteSpace(ast));
res.Append("in");
_globals.AppendCodeString(res, ast, format);
if (_locals != null) {
res.Append(this.GetThirdWhiteSpace(ast));
res.Append(',');
_locals.AppendCodeString(res, ast, format);
}
}
}
示例14: AppendCodeStringStmt
internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append("for");
_left.AppendCodeString(res, ast, format);
if (!this.IsIncompleteNode(ast)) {
res.Append(this.GetSecondWhiteSpace(ast));
res.Append("in");
_list.AppendCodeString(res, ast, format);
_body.AppendCodeString(res, ast, format); // colon is handled by suite statements...
if (_else != null) {
format.ReflowComment(res, this.GetThirdWhiteSpace(ast));
res.Append("else");
_else.AppendCodeString(res, ast, format);
}
}
}
示例15: AppendCodeString
internal void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format, string start, string end, Expression item) {
if (!String.IsNullOrEmpty(start)) {
format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
res.Append(start);
}
item.AppendCodeString(res, ast, format);
for (int i = 0; i < Iterators.Count; i++) {
Iterators[i].AppendCodeString(res, ast, format);
}
if (!String.IsNullOrEmpty(end)) {
res.Append(this.GetSecondWhiteSpace(ast));
res.Append(end);
}
}